The unrest orders (emergency morale programs) in BotF are somewhat frustrating:
- A bug limits morale to base morale if it gets higher due to other events/bonuses (see above code).
- In progress/preparation they do not prevent any negative events until morale increases above critical thresholds.
- During the preparation phase 'commencing' (see above turn delays) they have no effect at all.
- They disable all local Industry, Credits, Intel and Research outputs from the beginning (without notice/display):
Code: Select all
0043F4C9 mov [ecx+48h], edx ; sets Industry output to zero
0043F4CC mov [ecx+4Ch], edx ; sets Credit output to zero
0043F4CF mov [ecx+50h], edx ; sets Research output to zero
0043F4D6 mov [ecx+54h], edx ; sets Intel output to zero
Below patch fixes the base morale glitch and prevents negative morale events from the beginning.
NOT intel- or (ex)random-events = Rebellions (systInfo+80 fails here / ordInfo is too complicated).
Code: Select all
NAME: Unrest Order (emergency morale program) Fix
DESC: Fixes a base morale glitch + prevents negative morale events (not intel/random) in progress & preparation.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=58087#p58087
>> 0x0003e908 8b 51 42
>> 0x0005f164 8b 51 42 8b 84 44 84 00 00
>> 0x0005f16e c1 fa 10 c1 f8 10 01 d0 31 d2 66 8b 93 f0 02 00 00
<< 0x0003e908 eb 5e 90
<< 0x0005f164 0f b7 69 44 0f b7 93 f0 02
<< 0x0005f16e 00 3b ea 7d 2b 0f b6 84 44 86 00 00 00 03 c5 90 90
#0043F508 EB 5E JMP SHORT 43F568 // skip morale events if unrest order
#0043F50A 90 NOP
#0045FD64 0FB769 44 MOVZX EBP,WORD [ECX+44] // current morale
#0045FD68 0FB793 F0020000 MOVZX EDX,WORD [EBX+2F0] // base morale
#0045FD6F 3BEA CMP EBP,EDX
#0045FD71 7D 2B JGE SHORT 45FD9E // current is better -> exit done
#0045FD73 0FB68444 86000000 MOVZX EAX,BYTE [ESP+EAX*2+86] // unrest order edifice.bst output
#0045FD7B 03C5 ADD EAX,EBP
#0045FD7D 9090 NOP
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.