summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2009-10-15 01:38:18 +0200
committerBertram <bertram@cegetel.net>2009-10-15 01:38:18 +0200
commit2f55dd130c886376a45c9d0054dbd987cc055155 (patch)
treea0a1f25a6310b9e29ab10c442ba10cb2a1a1145e /src/net
parentb4befc985875588a4b454b112b8b79a94c26e5e6 (diff)
downloadmana-client-2f55dd130c886376a45c9d0054dbd987cc055155.tar.gz
mana-client-2f55dd130c886376a45c9d0054dbd987cc055155.tar.bz2
mana-client-2f55dd130c886376a45c9d0054dbd987cc055155.tar.xz
mana-client-2f55dd130c886376a45c9d0054dbd987cc055155.zip
Speed code unification part 3: Made the client handle the speed in tiles per second in TMWserv.
While I was on it, I tweaked the default speed value to its final 6 tiles per second value, which seems to be nice to me. Another notice, the server does already send speed value to the player. The keyboard movement protocol is one step ahead Release Candidate, enjoy ;)
Diffstat (limited to 'src/net')
-rw-r--r--src/net/tmwserv/beinghandler.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/net/tmwserv/beinghandler.cpp b/src/net/tmwserv/beinghandler.cpp
index d5092782..2cf9274a 100644
--- a/src/net/tmwserv/beinghandler.cpp
+++ b/src/net/tmwserv/beinghandler.cpp
@@ -203,13 +203,10 @@ void BeingHandler::handleBeingsMoveMessage(MessageIn &msg)
}
if (speed)
{
- /* The speed on the server is the cost of moving from one tile to
- * the next. Beings get 1000 cost units per second. The speed is
- * transferred as devided by 10, so that slower speeds fit in a
- * byte. Here we convert the speed to pixels per second.
- */
- const float tilesPerSecond = 100.0f / speed;
- being->setWalkSpeed((int) (tilesPerSecond * 32));
+ // The being's speed is transfered in tiles per second * 10
+ // to keep it transferable in a Byte.
+ // We set it back to tiles per second and in a float.
+ being->setWalkSpeed((float) speed / 10);
}
// Ignore messages from the server for the local player