// $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>
// 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
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;
}
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;
*/
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();