Fix issue with action not being updated when typing grow()/fire()/etc in console...
[supertux.git] / src / object / particlesystem.cpp
index a63afa0..fa435be 100644 (file)
@@ -33,7 +33,7 @@
 #include "random_generator.hpp"
 
 ParticleSystem::ParticleSystem(float max_particle_size)
-       : max_particle_size(max_particle_size)
+        : max_particle_size(max_particle_size)
 {
   virtual_width = SCREEN_WIDTH + max_particle_size * 2;
   virtual_height = SCREEN_HEIGHT + max_particle_size *2;
@@ -141,7 +141,7 @@ void SnowParticleSystem::update(float elapsed_time)
 
     anchor_delta = (particle->anchorx - particle->pos.x);
     particle->wobble += (4 * anchor_delta * 0.05) + systemRandom.randf(-0.5, 0.5);
-    particle->wobble *= 0.99;
+    particle->wobble *= 0.99f;
     particle->anchorx += particle->drift_speed * elapsed_time;
   }
 }
@@ -163,10 +163,7 @@ GhostParticleSystem::GhostParticleSystem()
     particle->pos.y = systemRandom.randf(SCREEN_HEIGHT);
     int size = systemRandom.rand(2);
     particle->texture = ghosts[size];
-    do {
-      particle->speed = size*.2 + systemRandom.randf(3.6);
-    } while(particle->speed < 1);
-    particle->speed *= 50;
+    particle->speed = systemRandom.randf(std::max(50, (size * 10)), 180 + (size * 10));
     particles.push_back(particle);
   }
 }
@@ -206,7 +203,7 @@ void GhostParticleSystem::update(float elapsed_time)
 }
 
 CloudParticleSystem::CloudParticleSystem()
-       : ParticleSystem(128)
+        : ParticleSystem(128)
 {
   cloudimage = new Surface("images/objects/particles/cloud.png");