From f63ee2ccb86707d21295bde5ed3e0474cc9a6844 Mon Sep 17 00:00:00 2001 From: florianf Date: Sat, 27 Feb 2010 19:29:21 +0000 Subject: [PATCH] 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. git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6426 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- src/badguy/crystallo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.11.0