Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions Client/mods/deathmatch/logic/CClientGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4394,12 +4394,10 @@ bool CClientGame::ApplyPedDamageFromGame(eWeaponType weaponUsed, float fDamage,
return false;
}

if (pDamagedPed->IsLocalPlayer())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't this check added to avoid possible desync issues?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, since HP will be synchronized when using setElementHealth in onClientPedDamage

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HP is synchronized, but a remote player can die locally. It can cause nasty issues potentially

{
// Reget values in case they have been changed during onClientPlayerDamage event (Avoid AC#1 kick)
fCurrentHealth = pDamagedPed->GetGamePlayer()->GetHealth();
fCurrentArmor = pDamagedPed->GetGamePlayer()->GetArmor();
}
// Reget values in case they have been changed during onClientPlayerDamage event (Avoid AC#1 kick)
// (FileEX): We need to refresh the health value here because it may have been changed in the onClientPedDamage/onClientPlayerDamage event
fCurrentHealth = pDamagedPed->GetGamePlayer()->GetHealth();
fCurrentArmor = pDamagedPed->GetGamePlayer()->GetArmor();

bool bIsBeingShotWhilstAiming = (weaponUsed >= WEAPONTYPE_PISTOL && weaponUsed <= WEAPONTYPE_MINIGUN && pDamagedPed->IsUsingGun());
bool bOldBehaviour = !IsGlitchEnabled(GLITCH_HITANIM);
Expand Down
Loading