fix walk bug
This commit is contained in:
parent
3f2071d097
commit
f9bae92bff
|
@ -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);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue