From: florianf 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=6e9296e3cb69474796c0d4145ad21a9473a6231e;p=supertux.git Icecrusher and Haywire: Use the bounding box to find the nearest player. git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6450 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- 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();