fix walk bug

This commit is contained in:
Eduardo Bart 2012-05-10 13:55:33 -03:00
parent 3f2071d097
commit f9bae92bff
1 changed files with 10 additions and 1 deletions

View File

@ -307,7 +307,16 @@ void Map::setCentralPosition(const Position& centralPosition)
TilePtr tile = localPlayer->getTile(); TilePtr tile = localPlayer->getTile();
if(tile && tile->hasThing(localPlayer)) if(tile && tile->hasThing(localPlayer))
return; return;
localPlayer->setPosition(m_centralPosition);
Position oldPos = localPlayer->getPosition();
Position pos = m_centralPosition;
localPlayer->setPosition(pos);
if(oldPos != pos) {
if(oldPos.isInRange(pos,1,1))
g_game.processCreatureMove(localPlayer, oldPos, pos);
else
g_game.processCreatureTeleport(localPlayer);
}
}); });
} }