diff --git a/src/Game/Systems/ExplosionEffectSystem.cpp b/src/Game/Systems/ExplosionEffectSystem.cpp index 71de192a..e75ebb24 100644 --- a/src/Game/Systems/ExplosionEffectSystem.cpp +++ b/src/Game/Systems/ExplosionEffectSystem.cpp @@ -7,12 +7,15 @@ void ExplosionEffectSystem::UpdateComponent(EntityWrapper& entity, ComponentWrap delay = std::max(0.0, delay - dt); } - if (delay <= 0) { - double& timeSinceDeath = component["TimeSinceDeath"]; - timeSinceDeath += (double)component["Speed"] * dt; - if (timeSinceDeath < 0 || timeSinceDeath > (double)component["ExplosionDuration"]) { - timeSinceDeath = 0.0; - } - } + if (delay <= 0) { + double& timeSinceDeath = component["TimeSinceDeath"]; + timeSinceDeath += (double)component["Speed"] * dt; + if (timeSinceDeath < 0) { + timeSinceDeath = 0.0; + } + else if (timeSinceDeath >(double)component["ExplosionDuration"]) { + timeSinceDeath = (double)component["ExplosionDuration"]; + } + } }