diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-03-15 18:11:01 +0100 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-03-15 18:11:01 +0100 |
commit | 911444a5b910691816acfccf65151296042fb724 (patch) | |
tree | 67c8942d9980217aea72d5c33d3c853c0eaaeed0 | |
parent | 21e8d502d07c6cae9580a34dde7587d58e6d3a28 (diff) | |
download | mana-911444a5b910691816acfccf65151296042fb724.tar.gz mana-911444a5b910691816acfccf65151296042fb724.tar.bz2 mana-911444a5b910691816acfccf65151296042fb724.tar.xz mana-911444a5b910691816acfccf65151296042fb724.zip |
Simplify the tmwAthena calculation of the pixel/tick speed.
-rw-r--r-- | src/net/tmwa/playerhandler.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index 181ff39c..b05c11d7 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -643,17 +643,9 @@ Vector PlayerHandler::getPixelsPerTickMoveSpeed(Vector speed, Map *map) Vector speedInTicks; - // We don't use z for now. - speedInTicks.z = 0; - - speedInTicks.x = ((1 / speed.x) * 1000) / MILLISECONDS_IN_A_TICK; - speedInTicks.x = speedInTicks.x - * (float)map->getTileWidth() - / 1000 * (float) MILLISECONDS_IN_A_TICK; - speedInTicks.y = ((1 / speed.y) * 1000) / MILLISECONDS_IN_A_TICK; - speedInTicks.y = speedInTicks.y - * (float)map->getTileHeight() - / 1000 * (float) MILLISECONDS_IN_A_TICK; + speedInTicks.z = 0; // We don't use z for now. + speedInTicks.x = 1 / speed.x * (float)map->getTileWidth(); + speedInTicks.y = 1 / speed.y * (float)map->getTileHeight(); return speedInTicks; } |