imon's fix to rule them all

might have solved dt anormalities
This commit is contained in:
FakeShemp
2016-03-11 14:57:02 +01:00
parent 6c072aae45
commit 4df936ca70
+4 -1
View File
@@ -10,9 +10,12 @@ void ExplosionEffectSystem::UpdateComponent(EntityWrapper& entity, ComponentWrap
if (delay <= 0) { if (delay <= 0) {
double& timeSinceDeath = component["TimeSinceDeath"]; double& timeSinceDeath = component["TimeSinceDeath"];
timeSinceDeath += (double)component["Speed"] * dt; timeSinceDeath += (double)component["Speed"] * dt;
if (timeSinceDeath < 0 || timeSinceDeath > (double)component["ExplosionDuration"]) { if (timeSinceDeath < 0) {
timeSinceDeath = 0.0; timeSinceDeath = 0.0;
} }
else if (timeSinceDeath >(double)component["ExplosionDuration"]) {
timeSinceDeath = (double)component["ExplosionDuration"];
}
} }
} }