Skip to content

Commit f43ad59

Browse files
committed
Fix #4482
Although I had a look at git blame to see which commit broke this, I didn't see one, so just making a PR that fixes players not dying properly when setElementHealth(plr, 0) is used.
1 parent 359ba7a commit f43ad59

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,6 +1762,8 @@ bool CStaticFunctionDefinitions::SetElementHealth(CElement* pElement, float fHea
17621762

17631763
if (pPed->IsDead() && fHealth > 0.0f)
17641764
pPed->SetIsDead(false);
1765+
else if (fHealth <= 0.0f && !pPed->IsDead())
1766+
KillPed(pElement, nullptr, 0xFF, 0xFF, false);
17651767

17661768
break;
17671769
}

0 commit comments

Comments
 (0)