From: florianf Date: Sat, 27 Feb 2010 11:20:10 +0000 (+0000) Subject: Mr. IceBlock: Call MovingSprite::set_action rather than Sprite::set_action. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=9e7b7eb83bb7c1768dee22e8526f0d71c89c60ad;p=supertux.git Mr. IceBlock: Call MovingSprite::set_action rather than Sprite::set_action. The call to MovingSprite will change the bounding box, too, so the ice block actually ends up lying on the ground (rather than hovering one foot high above the ground when hit). git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6414 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- diff --git a/src/badguy/mriceblock.cpp b/src/badguy/mriceblock.cpp index f4cacb55a..9c9e6bf84 100644 --- a/src/badguy/mriceblock.cpp +++ b/src/badguy/mriceblock.cpp @@ -109,7 +109,7 @@ MrIceBlock::collision_solid(const CollisionHit& hit) sound_manager->play("sounds/iceblock_bump.wav", get_pos()); physic.set_velocity_x(-physic.get_velocity_x()*.975); } - sprite->set_action(dir == LEFT ? "flat-left" : "flat-right"); + this->set_action(dir == LEFT ? "flat-left" : "flat-right", /* loops = */ -1); if(fabsf(physic.get_velocity_x()) < walk_speed*1.5) set_state(ICESTATE_NORMAL); break; @@ -241,14 +241,14 @@ MrIceBlock::set_state(IceState state, bool up) physic.set_velocity_x(0); physic.set_velocity_y(0); } - sprite->set_action(dir == LEFT ? "flat-left" : "flat-right"); + this->set_action(dir == LEFT ? "flat-left" : "flat-right", /* loops = */ -1); flat_timer.start(4); break; case ICESTATE_KICKED: sound_manager->play("sounds/kick.wav", get_pos()); physic.set_velocity_x(dir == LEFT ? -KICKSPEED : KICKSPEED); - sprite->set_action(dir == LEFT ? "flat-left" : "flat-right"); + this->set_action(dir == LEFT ? "flat-left" : "flat-right", /* loops = */ -1); // we should slide above 1 block holes now... bbox.set_size(34, 31.8f); break; @@ -266,7 +266,7 @@ MrIceBlock::grab(MovingObject&, const Vector& pos, Direction dir) { movement = pos - get_pos(); this->dir = dir; - sprite->set_action(dir == LEFT ? "flat-left" : "flat-right"); + this->set_action(dir == LEFT ? "flat-left" : "flat-right", /* loops = */ -1); set_state(ICESTATE_GRABBED); set_colgroup_active(COLGROUP_DISABLED); }