Guest User

DF windows: fix hospital overstocking

a guest
Nov 1st, 2012
601
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 1. Include store in hospital jobs when recomputing counters
  2.  
  3. 0x68a63
  4. 0F 85 58 01 00 00
  5. 90 90 90 90 90 90
  6.  
  7. <<<<
  8. .text:00469663 jnz loc_4697C1
  9. ====
  10. .text:00469663 nop
  11. .text:00469664 nop
  12. .text:00469665 nop
  13. .text:00469666 nop
  14. .text:00469667 nop
  15. .text:00469668 nop
  16. >>>>
  17.  
  18. - if (job->getBuildingRef(BUILDING_DESTINATION) != this) continue;
  19. + // NOP
  20.  
  21. This reference points to the containers, not the hospital civzone.
  22. Since fixing this properly is too hard for a patch, just remove the
  23. check. Most people have only one hospital anyway, and it is better
  24. to err on the side of caution here.
  25.  
  26.  
  27. 2. Make the stockpiling code increment the right stock counters
  28.  
  29. 0x3dcbf9
  30. 8B 0C 90 8B 81 80 00 00 00
  31. 8B 3C 90 8B 87 80 00 00 00
  32.  
  33. <<<<
  34. .text:007DD7F9 mov ecx, [eax+edx*4]
  35. .text:007DD7FC mov eax, [ecx+80h]
  36. ====
  37. .text:007DD7F9 mov edi, [eax+edx*4]
  38. .text:007DD7FC mov eax, [edi+80h]
  39. >>>>
  40.  
  41. - id = civzones[i]->children[child_idx[i]]->id
  42. + cur_civzone = civzones[i] // existing var from previous loop
  43. + id = cur_civzone->children[child_idx[i]]->id
  44.  
  45. The reason being, later code uses that var (at this point containing
  46. useless data) to increment counters and amounts in the hospital.
  47.  
  48.  
  49. ---8<---
  50. This difference file is created by The Interactive Disassembler
  51.  
  52. Dwarf Fortress.exe
  53. 00068A63: 0F 90
  54. 00068A64: 85 90
  55. 00068A65: 58 90
  56. 00068A66: 01 90
  57. 00068A67: 00 90
  58. 00068A68: 00 90
  59. 003DCBFA: 0C 3C
  60. 003DCBFD: 81 87
RAW Paste Data