summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-01-20 07:37:38 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-01-22 00:35:10 +0100
commit968815437750fd1b76cb78d16799cd25bafa9ef6 (patch)
tree5fd2b57ab95a8b8144764b8b65b70ff98a8cd895 /src
parent3c828c4c7448353858a80d1c60e47d125ed3d3e4 (diff)
downloadmanaserv-968815437750fd1b76cb78d16799cd25bafa9ef6.tar.gz
manaserv-968815437750fd1b76cb78d16799cd25bafa9ef6.tar.bz2
manaserv-968815437750fd1b76cb78d16799cd25bafa9ef6.tar.xz
manaserv-968815437750fd1b76cb78d16799cd25bafa9ef6.zip
Made the being direction be updated only at the end of the movement.
This saves a bit of cpu and make use of pixel points where tile points where used before and could lead to discrepancies. Reviewed-by: Thorbjorn.
Diffstat (limited to 'src')
-rw-r--r--src/game-server/being.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game-server/being.cpp b/src/game-server/being.cpp
index f707198b..c2228dcc 100644
--- a/src/game-server/being.cpp
+++ b/src/game-server/being.cpp
@@ -366,9 +366,6 @@ void Being::move()
getModifiedAttribute(ATTR_MOVE_SPEED_RAW) :
getModifiedAttribute(ATTR_MOVE_SPEED_RAW) * SQRT2;
- // Update the being direction also
- updateDirection(prev, next);
-
if (mPath.empty())
{
// skip last tile center
@@ -384,6 +381,9 @@ void Being::move()
setPosition(pos);
mMoveTime = mMoveTime > WORLD_TICK_MS ? mMoveTime - WORLD_TICK_MS : 0;
+
+ // Update the being direction also
+ updateDirection(mOld, pos);
}
int Being::directionToAngle(int direction)