mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43: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:
@@ -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<LevelProgressionComponent>();
|
||||
if (levelProgressionComponent) m_SpeedBoost = levelProgressionComponent->GetSpeedBase();
|
||||
|
||||
Reference in New Issue
Block a user