X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy%2Fzeekling.cpp;h=9030ec9b01c50b0f6ea086cb8d8bc9c304f2545c;hb=07ddaed2a657e4d2a3d038fed223fc5827159caf;hp=f6d795d0ad4e310b82ea84c68d436d71655eaa01;hpb=cf4ef679418d46fda1bf14e4a4695b7abb12dd66;p=supertux.git diff --git a/src/badguy/zeekling.cpp b/src/badguy/zeekling.cpp index f6d795d0a..9030ec9b0 100644 --- a/src/badguy/zeekling.cpp +++ b/src/badguy/zeekling.cpp @@ -1,5 +1,5 @@ // $Id$ -// +// // Zeekling - flyer that swoops down when she spots the player // Copyright (C) 2005 Matthias Braun // Copyright (C) 2006 Christoph Sommer @@ -13,7 +13,7 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA @@ -129,7 +129,9 @@ Zeekling::collision_solid(GameObject& , const CollisionHit& hit) */ bool Zeekling::should_we_dive() { - const MovingObject* player = Sector::current()->player; + const MovingObject* player = this->get_nearest_player(); + if (!player) return false; + const MovingObject* badguy = this; const Vector playerPos = player->get_pos();