From: Wolfgang Becker Date: Fri, 14 Mar 2008 17:05:01 +0000 (+0000) Subject: If Tux can't grow the egg turns around instead of pushing Tux. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=def34f2166ea0cbe526a1edfd67636aba3566895;p=supertux.git If Tux can't grow the egg turns around instead of pushing Tux. SVN-Revision: 5371 --- diff --git a/src/object/growup.cpp b/src/object/growup.cpp index db8661541..c85535f26 100644 --- a/src/object/growup.cpp +++ b/src/object/growup.cpp @@ -53,12 +53,15 @@ GrowUp::collision_solid(const CollisionHit& hit) } HitResponse -GrowUp::collision(GameObject& other, const CollisionHit& ) +GrowUp::collision(GameObject& other, const CollisionHit& hit ) { Player* player = dynamic_cast(&other); if(player != 0) { - if(!player->add_bonus(GROWUP_BONUS, true)) - return FORCE_MOVE; + if(!player->add_bonus(GROWUP_BONUS, true)){ + // Tux can't grow right now. + collision_solid( hit ); + return ABORT_MOVE; + } sound_manager->play("sounds/grow.wav"); remove_me();