summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2010-02-09 03:18:35 +0100
committerBertram <bertram@cegetel.net>2010-02-09 03:20:48 +0100
commitb7f93f0b2ec91e04d3ed9035c9e21015b8b57cdd (patch)
tree2d110cf418fab5d733c5172a52aaaffa74c2d693 /src/net
parent6a6b36fa2d19a6ea9d39b975354709e7ad82281d (diff)
downloadmana-client-b7f93f0b2ec91e04d3ed9035c9e21015b8b57cdd.tar.gz
mana-client-b7f93f0b2ec91e04d3ed9035c9e21015b8b57cdd.tar.bz2
mana-client-b7f93f0b2ec91e04d3ed9035c9e21015b8b57cdd.tar.xz
mana-client-b7f93f0b2ec91e04d3ed9035c9e21015b8b57cdd.zip
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.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/manaserv/beinghandler.cpp9
-rw-r--r--src/net/manaserv/playerhandler.cpp10
2 files changed, 8 insertions, 11 deletions
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.