master
Eduardo Bart 13 years ago
parent 758b4b5dfb
commit e51c29702c

@ -13,15 +13,19 @@ 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) {
const ThingAttributes& attributes = getAttributes(); if(g_platform.getTicks() - m_lastTicks > 75) {
m_animation++; const ThingAttributes& attributes = getAttributes();
if(m_animation == attributes.animcount) m_animation++;
g_dispatcher.addEvent(std::bind(&Map::removeThing, &g_map, asThing())); if(m_animation == attributes.animcount) {
m_lastTicks = g_platform.getTicks(); g_dispatcher.addEvent(std::bind(&Map::removeThing, &g_map, asThing()));
} m_finished = true;
}
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