I found this one in general chat archive and thought it should be in index.
here is original topic
viewtopic.php?f=20&t=1193
Spocks-cuddly-tribble wrote:Well, then let's fix this nasty overflow:henka wrote:the problem is probably caused by the calculation of the average morale, which is displayed in the intel empire screen (...) for the sum calculation a signed 2 byte value is used, which can only hold a maximum positiv value of 32767.
I think I see the problem. This should be fully operative:
Code: Select all
trek.exe at 0x60581 change: 8B 14 24 8D 83 40 02 00 00 01 D0 66 03 78 44 to: 8D 83 40 02 00 00 03 04 24 0F B7 40 44 03 F8 AND at 0x605C2 change: 0F BF to: 90 8B asm 461181: lea eax, [ebx+240h] add eax, [esp] movzx eax, word ptr [eax+44h] add edi, eax asm 4611C2: nop mov edx, edi