Restore walk optimization

This commit is contained in:
Eduardo Bart 2013-03-14 00:04:24 -03:00
parent 4bdd1e79fd
commit a71e07f063
1 changed files with 1 additions and 3 deletions

View File

@ -571,11 +571,10 @@ bool Game::walk(Otc::Direction direction)
// check we can walk and add new walk event if false // check we can walk and add new walk event if false
if(!m_localPlayer->canWalk(direction)) { if(!m_localPlayer->canWalk(direction)) {
/*
if(m_lastWalkDir != direction) { if(m_lastWalkDir != direction) {
// must add a new walk event // must add a new walk event
float ticks = m_localPlayer->getStepTicksLeft(); float ticks = m_localPlayer->getStepTicksLeft();
if(ticks < 0) { ticks = 0; } if(ticks <= 0) { ticks = 1; }
if(m_walkEvent) { if(m_walkEvent) {
m_walkEvent->cancel(); m_walkEvent->cancel();
@ -583,7 +582,6 @@ bool Game::walk(Otc::Direction direction)
} }
m_walkEvent = g_dispatcher.scheduleEvent([=] { walk(direction); }, ticks); m_walkEvent = g_dispatcher.scheduleEvent([=] { walk(direction); }, ticks);
} }
*/
return false; return false;
} }