Skip to content

Commit

Permalink
ChaosMod/EffectDispatcher: Remove unnecessary variable assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
pongo1231 committed Jan 19, 2025
1 parent f1bd901 commit 88b6b8c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ChaosMod/Components/EffectDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,8 @@ void EffectDispatcher::UpdateEffects(int deltaTime)

float adjustedDeltaTime = deltaTime / 1000.f;

int maxEffects = m_MaxRunningEffects;
int activeEffects = 0;
// Reverse order to ensure the first effects are removed if activeEffects > maxEffects
// Reverse order to ensure the first effects are removed if activeEffects > m_MaxRunningEffects
for (auto it = SharedState.ActiveEffects.rbegin(); it != SharedState.ActiveEffects.rend();)
{
auto &activeEffect = *it;
Expand Down Expand Up @@ -374,7 +373,7 @@ void EffectDispatcher::UpdateEffects(int deltaTime)
? 1.f
: std::max(1.f, .5f * (activeEffects - EFFECT_NONTIMED_TIMER_SPEEDUP_MIN_EFFECTS + 3)));

if (activeEffect.Timer <= 0.f || (!activeEffect.IsMeta && activeEffects > maxEffects))
if (activeEffect.Timer <= 0.f || (!activeEffect.IsMeta && activeEffects > m_MaxRunningEffects))
{
if (activeEffect.Timer < -60.f)
{
Expand Down

0 comments on commit 88b6b8c

Please sign in to comment.