Skip to content

Commit

Permalink
ChaosMod: Don't show stopping effects in list
Browse files Browse the repository at this point in the history
Don't update effect timer either
  • Loading branch information
pongo1231 committed Sep 22, 2023
1 parent d99179b commit 93c711c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ChaosMod/Components/EffectDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,12 @@ void EffectDispatcher::UpdateEffects(int deltaTime)
activeEffects++;
}

if (effect.IsStopping)
{
it++;
continue;
}

if (effect.HideEffectName && EffectThreads::HasThreadOnStartExecuted(effect.ThreadId))
{
effect.HideEffectName = false;
Expand Down Expand Up @@ -504,7 +510,7 @@ void EffectDispatcher::UpdateEffects(int deltaTime)
* (1.f + (t / 5 - 1) * std::max(0.f, SharedState.ActiveEffects.size() - n) / (m - n));
}

if (!effect.IsStopping && ((effect.MaxTime > 0.f && effect.Timer <= 0.f) || activeEffects > maxEffects))
if ((effect.MaxTime > 0.f && effect.Timer <= 0.f) || activeEffects > maxEffects)
{
EffectThreads::StopThread(effect.ThreadId);
effect.IsStopping = true;
Expand Down Expand Up @@ -621,6 +627,11 @@ void EffectDispatcher::DrawEffectTexts()

for (const ActiveEffect &effect : SharedState.ActiveEffects)
{
if (effect.IsStopping)
{
continue;
}

const bool hasFake = !effect.FakeName.empty();

// Temporary non-timed effects will have their entries removed already since their OnStop is called immediately
Expand Down

0 comments on commit 93c711c

Please sign in to comment.