diff --git a/Client/mods/deathmatch/logic/CClientPed.cpp b/Client/mods/deathmatch/logic/CClientPed.cpp index b73cde4f4a..489e4ed64e 100644 --- a/Client/mods/deathmatch/logic/CClientPed.cpp +++ b/Client/mods/deathmatch/logic/CClientPed.cpp @@ -1,8 +1,9 @@ /***************************************************************************** * - * PROJECT: Multi Theft Auto + * PROJECT: Multi Theft Auto v1.0 + * (Shared logic for modifications) * LICENSE: See LICENSE in the top level directory - * FILE: mods/deathmatch/logic/CClientPed.cpp + * FILE: mods/shared_logic/CClientPed.cpp * PURPOSE: Ped entity class * *****************************************************************************/ @@ -1733,17 +1734,8 @@ void CClientPed::InternalSetHealth(float fHealth) // Recheck we have a ped, ReCreateModel might destroy it if (m_pPlayerPed) { - // update dead state for peds - if (fHealth > 0 && IsDead()) - { - m_bDead = false; - } - // Set the new health m_pPlayerPed->SetHealth(fHealth); - - // Recover from dead state to bring the ped back to life - m_pTaskManager->RemoveTask(TASK_PRIORITY_EVENT_RESPONSE_NONTEMP); } } } @@ -1892,10 +1884,16 @@ void CClientPed::Kill(eWeaponType weaponType, unsigned char ucBodypart, bool bSt } } } - - // set health and armor to 0 - SetHealth(0.0f); - SetArmor(0.0f); + if (m_bIsLocalPlayer) + { + SetHealth(0.0f); + SetArmor(0.0f); + } + else + { + LockHealth(0.0f); + LockArmor(0.0f); + } // Silently remove the ped satchels DestroySatchelCharges(false, true); diff --git a/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp b/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp index dc44ffbdd3..763651a032 100644 --- a/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp +++ b/Server/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp @@ -1,6 +1,6 @@ /***************************************************************************** * - * PROJECT: Multi Theft Auto + * PROJECT: Multi Theft Auto v1.0 * LICENSE: See LICENSE in the top level directory * FILE: mods/deathmatch/logic/CStaticFunctionDefinitions.cpp * PURPOSE: Lua static function definitions class @@ -1596,14 +1596,6 @@ bool CStaticFunctionDefinitions::SetElementHealth(CElement* pElement, float fHea // This makes sure the health is set to what will get reported unsigned char ucHealth = static_cast(fHealth * 1.25f); fHealth = static_cast(ucHealth) / 1.25f; - - // update dead state for peds - if (fHealth > 0 && pPed->IsDead()) - { - pPed->SetIsDead(false); - } - - // set new health pPed->SetHealth(fHealth); } else