Repository navigation
Follow the target's monster owner chain in sub_6FCBD900 - #256
Open
ResurrectedTrader wants to merge 1 commit into
Open
ResurrectedTrader wants to merge 1 commit into
ResurrectedTrader wants to merge 1 commit into
Conversation
sub_6FCBD900 resolves the target to its owner before comparing it
with the attacker. The loop must follow minion owners while the unit
is a monster (pets, and pets of pets). MOO tested UNIT_PLAYER, so a
monster target was never resolved to its owner.
1.10f (D2Game.0x6FCBD900), Hex-Rays (sub_6FCCF320 is
AIGENERAL_GetMinionOwner):
while ( a3 != nullptr )
{
if ( *a3 != 1 ) // UNIT_MONSTER
break;
v6 = sub_6FCCF320(a3);
if ( v6 == 0 || (_DWORD *)v6 == a3 )
break;
a3 = (_DWORD *)v6;
}
Disassembly:
6FCBD923 test esi, esi
6FCBD925 jz 6FCBD9C5
6FCBD92B cmp dword ptr [esi], 1 ; UNIT_MONSTER
6FCBD92E jnz 6FCBD9C5
6FCBD934 mov ecx, esi
6FCBD936 call 6FCCF320 ; AIGENERAL_GetMinionOwner
6FCBD93B test eax, eax
6FCBD93D jz 6FCBD9C5
6FCBD943 cmp eax, esi
6FCBD945 jz 6FCBD9C5
6FCBD947 mov esi, eax
6FCBD949 jmp 6FCBD923
1.14d (Game.exe 0x00554200) is the same: if ( *a3 != 1 ) break; at
0x00554254 cmp dword ptr [esi], 1.
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.
sub_6FCBD900(canpUnitattackpTarget) resolves the target to its owner before comparing it with the attacker. The game follows minion owners while the unit is a monster (pets, and pets of pets). MOO testedUNIT_PLAYER, so a monster target was never resolved to its owner, and a player's pet was compared as itself rather than as its owner.1.10f
D2Game.0x6FCBD900, Hex-Rays (sub_6FCCF320isAIGENERAL_GetMinionOwner):1.14d
UNITS_CheckIfCanAttackTarget(Game.exe0x00554200), Hex-Rays:Change
while (i && i->dwUnitType == UNIT_MONSTER). Not version-gated, since 1.10f and 1.14d agree. Also adds the 1.14d address.🤖 Generated with Claude Code