From: Christoph Sommer Date: Thu, 31 Jan 2008 23:20:39 +0000 (+0000) Subject: get_nearest_player won't return dying or dead players X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=15001ce9f1e69c694f9d47eeac94462b62cb4253;p=supertux.git get_nearest_player won't return dying or dead players SVN-Revision: 5305 --- diff --git a/src/badguy/badguy.cpp b/src/badguy/badguy.cpp index 6932362f9..cddb7ac0c 100644 --- a/src/badguy/badguy.cpp +++ b/src/badguy/badguy.cpp @@ -497,6 +497,7 @@ BadGuy::get_nearest_player() std::vector players = Sector::current()->get_players(); for (std::vector::iterator playerIter = players.begin(); playerIter != players.end(); ++playerIter) { Player* player = *playerIter; + if (player->is_dying() || player->is_dead()) continue; return player; }