ThePhrozenKeep / D2MOO

Reimplementation of the Diablo2 game coupled with patching facilities for modders.
MIT License
93 stars 29 forks source link

Incorrect Return Value in `sub_6FCC1870` (AKA UNITS_CannotEnterHitRecovery) #177

Open Necrolis opened 1 week ago

Necrolis commented 1 week ago

https://github.com/ThePhrozenKeep/D2MOO/blob/5f10151c29125c170692151df6daa4129ea56dc3/source/D2Game/src/UNIT/SUnitDmg.cpp#L2217

The case for this line (aka when the pUnit is a player) should be returning FALSE, ie: allow the unit (player) to enter hit recovery.

in 1.10, the asm for these lines is:

6FCC1992         TEST ESI,ESI
6FCC1994         JE SHORT D2Game.6FCC1A0C
6FCC1996         CMP DWORD PTR DS:[ESI],1
6FCC1999         JNZ SHORT D2Game.6FCC1A0C

And D2Game.6FCC1A0C does the following:

6FCC1A0C         POP EDI
6FCC1A0D         POP ESI
6FCC1A0E         POP EBP
6FCC1A0F         XOR EAX,EAX
6FCC1A11         POP EBX
6FCC1A12         POP ECX
6FCC1A13         RETN 4