X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy%2Fzeekling.cpp;h=9030ec9b01c50b0f6ea086cb8d8bc9c304f2545c;hb=07ddaed2a657e4d2a3d038fed223fc5827159caf;hp=65ae3e91a65f9b3d41e5fa8887065ee8ba5157ef;hpb=f8a4dbe2c664797922d2aa4eaac411bc8746921b;p=supertux.git diff --git a/src/badguy/zeekling.cpp b/src/badguy/zeekling.cpp index 65ae3e91a..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 @@ -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();