Adding current level name and author to badguy warning
[supertux.git] / src / badguy / zeekling.cpp
index 69cba10..8fff3ea 100644 (file)
@@ -34,7 +34,7 @@ Zeekling::Zeekling(const Reader& reader) :
   last_self_pos()
 {
   state = FLYING;
-  speed = systemRandom.rand(130, 171);
+  speed = gameRandom.rand(130, 171);
   physic.enable_gravity(false);
 }
 
@@ -48,7 +48,7 @@ Zeekling::Zeekling(const Vector& pos, Direction d) :
   last_self_pos()
 {
   state = FLYING;
-  speed = systemRandom.rand(130, 171);
+  speed = gameRandom.rand(130, 171);
   physic.enable_gravity(false);
 }
 
@@ -64,7 +64,6 @@ Zeekling::collision_squished(GameObject& object)
 {
   sprite->set_action(dir == LEFT ? "squished-left" : "squished-right");
   kill_squished(object);
-  kill_fall();
   return true;
 }
 
@@ -110,6 +109,12 @@ Zeekling::onBumpVertical() {
 void
 Zeekling::collision_solid(const CollisionHit& hit)
 {
+  if(sprite->get_action() == "squished-left" ||
+     sprite->get_action() == "squished-right")
+  {
+    return;
+  }
+
   if(hit.top || hit.bottom) {
     onBumpVertical();
   } else if(hit.left || hit.right) {
@@ -195,6 +200,4 @@ Zeekling::active_update(float elapsed_time) {
   }
 }
 
-IMPLEMENT_FACTORY(Zeekling, "zeekling");
-
 /* EOF */