From: LMH Date: Sat, 29 Nov 2014 21:52:35 +0000 (-1000) Subject: Stone form is heavy enough to break through bricks X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a6c19fc69bee325216222dca98dd8f466cdcf85a;p=supertux.git Stone form is heavy enough to break through bricks --- diff --git a/src/object/brick.cpp b/src/object/brick.cpp index ebee43803..fc48dd537 100644 --- a/src/object/brick.cpp +++ b/src/object/brick.cpp @@ -53,6 +53,7 @@ Brick::collision(GameObject& other, const CollisionHit& hit_){ Player* player = dynamic_cast (&other); if (player) { if (player->does_buttjump) try_break(player); + if (player->is_stone() && player->get_velocity().y >= 280) try_break(player); // stoneform breaks through bricks } BadGuy* badguy = dynamic_cast (&other); @@ -87,7 +88,7 @@ Brick::try_break(Player* player) SoundManager::current()->play("sounds/brick.wav"); Sector* sector = Sector::current(); Player& player_one = *(sector->player); - if(coin_counter > 0) { + if(coin_counter > 0 && !player->is_stone()) { sector->add_object(std::make_shared(get_pos(), true)); coin_counter--; player_one.get_status()->add_coins(1);