qmax patch to fix bug #0000389 - colors in infoblocks
[supertux.git] / src / badguy / mriceblock.cpp
index 7cd8d86..0b9b9ce 100644 (file)
@@ -106,12 +106,10 @@ MrIceBlock::collision_solid(const CollisionHit& hit)
       if(hit.right && dir == RIGHT) {
         dir = LEFT;
         sound_manager->play("sounds/iceblock_bump.wav", get_pos());
-        if(++squishcount >= MAXSQUISHES) { kill_fall(); break; }
         physic.set_velocity_x(-KICKSPEED);
       } else if(hit.left && dir == LEFT) {
         dir = RIGHT;
         sound_manager->play("sounds/iceblock_bump.wav", get_pos());
-        if(++squishcount >= MAXSQUISHES) { kill_fall(); break; }
         physic.set_velocity_x(KICKSPEED);
       }
       sprite->set_action(dir == LEFT ? "flat-left" : "flat-right");
@@ -185,11 +183,20 @@ MrIceBlock::collision_squished(GameObject& object)
 {
   switch(ice_state) {
     case ICESTATE_KICKED:
+      {
+        BadGuy* badguy = dynamic_cast<BadGuy*>(&object);
+        if (badguy) {
+          badguy->kill_fall();
+          break;
+        }
+      }
+
+      // fall through
     case ICESTATE_NORMAL:
       {
-       Player* player = dynamic_cast<Player*>(&object);
+        Player* player = dynamic_cast<Player*>(&object);
         squishcount++;
-        if ((squishcount >= MAXSQUISHES) || (player && player->butt_jump)) {
+        if ((squishcount >= MAXSQUISHES) || (player && player->does_buttjump)) {
           kill_fall();
           return true;
         }
@@ -200,12 +207,12 @@ MrIceBlock::collision_squished(GameObject& object)
       break;
     case ICESTATE_FLAT:
       {
-       MovingObject* movingobject = dynamic_cast<MovingObject*>(&object);
-       if (movingobject && (movingobject->get_pos().x < get_pos().x)) {
-         dir = RIGHT;
-       } else {
-         dir = LEFT;
-       }
+        MovingObject* movingobject = dynamic_cast<MovingObject*>(&object);
+        if (movingobject && (movingobject->get_pos().x < get_pos().x)) {
+          dir = RIGHT;
+        } else {
+          dir = LEFT;
+        }
       }
       if (nokick_timer.check()) set_state(ICESTATE_KICKED);
       break;