From: Florian Forster Date: Sat, 27 Feb 2010 19:29:21 +0000 (+0000) Subject: supertux/src/badguy/crystallo.cpp: Use MovingSprite::set_action to change the sprite. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6eda68ffb78ad3e86b51f9952a5ef9e072191030;p=supertux.git supertux/src/badguy/crystallo.cpp: Use MovingSprite::set_action to change the sprite. This will account for a change in the hitbox when chaning the sprite. As a result, the dead Crystallo no longer appears to be a few pixels within the tile he was standing on. SVN-Revision: 6426 --- diff --git a/src/badguy/crystallo.cpp b/src/badguy/crystallo.cpp index 443478fa9..b3ae9d45b 100644 --- a/src/badguy/crystallo.cpp +++ b/src/badguy/crystallo.cpp @@ -19,6 +19,7 @@ #include "sprite/sprite.hpp" #include "supertux/object_factory.hpp" #include "util/reader.hpp" +#include "object/anchor_point.hpp" Crystallo::Crystallo(const Reader& reader) : WalkingBadguy(reader, "images/creatures/crystallo/crystallo.sprite", "left", "right"), @@ -58,7 +59,7 @@ Crystallo::active_update(float elapsed_time) bool Crystallo::collision_squished(GameObject& object) { - sprite->set_action(dir == LEFT ? "shattered-left" : "shattered-right"); + this->set_action(dir == LEFT ? "shattered-left" : "shattered-right", /* loops = */ -1, ANCHOR_BOTTOM); kill_squished(object); return true; }