mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-11 01:38:17 +08:00
[saco] Match FUNC_100A5240; the team-damage test compares two bytes, not two ints
This commit is contained in:
1 parent
8bb2a5c54d
commit
c478c7dbfe
1 file changed
+33
@@ -2830,6 +2830,39 @@ DWORD dwDamageWeapon = 0;
|
||||
BOOL bIgnoreVehicleDamage = 0;
|
||||
DWORD dwInflictDamageRetAddr = 0;
|
||||
|
||||
PLAYERID wInflictDamageDriver;
|
||||
CPlayerPool *pInflictDamagePool;
|
||||
|
||||
// true when the local player drives dwVehicle and dwPed belongs to a team mate
|
||||
BOOL FUNC_100A5240(DWORD dwVehicle, DWORD dwPed)
|
||||
{
|
||||
if(!pNetGame || !pGame || !pGame->FindPlayerPed()
|
||||
|| !pGame->FindPlayerPed()->IsInVehicle()
|
||||
|| pGame->FindPlayerPed()->sub_100ABFC0()
|
||||
|| pGame->FindPlayerPed()->FUNC_100AC000() != (int)dwVehicle)
|
||||
return FALSE;
|
||||
|
||||
wInflictDamageDriver = FUNC_100A3AE0(dwPed);
|
||||
if(wInflictDamageDriver == 0xFFFF) return FALSE;
|
||||
|
||||
pInflictDamagePool = pNetGame->GetPlayerPool();
|
||||
if(!pInflictDamagePool) return FALSE;
|
||||
|
||||
if(pNetGame->GetSettings()->field_22)
|
||||
{
|
||||
BYTE byteTeam = pInflictDamagePool->m_pLocalPlayer->m_byteTeam;
|
||||
|
||||
if(byteTeam == 0xFF) return FALSE;
|
||||
|
||||
if((BYTE)pNetGame->GetPlayerPool()->GetAt(wInflictDamageDriver)->field_109 == byteTeam)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
NUDE CVehicle__InflictDamage_Hook()
|
||||
{
|
||||
_asm mov dwDamagedVehicle, ecx
|
||||
|
||||
Reference in new issue
Block a user