From 1092f92ba17f240320fabe93b3c38269daa28f4d Mon Sep 17 00:00:00 2001 From: Ryan Flegel Date: Fri, 14 May 2004 08:10:24 +0000 Subject: [PATCH] - fixed badguy collisions so they no longer get jammed SVN-Revision: 1173 --- src/badguy.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/badguy.cpp b/src/badguy.cpp index 4667d58a4..9fd6ccc8a 100644 --- a/src/badguy.cpp +++ b/src/badguy.cpp @@ -1018,13 +1018,14 @@ BadGuy::collision(void *p_c_object, int c_object, CollisionType type) case CO_BADGUY: pbad_c = (BadGuy*) p_c_object; - /* If we're a kicked mriceblock, kill any badguys we hit */ - if(kind == BAD_MRICEBLOCK && mode == KICK) + /* If we're a kicked mriceblock, kill [almost] any badguys we hit */ + if(kind == BAD_MRICEBLOCK && mode == KICK && + kind != BAD_FLAME && kind != BAD_BOMB && kind != BAD_STALACTITE) { pbad_c->kill_me(25); } - // a held mriceblock gets kills the enemy too but falls to ground then + // a held mriceblock kills the enemy too but falls to ground then else if(kind == BAD_MRICEBLOCK && mode == HELD) { pbad_c->kill_me(25); @@ -1081,8 +1082,6 @@ BadGuy::collision(void *p_c_object, int c_object, CollisionType type) physic.set_velocity(-fabsf(physic.get_velocity_x()), 2); } - - break; } else if (base.y + base.height > pbad_c->base.y + pbad_c->base.height) @@ -1094,6 +1093,9 @@ BadGuy::collision(void *p_c_object, int c_object, CollisionType type) { dir = RIGHT; physic.set_velocity_x(fabsf(physic.get_velocity_x())); + + // in case badguys get "jammed" + base.x = pbad_c->base.x + pbad_c->base.width; } else if (dir == RIGHT) { -- 2.11.0