From: Ricardo Cruz Date: Tue, 19 Oct 2004 17:54:24 +0000 (+0000) Subject: Bugfix: Jumpy and Flying Snowball faced player even when dead. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=66beb833b194c272f611bf1b324cd74b598caa2d;p=supertux.git Bugfix: Jumpy and Flying Snowball faced player even when dead. Bug reported by Marek. SVN-Revision: 2036 --- 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())