Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 10 additions & 4 deletions Client/game_sa/CPedSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ void CPedSA::SetBleeding(bool bBleeding)
bool CPedSA::SetOnFire(bool onFire)
{
CPedSAInterface* pInterface = GetPedInterface();
if (onFire == !!pInterface->pFireOnPed)
if (onFire && pInterface->pFireOnPed)
return false;

auto* fireManager = static_cast<CFireManagerSA*>(pGame->GetFireManager());
Expand All @@ -877,10 +877,16 @@ bool CPedSA::SetOnFire(bool onFire)
else
{
CFire* fire = fireManager->GetFire(static_cast<CFireSAInterface*>(pInterface->pFireOnPed));
if (!fire)
return false;
if (fire)
fire->Extinguish();

fire->Extinguish();
CTaskManager* taskManager = m_pPedIntelligence->GetTaskManager();
if (taskManager)
{
CTask* task = taskManager->GetTaskSecondary(TASK_SECONDARY_PARTIAL_ANIM);
if (task && task->GetTaskType() == TASK_SIMPLE_PLAYER_ON_FIRE)
taskManager->RemoveTaskSecondary(TASK_SECONDARY_PARTIAL_ANIM);
}
}

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2594,7 +2594,7 @@ bool CStaticFunctionDefinitions::SetPedOnFire(CClientEntity& Entity, bool bOnFir
{
if (IS_PED(&Entity))
{
if (!Entity.IsLocalEntity())
if (!Entity.IsLocalEntity() && &Entity != GetLocalPlayer())
return false;

CClientPed& Ped = static_cast<CClientPed&>(Entity);
Expand Down
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/logic/luadefs/CLuaElementDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2520,7 +2520,7 @@ bool CLuaElementDefs::SetLowLodElement(lua_State* luaVM, CClientEntity* pEntity,

bool CLuaElementDefs::SetElementOnFire(CClientEntity* entity, bool onFire) noexcept
{
if (!entity->IsLocalEntity())
if (!entity->IsLocalEntity() && entity != CStaticFunctionDefinitions::GetLocalPlayer())
return false;

return entity->SetOnFire(onFire);
Expand Down
Loading