From b7f93f0b2ec91e04d3ed9035c9e21015b8b57cdd Mon Sep 17 00:00:00 2001 From: Bertram Date: Tue, 9 Feb 2010 03:18:35 +0100 Subject: Got successfully rid of tile width/height fallback values as asked by Jaxad. But I added some logs when speed and other actions where refused due to game/map uninitialized. This could help. --- src/net/manaserv/beinghandler.cpp | 9 +++------ src/net/manaserv/playerhandler.cpp | 10 +++++----- 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'src/net') diff --git a/src/net/manaserv/beinghandler.cpp b/src/net/manaserv/beinghandler.cpp index d1fff43d..99b01090 100644 --- a/src/net/manaserv/beinghandler.cpp +++ b/src/net/manaserv/beinghandler.cpp @@ -112,12 +112,9 @@ Vector BeingHandler::giveSpeedInPixelsPerTicks(float speedInTilesPerSeconds) if (!game || !map) { - 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; + speedInTicks.x = speedInTicks.y = 0; + logger->log("Manaserv::BeingHandler: Speed wasn't given back" + " because game/Map not initialized."); } // 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 042e0284..23158cc5 100644 --- a/src/net/manaserv/playerhandler.cpp +++ b/src/net/manaserv/playerhandler.cpp @@ -53,13 +53,13 @@ extern Window *buySellDialog; /** @see in game.cpp */ extern const int MILLISECONDS_IN_A_TICK; -/** @see in map.cpp */ -extern const int DEFAULT_TILE_WIDTH; - -/* Max. distance we are willing to scroll after a teleport; +/** + * Max. distance 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 * DEFAULT_TILE_WIDTH; +static const int MAP_TELEPORT_SCROLL_DISTANCE = 8 * 32; /** * Listener used for handling the overweigth message. -- cgit v1.2.3-60-g2f50