From aa0325fac0f16ced4ac710b5126da5bc5c2af441 Mon Sep 17 00:00:00 2001 From: Bertram Date: Tue, 9 Feb 2010 02:07:14 +0100 Subject: Separated fallback defaults for tile width and height. --- src/net/manaserv/beinghandler.cpp | 17 ++++++++++------- src/net/manaserv/playerhandler.cpp | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) (limited to 'src/net') diff --git a/src/net/manaserv/beinghandler.cpp b/src/net/manaserv/beinghandler.cpp index 02f136af..d1fff43d 100644 --- a/src/net/manaserv/beinghandler.cpp +++ b/src/net/manaserv/beinghandler.cpp @@ -102,19 +102,22 @@ Vector BeingHandler::giveSpeedInPixelsPerTicks(float speedInTilesPerSeconds) if (map) { speedInTicks.x = speedInTilesPerSeconds - * (float)map->getTileWidth() - / 1000 * (float)MILLISECONDS_IN_A_TICK; + * (float)map->getTileWidth() + / 1000 * (float)MILLISECONDS_IN_A_TICK; speedInTicks.y = speedInTilesPerSeconds - * (float)map->getTileHeight() - / 1000 * (float)MILLISECONDS_IN_A_TICK; + * (float)map->getTileHeight() + / 1000 * (float)MILLISECONDS_IN_A_TICK; } } if (!game || !map) { - speedInTicks.x = speedInTicks.y = speedInTilesPerSeconds - * (float)DEFAULT_TILE_SIDE_LENGTH - / 1000 * (float)MILLISECONDS_IN_A_TICK; + speedInTicks.x = speedInTilesPerSeconds + * (float)DEFAULT_TILE_WIDTH + / 1000 * (float)MILLISECONDS_IN_A_TICK; + speedInTicks.y = speedInTilesPerSeconds + * (float)DEFAULT_TILE_HEIGHT + / 1000 * (float)MILLISECONDS_IN_A_TICK; } // We don't use z for now. speedInTicks.z = 0; diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp index 007aa93f..042e0284 100644 --- a/src/net/manaserv/playerhandler.cpp +++ b/src/net/manaserv/playerhandler.cpp @@ -54,12 +54,12 @@ extern Window *buySellDialog; extern const int MILLISECONDS_IN_A_TICK; /** @see in map.cpp */ -extern const int DEFAULT_TILE_SIDE_LENGTH; +extern const int DEFAULT_TILE_WIDTH; /* 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 * DEFAULT_TILE_SIDE_LENGTH; +static const int MAP_TELEPORT_SCROLL_DISTANCE = 8 * DEFAULT_TILE_WIDTH; /** * Listener used for handling the overweigth message. -- cgit v1.2.3-60-g2f50