get_nearest_player won't return dying or dead players
authorChristoph Sommer <mail@christoph-sommer.de>
Thu, 31 Jan 2008 23:20:39 +0000 (23:20 +0000)
committerChristoph Sommer <mail@christoph-sommer.de>
Thu, 31 Jan 2008 23:20:39 +0000 (23:20 +0000)
SVN-Revision: 5305

src/badguy/badguy.cpp

index 6932362..cddb7ac 100644 (file)
@@ -497,6 +497,7 @@ BadGuy::get_nearest_player()
   std::vector<Player*> players = Sector::current()->get_players();
   for (std::vector<Player*>::iterator playerIter = players.begin(); playerIter != players.end(); ++playerIter) {
     Player* player = *playerIter;
+    if (player->is_dying() || player->is_dead()) continue;
     return player;
   }