Repository navigation
Fix UNITS_IsAnimModeGetHit testing the block modes - #241
Open
ResurrectedTrader wants to merge 1 commit into
Open
ResurrectedTrader wants to merge 1 commit into
ResurrectedTrader wants to merge 1 commit into
Conversation
UNITS_IsAnimModeGetHit compared against PLRMODE_BLOCK / MONMODE_BLOCK, which makes it a copy of UNITS_IsAnimModeBlocking. Since the block test runs first in UNITS_UpdateAnimRateAndVelocity, the get-hit branch was unreachable and a get-hit animation ran at the default rate instead of (faster hit recovery + 50)%. In 1.10f the check is inlined in UNITS_UpdateAnimRateAndVelocity (D2Common.0x6FDBF050): after the block test (player 9 / monster 6) it compares player mode 4 (0x6FDBF285) and monster mode 3 (0x6FDBF212), then reads STAT_ITEM_FASTERGETHITRATE and adds 50. 1.14d does the same (Game.exe.0x624095 / 0x62409A). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
UNITS_IsAnimModeGetHitcompares againstPLRMODE_BLOCK/MONMODE_BLOCK, which makes it a copy ofUNITS_IsAnimModeBlocking. Because the block test runs first inUNITS_UpdateAnimRateAndVelocity, the get-hit branch can never be reached, and a get-hit plays at the default rate instead of(faster hit recovery + 50)%.1.10f
Both checks are inlined in
UNITS_UpdateAnimRateAndVelocity(D2Common.0x6FDBF050, #10376). The block test (player 9 / monster 6) goes toSTAT_ITEM_FASTERBLOCKRATE(0x66). The get-hit test after it uses player 4 / monster 3 and goes toSTAT_ITEM_FASTERGETHITRATE(0x63) + 50:1.14d
The same in
Game.exe0x623F50:A 1.14d replay shows the effect: a monster's get-hit
wAnimSpeedwas 152 with MOO and 76 on the real client, with the samedwFrameCountPrecise, so MOO's get-hit finished twice as fast.Change
Compare against
PLRMODE_GETHIT/MONMODE_GETHIT.🤖 Generated with Claude Code