Fix auto walking bug

This commit is contained in:
BeniS 2013-02-01 12:46:44 +13:00
parent 4c3c945bab
commit e7012031eb
2 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ function online()
cooldownWindow:close() cooldownWindow:close()
end end
if lastPlayer ~= g_game.getCharacterName() then if not lastPlayer or lastPlayer ~= g_game.getCharacterName() then
refresh() refresh()
lastPlayer = g_game.getCharacterName() lastPlayer = g_game.getCharacterName()
end end

View File

@ -627,7 +627,7 @@ void Game::autoWalk(std::vector<Otc::Direction> dirs)
Otc::Direction direction = *it; Otc::Direction direction = *it;
if(m_localPlayer->canWalk(direction)) { if(m_localPlayer->canWalk(direction)) {
TilePtr toTile = g_map.getTile(m_localPlayer->getPosition().translatedToDirection(direction)); TilePtr toTile = g_map.getTile(m_localPlayer->getPosition().translatedToDirection(direction));
if(toTile && toTile->isWalkable() && !m_localPlayer->isAutoWalking()) { if(toTile && toTile->isWalkable() && !m_localPlayer->isServerWalking()) {
m_localPlayer->preWalk(direction); m_localPlayer->preWalk(direction);
if(getFeature(Otc::GameForceFirstAutoWalkStep)) { if(getFeature(Otc::GameForceFirstAutoWalkStep)) {