Guest User

DF linux: fix hospital overstocking

a guest
Nov 1st, 2012
293
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. 0x746d7
  4. 75 D7
  5. 90 90
  6.  
  7. <<<<
  8. .text:080BC6D7 jnz short loc_80BC6B0
  9. ====
  10. .text:080BC6D7 nop
  11. .text:080BC6D8 nop
  12. >>>>
  13.  
  14. - if (job->getBuildingRef(BUILDING_DESTINATION) != this) continue;
  15. + // NOP
  16.  
  17. This reference points to the containers, not the hospital civzone.
  18. Since fixing this properly is too hard for a patch, just remove the
  19. check. Most people have only one hospital anyway, and it is better
  20. to err on the side of caution here.
  21.  
  22.  
  23. 2. Make the stockpiling code increment the right stock counters
  24.  
  25. 0x67cb0e
  26. 0B 04 90
  27. 8B 1C 90
  28.  
  29. 0x67cb18
  30. 8B 40 74
  31. 8B 43 74
  32.  
  33. <<<<
  34. .text:086C4B0E mov eax, [eax+edx*4]
  35. .text:086C4B11 mov edx, [esp+ecx*4+39Ch+var_2B4]
  36. .text:086C4B18 mov eax, [eax+74h]
  37. ====
  38. .text:086C4B0E mov ebx, [eax+edx*4]
  39. .text:086C4B11 mov edx, [esp+ecx*4+39Ch+var_2B4]
  40. .text:086C4B18 mov eax, [ebx+74h]
  41. >>>>
  42.  
  43. - id = civzones[i]->children[child_idx[i]]->id
  44. + cur_civzone = civzones[i] // existing var from previous loop
  45. + id = cur_civzone->children[child_idx[i]]->id
  46.  
  47. The reason being, later code uses that var (at this point containing
  48. useless data) to increment counters and amounts in the hospital.
  49.  
  50.  
  51. ---8<---
  52. This difference file is created by The Interactive Disassembler
  53.  
  54. Dwarf_Fortress
  55. 000746D7: 75 90
  56. 000746D8: D7 90
  57. 0067CB0F: 04 1C
  58. 0067CB19: 40 43
RAW Paste Data