summaryrefslogtreecommitdiff
path: root/src/net/playerhandler.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2007-12-31 16:14:27 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2007-12-31 16:14:27 +0000
commit5f04c73af0dbc456fb24047ab11845d751bc5b16 (patch)
treee473b7b7729e36c484b9146e9804bd5623fdcba7 /src/net/playerhandler.cpp
parenteae0c3171fd94970105d4cbd987c8e1218481985 (diff)
downloadmana-client-5f04c73af0dbc456fb24047ab11845d751bc5b16.tar.gz
mana-client-5f04c73af0dbc456fb24047ab11845d751bc5b16.tar.bz2
mana-client-5f04c73af0dbc456fb24047ab11845d751bc5b16.tar.xz
mana-client-5f04c73af0dbc456fb24047ab11845d751bc5b16.zip
Added config options to set the scroll center. Retained scroll offset during map change for smoother map transitions.
Diffstat (limited to 'src/net/playerhandler.cpp')
-rw-r--r--src/net/playerhandler.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp
index a5a2330b..0ea404ed 100644
--- a/src/net/playerhandler.cpp
+++ b/src/net/playerhandler.cpp
@@ -125,11 +125,18 @@ void PlayerHandler::handleMessage(MessageIn *msg)
current_npc = 0;
+ float scrollOffsetX = (x - player_node->mX) * 32;
+ float scrollOffsetY = (y - player_node->mY) * 32;
+
player_node->setAction(Being::STAND);
player_node->stopAttack();
player_node->mFrame = 0;
player_node->mX = x;
player_node->mY = y;
+
+ logger->log("Adjust scrolling by %d:%d", (int)scrollOffsetX, (int)scrollOffsetY);
+
+ engine->scrollBy(scrollOffsetX, scrollOffsetY);
}
break;