Skip to content

Commit

Permalink
ChaosMod/EffectDispatcher: Apply timer speed meta modifier to displac…
Browse files Browse the repository at this point in the history
…ement distance
  • Loading branch information
pongo1231 committed Feb 12, 2024
1 parent 4a00292 commit d36c606
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions ChaosMod/Components/EffectDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,16 @@ void EffectDispatcher::OnRun()
deltaTime = 0;
}

if (!PauseTimer && !m_DistanceChaosState.EnableDistanceBasedEffectDispatch)
if (!PauseTimer)
{
UpdateTimer(deltaTime);
}

if (!PauseTimer && m_DistanceChaosState.EnableDistanceBasedEffectDispatch)
{
UpdateTravelledDistance();
if (m_DistanceChaosState.EnableDistanceBasedEffectDispatch)
{
UpdateTravelledDistance();
}
else
{
UpdateTimer(deltaTime);
}
}

DrawTimerBar();
Expand Down Expand Up @@ -335,13 +337,14 @@ void EffectDispatcher::UpdateTravelledDistance()
return;
}

float distance =
auto distance =
GET_DISTANCE_BETWEEN_COORDS(position.x, position.y, position.z, m_DistanceChaosState.SavedPosition.x,
m_DistanceChaosState.SavedPosition.y, m_DistanceChaosState.SavedPosition.z, true);

if (m_DistanceChaosState.DistanceType == DistanceChaosState::TravelledDistanceType::Displacement)
{
if (distance >= m_DistanceChaosState.DistanceToActivateEffect)
if (distance * (ComponentExists<MetaModifiers>() ? GetComponent<MetaModifiers>()->TimerSpeedModifier : 1.f)
>= m_DistanceChaosState.DistanceToActivateEffect)
{
if (DispatchEffectsOnTimer)
{
Expand Down

0 comments on commit d36c606

Please sign in to comment.