Skip to content

Commit 869d739

Browse files
committed
Revert "Fix setPedOnFire(ped, false) doesn't cancel TASK_SIMPLE_PLAYER_ON_FIRE (again) (#4188)"
Reason: see #4188 (comment) This reverts commit 7eda064.
1 parent d5d1aaa commit 869d739

File tree

4 files changed

+1
-46
lines changed

4 files changed

+1
-46
lines changed

Client/game_sa/CFireSA.cpp

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
#include "CFireSA.h"
1515
#include "CGameSA.h"
1616
#include "CPoolsSA.h"
17-
#include <game/CTaskManager.h>
18-
#include <game/TaskTypes.h>
1917

2018
extern CGameSA* pGame;
2119

@@ -211,43 +209,3 @@ void CFireSA::SetNumGenerationsAllowed(char generations)
211209
{
212210
internalInterface->nNumGenerationsAllowed = generations;
213211
}
214-
215-
////////////////////////////////////////////////////////////////////////
216-
// CFire::Extinguish
217-
//
218-
// Fix GH #3249 (PLAYER_ON_FIRE task is not aborted after the fire is extinguished)
219-
////////////////////////////////////////////////////////////////////////
220-
static void AbortFireTask(CEntitySAInterface* entityOnFire)
221-
{
222-
auto ped = pGame->GetPools()->GetPed(reinterpret_cast<DWORD*>(entityOnFire));
223-
if (!ped || !ped->pEntity)
224-
return;
225-
226-
CTaskManager* taskManager = ped->pEntity->GetPedIntelligence()->GetTaskManager();
227-
if (!taskManager)
228-
return;
229-
230-
taskManager->RemoveTaskSecondary(TASK_SECONDARY_PARTIAL_ANIM, TASK_SIMPLE_PLAYER_ON_FIRE);
231-
}
232-
233-
#define HOOKPOS_CFire_Extinguish 0x539429
234-
#define HOOKSIZE_CFire_Extinguish 6
235-
static constexpr std::uintptr_t CONTINUE_CFire_Extinguish = 0x53942F;
236-
static void _declspec(naked) HOOK_CFire_Extinguish()
237-
{
238-
_asm
239-
{
240-
mov [eax+730h], edi
241-
242-
push eax
243-
call AbortFireTask
244-
add esp, 4
245-
246-
jmp CONTINUE_CFire_Extinguish
247-
}
248-
}
249-
250-
void CFireSA::StaticSetHooks()
251-
{
252-
EZHookInstall(CFire_Extinguish);
253-
}

Client/game_sa/CFireSA.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,4 @@ class CFireSA : public CFire
6464
void SetStrength(float fStrength);
6565
void SetNumGenerationsAllowed(char generations);
6666
CFireSAInterface* GetInterface() { return internalInterface; }
67-
68-
static void StaticSetHooks();
6967
};

Client/game_sa/CGameSA.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ CGameSA::CGameSA()
247247
CVehicleSA::StaticSetHooks();
248248
CCheckpointSA::StaticSetHooks();
249249
CHudSA::StaticSetHooks();
250-
CFireSA::StaticSetHooks();
251250
CPtrNodeSingleLinkPoolSA::StaticSetHooks();
252251
CVehicleAudioSettingsManagerSA::StaticSetHooks();
253252
}

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

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

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

25282528
return entity->SetOnFire(onFire);

0 commit comments

Comments
 (0)