summaryrefslogtreecommitdiff
path: root/src/net/manaserv/playerhandler.cpp
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2010-02-01 11:49:11 +0100
committerBertram <bertram@cegetel.net>2010-02-01 11:49:11 +0100
commit7e2a54bedefc6b5e2b34c9dafccb8322f46266e7 (patch)
tree8a016c196e36f94ac7454e2300226461e71305c8 /src/net/manaserv/playerhandler.cpp
parent3fe06a98c0af45d7fccce99f39f402485dae71be (diff)
downloadmana-7e2a54bedefc6b5e2b34c9dafccb8322f46266e7.tar.gz
mana-7e2a54bedefc6b5e2b34c9dafccb8322f46266e7.tar.bz2
mana-7e2a54bedefc6b5e2b34c9dafccb8322f46266e7.tar.xz
mana-7e2a54bedefc6b5e2b34c9dafccb8322f46266e7.zip
Reduced CPU consumption by setting speed per ticks value only once.
Diffstat (limited to 'src/net/manaserv/playerhandler.cpp')
-rw-r--r--src/net/manaserv/playerhandler.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/net/manaserv/playerhandler.cpp b/src/net/manaserv/playerhandler.cpp
index 0d7544fd..aac6dc22 100644
--- a/src/net/manaserv/playerhandler.cpp
+++ b/src/net/manaserv/playerhandler.cpp
@@ -49,6 +49,8 @@ extern BuyDialog *buyDialog;
extern SellDialog *sellDialog;
extern Window *buySellDialog;
+extern const int MILLISECONDS_IN_A_TICK;
+
/* Max. distance we are willing to scroll after a teleport;
* everything beyond will reset the port hard.
*/
@@ -425,7 +427,9 @@ int PlayerHandler::getJobLocation()
float PlayerHandler::getDefaultWalkSpeed()
{
- return 6.0f;
+ // Return translation in pixels per ticks.
+ return (6.0f * (float)DEFAULT_TILE_SIDE_LENGTH)
+ / 1000 * (float)MILLISECONDS_IN_A_TICK;
}
} // namespace ManaServ