Icecrusher and Haywire: Use the bounding box to find the nearest player.
authorFlorian Forster <supertux@octo.it>
Sun, 28 Feb 2010 10:54:02 +0000 (10:54 +0000)
committerFlorian Forster <supertux@octo.it>
Sun, 28 Feb 2010 10:54:02 +0000 (10:54 +0000)
SVN-Revision: 6450

src/badguy/haywire.cpp
src/object/icecrusher.cpp

index 6dff5cc..f0aaa39 100644 (file)
@@ -131,7 +131,7 @@ Haywire::active_update(float elapsed_time)
   }
 
   if (is_exploding && !turn_around_timer.started()) {
-    Player *p = Sector::current()->get_nearest_player (this->get_pos ());
+    Player *p = Sector::current()->get_nearest_player (this->get_bbox ());
 
     if (p) {
       Direction player_dir = LEFT;
index 199ec51..873428c 100644 (file)
@@ -169,7 +169,7 @@ IceCrusher::update(float elapsed_time)
 bool
 IceCrusher::found_victim()
 {
-  Player* player = Sector::current()->get_nearest_player (this->get_pos ());
+  Player* player = Sector::current()->get_nearest_player (this->get_bbox ());
   if (!player) return false;
 
   const Rectf& player_bbox = player->get_bbox();