walk animation improv

This commit is contained in:
Eduardo Bart 2011-11-05 19:43:13 -02:00
parent d2c3e554dc
commit 4208e40c76
1 changed files with 7 additions and 3 deletions

View File

@ -227,8 +227,7 @@ void Creature::walk(const Position& position, bool inverse)
m_walkTimePerPixel = walkTime / 32.0;
if(!sameWalk)
m_walkStartTicks = g_platform.getTicks();
g_dispatcher.scheduleEvent(std::bind(&Creature::updateWalk, asCreature()), m_walkTimePerPixel);
updateWalk();
}
}
@ -280,8 +279,13 @@ void Creature::cancelWalk(Otc::Direction direction)
m_walkStartTicks = 0;
m_walkOffsetX = 0;
m_walkOffsetY = 0;
m_animation = 0;
m_direction = direction;
auto self = asCreature();
g_dispatcher.scheduleEvent([=]() {
if(!self->m_walking)
self->m_animation = 0;
}, 150);
}
void Creature::setHealthPercent(uint8 healthPercent)