gave the yeti some more knobs to adjust
[supertux.git] / src / badguy / zeekling.cpp
index 65ae3e9..9030ec9 100644 (file)
@@ -1,5 +1,5 @@
 //  $Id$
-// 
+//
 //  Zeekling - flyer that swoops down when she spots the player
 //  Copyright (C) 2005 Matthias Braun <matze@braunis.de>
 //  Copyright (C) 2006 Christoph Sommer <supertux@2006.expires.deltadevelopment.de>
@@ -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
@@ -29,7 +29,7 @@ Zeekling::Zeekling(const lisp::Lisp& reader)
   reader.get("x", start_position.x);
   reader.get("y", start_position.y);
   bbox.set_size(31.8, 31.8);
-  sprite = sprite_manager->create("zeekling");
+  sprite = sprite_manager->create("images/creatures/zeekling/zeekling.sprite");
   set_direction = false;
   state = FLYING;
 }
@@ -39,7 +39,7 @@ Zeekling::Zeekling(float pos_x, float pos_y, Direction d)
   start_position.x = pos_x;
   start_position.y = pos_y;
   bbox.set_size(63.8, 50.8);
-  sprite = sprite_manager->create("zeekling");
+  sprite = sprite_manager->create("images/creatures/zeekling/zeekling.sprite");
   set_direction = true;
   initial_direction = d;
   state = FLYING;
@@ -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();