diff --git a/dGame/dComponents/ControllablePhysicsComponent.cpp b/dGame/dComponents/ControllablePhysicsComponent.cpp index 86be8622b..9778ae301 100644 --- a/dGame/dComponents/ControllablePhysicsComponent.cpp +++ b/dGame/dComponents/ControllablePhysicsComponent.cpp @@ -289,7 +289,7 @@ void ControllablePhysicsComponent::RemoveSpeedboost(float value) { } // Recalculate speedboost since we removed one - m_SpeedBoost = 0.0f; + m_SpeedBoost = 500.0f; // Entities without level progression (enemies, pets) go back to the normal multiplier of 1 if (m_ActiveSpeedBoosts.empty()) { // no active speed boosts left, so return to base speed auto* levelProgressionComponent = m_Parent->GetComponent(); if (levelProgressionComponent) m_SpeedBoost = levelProgressionComponent->GetSpeedBase(); diff --git a/dGame/dComponents/MovementAIComponent.cpp b/dGame/dComponents/MovementAIComponent.cpp index f5ef9f367..dbb623a07 100644 --- a/dGame/dComponents/MovementAIComponent.cpp +++ b/dGame/dComponents/MovementAIComponent.cpp @@ -155,7 +155,10 @@ void MovementAIComponent::Update(const float deltaTime) { } else { m_CurrentSpeed = std::min(m_CurrentSpeed + m_Acceleration, m_MaxSpeed); - const auto speed = m_CurrentSpeed * m_BaseSpeed; // scale speed based on base speed + // scale speed based on base speed, and by any speed buffs or slows on this entity + auto speed = m_CurrentSpeed * m_BaseSpeed; + const auto* const controllablePhysics = m_Parent->GetComponent(); + if (controllablePhysics && controllablePhysics->GetSpeedMultiplier() > 0.0f) speed *= controllablePhysics->GetSpeedMultiplier(); const auto delta = m_NextWaypoint - source;