From 6ed04587d6a7db08ba67ea2025aac993955e30ed Mon Sep 17 00:00:00 2001 From: Ricardo Cruz Date: Tue, 14 Sep 2004 10:39:32 +0000 Subject: [PATCH] Mr. Ice Block can now break power up boxes as well as crafts. SVN-Revision: 1907 --- src/badguy.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/badguy.cpp b/src/badguy.cpp index b8bcb6f0f..65133b3c9 100644 --- a/src/badguy.cpp +++ b/src/badguy.cpp @@ -404,20 +404,27 @@ void BadGuy::check_horizontal_bump(bool checkcliff) { float halfheight = base.height / 2; - if (dir == LEFT && issolid( base.x, (int) base.y + halfheight)) + if (dir == LEFT && issolid( base.x, base.y + halfheight)) { if (kind == BAD_MRICEBLOCK && mode == KICK) + { Sector::current()->trybreakbrick(Vector(base.x, base.y + halfheight), false); + Sector::current()->tryemptybox(Vector(base.x, base.y + halfheight), dir); + } dir = RIGHT; physic.set_velocity(-physic.get_velocity_x(), physic.get_velocity_y()); return; } - if (dir == RIGHT && issolid( base.x + base.width, (int)base.y + halfheight)) + if (dir == RIGHT && issolid( base.x + base.width, base.y + halfheight)) { if (kind == BAD_MRICEBLOCK && mode == KICK) + { Sector::current()->trybreakbrick( - Vector(base.x + base.width, (int) base.y + halfheight), false); + Vector(base.x + base.width, base.y + halfheight), false); + Sector::current()->tryemptybox( + Vector(base.x + base.width, base.y + halfheight), dir); + } dir = LEFT; physic.set_velocity(-physic.get_velocity_x(), physic.get_velocity_y()); -- 2.11.0