Skip to content

D2GAME_TARGETS_Last_6FC40380 (aka TARGETS_RemoveTarget) Missing Else Branch #178

@Necrolis

Description

@Necrolis

if (pTargetNode == pGame->pTargetNodes[nNodeIndex])

The if statement for in the path for target nodes >= 8 has an else branch that is missing from the code but present in the assembly; taken from 1.10 D2Game (verified in 1.13c):

6FC403FF     CMP EDX,EDI ; if (pTargetNode == pGame->pTargetNodes[nNodeIndex])
6FC40401     JNZ SHORT D2Game.6FC4041D
6FC40403     MOV EDI,DWORD PTR DS:[EDX+8]
6FC40406     MOV DWORD PTR DS:[ECX+EAX*4+10F8],EDI
6FC4040D     MOV EAX,DWORD PTR DS:[EDX+8]
6FC40410     TEST EAX,EAX
6FC40412     JE SHORT D2Game.6FC40433
6FC40414     MOV DWORD PTR DS:[EAX+C],0
6FC4041B     JMP SHORT D2Game.6FC40433
6FC4041D     MOV EAX,DWORD PTR DS:[EDX+C] ; else
6FC40420     MOV EDI,DWORD PTR DS:[EDX+8]
6FC40423     MOV DWORD PTR DS:[EAX+8],EDI
6FC40426     MOV EAX,DWORD PTR DS:[EDX+8]
6FC40429     TEST EAX,EAX
6FC4042B     JE SHORT D2Game.6FC40433
6FC4042D     MOV EDI,DWORD PTR DS:[EDX+C]
6FC40430     MOV DWORD PTR DS:[EAX+C],EDI

The alternate case for target nodes < 8 is however correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions