master
Eduardo Bart 13 years ago
parent 758b4b5dfb
commit e51c29702c

@ -13,16 +13,20 @@ Effect::Effect() : Thing(THING_EFFECT)
void Effect::draw(int x, int y) void Effect::draw(int x, int y)
{ {
if(!m_finished && g_platform.getTicks() - m_lastTicks > 75) { if(!m_finished) {
if(g_platform.getTicks() - m_lastTicks > 75) {
const ThingAttributes& attributes = getAttributes(); const ThingAttributes& attributes = getAttributes();
m_animation++; m_animation++;
if(m_animation == attributes.animcount) if(m_animation == attributes.animcount) {
g_dispatcher.addEvent(std::bind(&Map::removeThing, &g_map, asThing())); g_dispatcher.addEvent(std::bind(&Map::removeThing, &g_map, asThing()));
m_finished = true;
}
m_lastTicks = g_platform.getTicks(); m_lastTicks = g_platform.getTicks();
} }
internalDraw(x, y, 0, 0, 0, 0, m_animation); internalDraw(x, y, 0, 0, 0, 0, m_animation);
} }
}
const ThingAttributes& Effect::getAttributes() const ThingAttributes& Effect::getAttributes()
{ {

Loading…
Cancel
Save