X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy%2Fmriceblock.cpp;h=0b9b9cefbd4ed7e67c44f111c939118c5bab50f7;hb=198f758764fff064a47630b5d0f1e3d6aabe95a8;hp=7ab283788f3fd7953f160ec3ce7e1f32e4ac6a3a;hpb=09d567218a9f0071b26cead6e46e5d332c9f1340;p=supertux.git diff --git a/src/badguy/mriceblock.cpp b/src/badguy/mriceblock.cpp index 7ab283788..0b9b9cefb 100644 --- a/src/badguy/mriceblock.cpp +++ b/src/badguy/mriceblock.cpp @@ -183,9 +183,18 @@ MrIceBlock::collision_squished(GameObject& object) { switch(ice_state) { case ICESTATE_KICKED: + { + BadGuy* badguy = dynamic_cast(&object); + if (badguy) { + badguy->kill_fall(); + break; + } + } + + // fall through case ICESTATE_NORMAL: { - Player* player = dynamic_cast(&object); + Player* player = dynamic_cast(&object); squishcount++; if ((squishcount >= MAXSQUISHES) || (player && player->does_buttjump)) { kill_fall(); @@ -198,12 +207,12 @@ MrIceBlock::collision_squished(GameObject& object) break; case ICESTATE_FLAT: { - MovingObject* movingobject = dynamic_cast(&object); - if (movingobject && (movingobject->get_pos().x < get_pos().x)) { - dir = RIGHT; - } else { - dir = LEFT; - } + MovingObject* movingobject = dynamic_cast(&object); + if (movingobject && (movingobject->get_pos().x < get_pos().x)) { + dir = RIGHT; + } else { + dir = LEFT; + } } if (nokick_timer.check()) set_state(ICESTATE_KICKED); break;