Skip to content

Commit

Permalink
ChaosMod/Main: Get rid of Reset routine
Browse files Browse the repository at this point in the history
Seems redundant and caused permanent effects to be disabled and then subsequently reenabled when the mod is paused
  • Loading branch information
pongo1231 committed Feb 15, 2024
1 parent e948ae4 commit b0e3d14
Showing 1 changed file with 7 additions and 24 deletions.
31 changes: 7 additions & 24 deletions ChaosMod/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,6 @@ static void ParseEffectsFile()
EffectConfig::ReadConfig("chaosmod/configs/effects.ini", g_EnabledEffects, { "chaosmod/effects.ini" });
}

static void Reset()
{
if (ComponentExists<EffectDispatcher>())
{
GetComponent<EffectDispatcher>()->Reset();
while (GetComponent<EffectDispatcher>()->IsClearingEffects())
{
GetComponent<EffectDispatcher>()->OnRun();
WAIT(0);
}
}

ClearEntityPool();

for (auto component : g_Components)
{
component->OnModPauseCleanup();
}
}

static void Init()
{
// Attempt to print game build number
Expand Down Expand Up @@ -240,9 +220,7 @@ static void MainRun()
Memory::RunLateHooks();
}

g_MainThread = GetCurrentFiber();

Reset();
g_MainThread = GetCurrentFiber();

ms_Flags.ToggleModState = g_OptionsManager.GetConfigValue({ "DisableStartup" }, OPTION_DEFAULT_DISABLE_STARTUP);

Expand Down Expand Up @@ -287,7 +265,12 @@ static void MainRun()
}
}

Reset();
ClearEntityPool();

for (auto component : g_Components)
{
component->OnModPauseCleanup();
}
}
else
{
Expand Down

0 comments on commit b0e3d14

Please sign in to comment.