From f43ad59bfa29ee95c071eb9024e9e963caf6e75b Mon Sep 17 00:00:00 2001 From: Arran Date: Mon, 22 Sep 2025 13:40:15 +0100 Subject: [PATCH] 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. --- Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp b/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp index aadb739ac3..cb1971e31b 100644 --- a/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp +++ b/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp @@ -1762,6 +1762,8 @@ bool CStaticFunctionDefinitions::SetElementHealth(CElement* pElement, float fHea if (pPed->IsDead() && fHealth > 0.0f) pPed->SetIsDead(false); + else if (fHealth <= 0.0f && !pPed->IsDead()) + KillPed(pElement, nullptr, 0xFF, 0xFF, false); break; }