summaryrefslogtreecommitdiff
path: root/src/net/ea/playerhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/ea/playerhandler.cpp')
-rw-r--r--src/net/ea/playerhandler.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp
index f6f54d59..33a6b146 100644
--- a/src/net/ea/playerhandler.cpp
+++ b/src/net/ea/playerhandler.cpp
@@ -192,8 +192,8 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg)
Game *game = Game::instance();
- const std::string &currentMap = game->getCurrentMapName();
- bool sameMap = (currentMap == mapPath);
+ const std::string &currentMapName = game->getCurrentMapName();
+ bool sameMap = (currentMapName == mapPath);
// Switch the actual map, deleting the previous one if necessary
mapPath = mapPath.substr(0, mapPath.rfind("."));
@@ -207,8 +207,11 @@ void PlayerHandler::handleMessage(Net::MessageIn &msg)
|| (abs(x - player_node->getTileX()) > MAP_TELEPORT_SCROLL_DISTANCE)
|| (abs(y - player_node->getTileY()) > MAP_TELEPORT_SCROLL_DISTANCE))
{
- scrollOffsetX = (x - player_node->getTileX()) * 32;
- scrollOffsetY = (y - player_node->getTileY()) * 32;
+ Map *map = game->getCurrentMap();
+ scrollOffsetX = (x - player_node->getTileX())
+ * map->getTileWidth();
+ scrollOffsetY = (y - player_node->getTileY())
+ * map->getTileHeight();
}
player_node->setAction(Being::STAND);