From 66beb833b194c272f611bf1b324cd74b598caa2d Mon Sep 17 00:00:00 2001 From: Ricardo Cruz Date: Tue, 19 Oct 2004 17:54:24 +0000 Subject: [PATCH] Bugfix: Jumpy and Flying Snowball faced player even when dead. Bug reported by Marek. SVN-Revision: 2036 --- src/badguy.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/badguy.cpp b/src/badguy.cpp index 70ac1a73e..b8f8f3b79 100644 --- a/src/badguy.cpp +++ b/src/badguy.cpp @@ -520,10 +520,13 @@ BadGuy::action_jumpy(double elapsed_time) } // set direction based on tux - if(tux.base.x > base.x) - dir = RIGHT; - else - dir = LEFT; + if(dying == DYING_NOT) + { + if(tux.base.x > base.x) + dir = RIGHT; + else + dir = LEFT; + } // move physic.apply(elapsed_time, base.x, base.y, Sector::current()->gravity); @@ -742,11 +745,14 @@ BadGuy::action_flyingsnowball(double elapsed_time) if(dying == DYING_NOT || dying == DYING_SQUISHED) collision_swept_object_map(&old_base, &base); - // set direction based on tux - if(Sector::current()->player->base.x > base.x) - dir = RIGHT; - else - dir = LEFT; + if(dying == DYING_NOT) + { + // set direction based on tux + if(Sector::current()->player->base.x > base.x) + dir = RIGHT; + else + dir = LEFT; + } // Handle dying timer: if (dying == DYING_SQUISHED && !timer.check()) -- 2.11.0