From: Florian Forster Date: Sun, 28 Feb 2010 10:54:02 +0000 (+0000) Subject: Icecrusher and Haywire: Use the bounding box to find the nearest player. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=e850a1093052b6a848a6d0725d0c6fe4762a781e;p=supertux.git Icecrusher and Haywire: Use the bounding box to find the nearest player. SVN-Revision: 6450 --- diff --git a/src/badguy/haywire.cpp b/src/badguy/haywire.cpp index 6dff5ccdf..f0aaa39b4 100644 --- a/src/badguy/haywire.cpp +++ b/src/badguy/haywire.cpp @@ -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; diff --git a/src/object/icecrusher.cpp b/src/object/icecrusher.cpp index 199ec51dc..873428c14 100644 --- a/src/object/icecrusher.cpp +++ b/src/object/icecrusher.cpp @@ -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();