Skip to content

Commit c00cdcd

Browse files
committed
Fix bug
1 parent 721a1df commit c00cdcd

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

Client/game_sa/CPedSA.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ void CPedSA::SetBleeding(bool bBleeding)
854854
bool CPedSA::SetOnFire(bool onFire)
855855
{
856856
CPedSAInterface* pInterface = GetPedInterface();
857-
if (onFire == !!pInterface->pFireOnPed)
857+
if (onFire && pInterface->pFireOnPed)
858858
return false;
859859

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

883-
fire->Extinguish();
883+
CTaskManager* taskManager = m_pPedIntelligence->GetTaskManager();
884+
if (taskManager)
885+
{
886+
CTask* task = taskManager->GetTaskSecondary(TASK_SECONDARY_PARTIAL_ANIM);
887+
if (task && task->GetTaskType() == TASK_SIMPLE_PLAYER_ON_FIRE)
888+
taskManager->RemoveTaskSecondary(TASK_SECONDARY_PARTIAL_ANIM);
889+
}
884890
}
885891

886892
return true;

Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2594,7 +2594,7 @@ bool CStaticFunctionDefinitions::SetPedOnFire(CClientEntity& Entity, bool bOnFir
25942594
{
25952595
if (IS_PED(&Entity))
25962596
{
2597-
if (!Entity.IsLocalEntity())
2597+
if (!Entity.IsLocalEntity() && &Entity != GetLocalPlayer())
25982598
return false;
25992599

26002600
CClientPed& Ped = static_cast<CClientPed&>(Entity);

Client/mods/deathmatch/logic/luadefs/CLuaElementDefs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2520,7 +2520,7 @@ bool CLuaElementDefs::SetLowLodElement(lua_State* luaVM, CClientEntity* pEntity,
25202520

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

25262526
return entity->SetOnFire(onFire);

0 commit comments

Comments
 (0)