diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2007-12-31 16:14:27 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2007-12-31 16:14:27 +0000 |
commit | 5f04c73af0dbc456fb24047ab11845d751bc5b16 (patch) | |
tree | e473b7b7729e36c484b9146e9804bd5623fdcba7 /src/net/playerhandler.cpp | |
parent | eae0c3171fd94970105d4cbd987c8e1218481985 (diff) | |
download | mana-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.cpp | 7 |
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; |