Fix a bug with autowalking & add prompt param for tryLogout.

(We don't want to be prompted when pressing Ctrl + Q or  Ctrl + L).
This commit is contained in:
BeniS
2013-07-07 05:36:56 +12:00
parent c4adf2d817
commit 95abf2a1d2
2 changed files with 33 additions and 26 deletions

View File

@@ -72,7 +72,7 @@ bool LocalPlayer::canWalk(Otc::Direction direction)
return false;
// last walk is not done yet
if(m_walkTimer.ticksElapsed() < getStepDuration())
if((m_walkTimer.ticksElapsed() < getStepDuration()) && !isAutoWalking())
return false;
// prewalk has a timeout, because for some reason that I don't know yet the server sometimes doesn't answer the prewalk
@@ -83,7 +83,7 @@ bool LocalPlayer::canWalk(Otc::Direction direction)
return false;
// cannot walk while already walking
if(m_walking && (!prewalkTimeouted || m_secondPreWalk))
if((m_walking && !isAutoWalking()) && (!prewalkTimeouted || m_secondPreWalk))
return false;
return true;