fix crash

This commit is contained in:
Eduardo Bart 2011-08-16 09:58:49 -03:00
parent 758b4b5dfb
commit e51c29702c
1 changed files with 12 additions and 8 deletions

View File

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