mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
fix: slows and speed buffs change enemy movement speed
Speed buffs (BuffParameters "speed", for example the slow from the Great Katana of Freezing and the Shurikens of Ice) and speed behaviours go through ControllablePhysicsComponent's speed multiplier, which only players' clients used. Enemies move with MovementAIComponent, which ignored it, so slows had no effect on them. - MovementAIComponent scales its waypoint speed by the entity's speed multiplier when one is set. - RemoveSpeedboost set the multiplier of any entity without a LevelProgressionComponent (every enemy and pet) to 0 once its last boost ended, which was harmless while nothing read it for them. It now goes back to the normal base of 500 (multiplier 1). Needs an in-game check with the freezing katana charge-up against an enemy. Fixes #1179 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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<ControllablePhysicsComponent>();
|
||||
if (controllablePhysics && controllablePhysics->GetSpeedMultiplier() > 0.0f) speed *= controllablePhysics->GetSpeedMultiplier();
|
||||
|
||||
const auto delta = m_NextWaypoint - source;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user