summaryrefslogtreecommitdiff
path: root/src/net/manaserv/playerhandler.cpp
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2010-02-03 22:38:07 +0100
committerBertram <bertram@cegetel.net>2010-02-03 22:55:28 +0100
commite5ec83786f01d91da97f75f68ccc707c37780db4 (patch)
tree03987f52016ad7bc17f096d5a37cc958fc038963 /src/net/manaserv/playerhandler.cpp
parent20d2a17c8c0fa9220c257d61641a6459e154de26 (diff)
downloadmana-e5ec83786f01d91da97f75f68ccc707c37780db4.tar.gz
mana-e5ec83786f01d91da97f75f68ccc707c37780db4.tar.bz2
mana-e5ec83786f01d91da97f75f68ccc707c37780db4.tar.xz
mana-e5ec83786f01d91da97f75f68ccc707c37780db4.zip
Factorized speed translation from tile per seconds to pixels per ticks.
Diffstat (limited to 'src/net/manaserv/playerhandler.cpp')
-rw-r--r--src/net/manaserv/playerhandler.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp
index aac6dc22..9225b765 100644
--- a/src/net/manaserv/playerhandler.cpp
+++ b/src/net/manaserv/playerhandler.cpp
@@ -20,6 +20,7 @@
*/
#include "net/manaserv/playerhandler.h"
+#include "net/manaserv/beinghandler.h"
#include "effectmanager.h"
#include "engine.h"
@@ -49,12 +50,16 @@ extern BuyDialog *buyDialog;
extern SellDialog *sellDialog;
extern Window *buySellDialog;
+/** @see in game.cpp */
extern const int MILLISECONDS_IN_A_TICK;
+/** @see in map.cpp */
+extern const int DEFAULT_TILE_SIDE_LENGTH;
+
/* 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 * 32;
+static const int MAP_TELEPORT_SCROLL_DISTANCE = 8 * DEFAULT_TILE_SIDE_LENGTH;
/**
* Listener used for handling the overweigth message.
@@ -428,8 +433,7 @@ int PlayerHandler::getJobLocation()
float PlayerHandler::getDefaultWalkSpeed()
{
// Return translation in pixels per ticks.
- return (6.0f * (float)DEFAULT_TILE_SIDE_LENGTH)
- / 1000 * (float)MILLISECONDS_IN_A_TICK;
+ return ManaServ::BeingHandler::giveSpeedInPixelsPerTicks(6.0f);
}
} // namespace ManaServ