fix cr/lfs and remove trailing whitespaces...
[supertux.git] / src / badguy / bomb.cpp
index 4135159..c26fe15 100644 (file)
@@ -23,8 +23,8 @@
 #include "random_generator.hpp"
 #include "object/sprite_particle.hpp"
 
-Bomb::Bomb(const Vector& pos, Direction dir)
-       : BadGuy(pos, dir, "images/creatures/mr_cherry/cherry.sprite")
+Bomb::Bomb(const Vector& pos, Direction dir, std::string custom_sprite /*= "images/creatures/mr_cherry/cherry.sprite"*/ )
+       : BadGuy( pos, dir, custom_sprite )
 {
   state = STATE_TICKING;
   set_action(dir == LEFT ? "ticking-left" : "ticking-right", 1);
@@ -57,13 +57,11 @@ Bomb::write(lisp::Writer& )
   // bombs are only temporarily so don't write them out...
 }
 
-HitResponse
-Bomb::collision_solid(GameObject& , const CollisionHit& hit)
+void
+Bomb::collision_solid(const CollisionHit& hit)
 {
-  if(fabsf(hit.normal.y) > .5)
+  if(hit.bottom)
     physic.set_velocity_y(0);
-
-  return CONTINUE;
 }
 
 HitResponse
@@ -98,7 +96,7 @@ Bomb::active_update(float )
         remove_me();
       }
       break;
-  } 
+  }
 }
 
 void
@@ -131,4 +129,3 @@ Bomb::kill_fall()
   if (state != STATE_EXPLODING)  // we don't want it exploding again
     explode();
 }
-