From: Wolfgang Becker Date: Wed, 12 Jul 2006 14:51:52 +0000 (+0000) Subject: No more shooting Igel from behind. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=72b0c42e383b0bfbe04cd9a0f9e1566578bf67f2;p=supertux.git No more shooting Igel from behind. SVN-Revision: 3988 --- diff --git a/src/badguy/igel.cpp b/src/badguy/igel.cpp index 0d305e502..6542761be 100644 --- a/src/badguy/igel.cpp +++ b/src/badguy/igel.cpp @@ -128,7 +128,8 @@ Igel::collision_solid(const CollisionHit& hit) // hit left or right switch(state) { case STATE_NORMAL: - turn_around(); + if( hit.left && dir == LEFT || hit.right && dir ==RIGHT ) + turn_around(); break; } } @@ -145,7 +146,8 @@ Igel::collision_badguy(BadGuy& , const CollisionHit& hit) switch(state) { case STATE_NORMAL: - turn_around(); + if( hit.left && dir == LEFT || hit.right && dir ==RIGHT ) + turn_around(); break; } @@ -154,8 +156,11 @@ Igel::collision_badguy(BadGuy& , const CollisionHit& hit) } HitResponse -Igel::collision_bullet(Bullet& , const CollisionHit& hit) +Igel::collision_bullet(Bullet& bullet, const CollisionHit& hit) { + //remove bullet + bullet.remove_me(); + // die if hit on front side if (((dir == LEFT) && hit.left) || ((dir == RIGHT) && hit.right)) { kill_fall();