diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-06-22 18:58:47 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-06-22 18:58:47 +0200 |
commit | 852ff45c35c422b5264487669934b392a8657465 (patch) | |
tree | 380751fae34a7dcd7b31bd84e303b9086eb17485 /src/net | |
parent | 2a11c6c5d874d661dcb7f016183c3c3e64e65f3c (diff) | |
parent | ec3c689c64922baf4a9f99bc6e9345e0a80403e8 (diff) | |
download | mana-852ff45c35c422b5264487669934b392a8657465.tar.gz mana-852ff45c35c422b5264487669934b392a8657465.tar.bz2 mana-852ff45c35c422b5264487669934b392a8657465.tar.xz mana-852ff45c35c422b5264487669934b392a8657465.zip |
Merge branch 'master' of gitorious.org:~bertram/mana/mana-any-square-tile-size
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/manaserv/playerhandler.cpp | 5 | ||||
-rw-r--r-- | src/net/tmwa/charserverhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/gamehandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 2 |
4 files changed, 7 insertions, 8 deletions
diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp index 4249bac8..a114da3d 100644 --- a/src/net/manaserv/playerhandler.cpp +++ b/src/net/manaserv/playerhandler.cpp @@ -46,12 +46,11 @@ #include "net/manaserv/attributes.h" /** - * Max. distance we are willing to scroll after a teleport; + * Max. distance in tiles we are willing to scroll after a teleport; * everything beyond will reset the port hard. - * 32 is the nominal tile width/height. * @todo: Make this parameter read from config. */ -static const int MAP_TELEPORT_SCROLL_DISTANCE = 8 * 32; +const int MAP_TELEPORT_SCROLL_DISTANCE = 256; extern Net::PlayerHandler *playerHandler; diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index dcc68fb3..1df84b84 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -186,8 +186,8 @@ void CharServerHandler::handleMessage(Net::MessageIn &msg) mNetwork->disconnect(); Client::setState(STATE_CHANGE_MAP); Map *map = player_node->getMap(); - int tileWidth = map->getTileWidth(); - int tileHeight = map->getTileHeight(); + const int tileWidth = map->getTileWidth(); + const int tileHeight = map->getTileHeight(); player_node->setPosition(Vector(x * tileWidth + tileWidth / 2, y * tileHeight + tileHeight / 2)); player_node->setMap(0); diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp index 8ba2e200..6430b476 100644 --- a/src/net/tmwa/gamehandler.cpp +++ b/src/net/tmwa/gamehandler.cpp @@ -109,8 +109,8 @@ void GameHandler::event(Event::Channel channel, const Event &event) Game *game = Game::instance(); game->changeMap(mMap); Map *map = game->getCurrentMap(); - int tileWidth = map->getTileWidth(); - int tileHeight = map->getTileHeight(); + const int tileWidth = map->getTileWidth(); + const int tileHeight = map->getTileHeight(); if (mTileX && mTileY) { player_node->setPosition(Vector(mTileX * tileWidth + tileWidth / 2, diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index ab63cc1d..f30baecd 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -50,7 +50,7 @@ extern OkDialog *deathNotice; // Max. distance we are willing to scroll after a teleport; // everything beyond will reset the port hard. -static const int MAP_TELEPORT_SCROLL_DISTANCE = 8; +const int MAP_TELEPORT_SCROLL_DISTANCE = 8; // TODO Move somewhere else namespace { |