From: LMH Date: Tue, 28 Jan 2014 19:23:46 +0000 (-1000) Subject: Explosions destroy bricks X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=8358b14f848add584735158edc31df2aa974e58c;p=supertux.git Explosions destroy bricks --- diff --git a/src/object/brick.cpp b/src/object/brick.cpp index f37c6092a..8b8590548 100644 --- a/src/object/brick.cpp +++ b/src/object/brick.cpp @@ -18,8 +18,9 @@ #include "audio/sound_manager.hpp" #include "badguy/badguy.hpp" -#include "object/flower.hpp" #include "object/bouncy_coin.hpp" +#include "object/explosion.hpp" +#include "object/flower.hpp" #include "object/player.hpp" #include "object/portable.hpp" #include "sprite/sprite_manager.hpp" @@ -70,6 +71,10 @@ Brick::collision(GameObject& other, const CollisionHit& hit){ try_break(player); } } + Explosion* explosion = dynamic_cast (&other); + if(explosion && explosion->hurts()) { + try_break(player); + } return Block::collision(other, hit); }