Skip to content

Commit

Permalink
ChaosMod/Failsafe: Remove redundant global idx setter / getter
Browse files Browse the repository at this point in the history
  • Loading branch information
pongo1231 committed Feb 26, 2024
1 parent f40f5dc commit e89b547
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
16 changes: 3 additions & 13 deletions ChaosMod/Components/Failsafe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Failsafe::Failsafe() : Component()
Hooks::OnScriptThreadRun,
[](rage::scrThread *thread)
{
if (!ms_SearchedForMissionStateGlobal && !Failsafe::GetGlobalIndex() && !strcmp(thread->GetName(), "main"))
if (!ms_SearchedForMissionStateGlobal && !ms_StateGlobalIdx && !strcmp(thread->GetName(), "main"))
{
auto program = Memory::ScriptThreadToProgram(thread);
if (program->m_CodeBlocks)
Expand All @@ -50,9 +50,9 @@ Failsafe::Failsafe() : Component()
}
else
{
Failsafe::SetGlobalIndex(handle.At(8).Value<int>() & 0xFFFFFF);
ms_StateGlobalIdx = handle.At(8).Value<int>() & 0xFFFFFF;

LOG("Fail state global found (Global: " << Failsafe::GetGlobalIndex() << ")");
LOG("Fail state global found (Global: " << ms_StateGlobalIdx << ")");
}
}
}
Expand All @@ -61,16 +61,6 @@ Failsafe::Failsafe() : Component()
});
}

void Failsafe::SetGlobalIndex(int idx)
{
ms_StateGlobalIdx = idx;
}

int Failsafe::GetGlobalIndex()
{
return ms_StateGlobalIdx;
}

void Failsafe::OnRun()
{
if (!m_Enabled || !ms_StateGlobalIdx || !ComponentExists<EffectDispatcher>())
Expand Down
3 changes: 0 additions & 3 deletions ChaosMod/Components/Failsafe.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ class Failsafe : public Component
Failsafe();

public:
static void SetGlobalIndex(int idx);
static int GetGlobalIndex();

virtual void OnRun() override;

template <class T>
Expand Down

0 comments on commit e89b547

Please sign in to comment.