Skip to content

Commit

Permalink
Damage fixes to repair traps and AI damage.
Browse files Browse the repository at this point in the history
  • Loading branch information
pnill committed Jan 13, 2020
1 parent 6679b4c commit 99b00f4
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions T4MP/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,9 +634,11 @@ __declspec(naked) void DamagePlayer()

PUSHAD
PUSHFD

mov eax,[ecx]
cmp eax,0x656B98
jnz normal_ret
}

/*
If we're not the server we update the pointer of the damage to be 0 so that the client applies no damage.
This is a problem, because the damage function is also used to determine if an client should trigger events.
Expand All @@ -661,14 +663,15 @@ __declspec(naked) void DamagePlayer()

__asm
{
POPFD
POPAD
normal_ret:
POPFD
POPAD

or dword ptr[ecx+0x28],2
mov eax, 0x0051E570
jmp eax
push DamagePlayer_Ret
ret
or dword ptr[ecx + 0x28], 2
mov eax, 0x0051E570
jmp eax
push DamagePlayer_Ret
ret
}

}
Expand Down Expand Up @@ -715,6 +718,7 @@ __declspec(naked) void KillPlayer()
player->death_type = death_type;
}
}

}

__asm
Expand Down Expand Up @@ -758,6 +762,9 @@ tIsDead pIsDead;
BOOL __stdcall IsDead(DMPlayer* pDMPlayer)
{

if (*(DWORD*)pDMPlayer != 0x656B98)
return pIsDead(pDMPlayer);

if (t4net.server)
return pIsDead(pDMPlayer);
else
Expand Down

0 comments on commit 99b00f4

Please sign in to comment.