[Super-tux-commit] supertux/src player.cpp,1.175,1.176
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-09-20 19:30:45
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15915/src Modified Files: player.cpp Log Message: Bugfix: Don't kill badguys when they are already dying or in a certain mode (bombs exploding or ticking). Reported by Frank van der Loo. Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.175 retrieving revision 1.176 diff -u -d -r1.175 -r1.176 --- player.cpp 18 Sep 2004 16:58:16 -0000 1.175 +++ player.cpp 20 Sep 2004 19:30:30 -0000 1.176 @@ -21,7 +21,6 @@ #include <iostream> #include <cassert> -#include "gameloop.h" #include "app/globals.h" #include "player.h" #include "defines.h" @@ -36,6 +35,7 @@ #include "interactive_object.h" #include "video/screen.h" #include "statistics.h" +#include "gameloop.h" // behavior definitions: #define TILES_FOR_BUTTJUMP 3 @@ -628,12 +628,16 @@ BadGuy* badguy = dynamic_cast<BadGuy*> (*i); if(badguy) { - - if (fabsf(base.x - badguy->base.x) < 150 && - fabsf(base.y - badguy->base.y) < 60 && - (issolid(badguy->base.x + 1, badguy->base.y + badguy->base.height) || - issolid(badguy->base.x + badguy->base.width - 1, badguy->base.y + badguy->base.height))) - badguy->kill_me(25); + // don't kill when badguys are already dying or in a certain mode + if(badguy->dying == DYING_NOT && badguy->mode != BadGuy::BOMB_TICKING && + badguy->mode != BadGuy::BOMB_EXPLODE) + { + if (fabsf(base.x - badguy->base.x) < 150 && + fabsf(base.y - badguy->base.y) < 60 && + (issolid(badguy->base.x + 1, badguy->base.y + badguy->base.height) || + issolid(badguy->base.x + badguy->base.width - 1, badguy->base.y + badguy->base.height))) + badguy->kill_me(25); + } } } } |