From f75c8fac584e1647745c0b5bf1fe8e50fc3209d5 Mon Sep 17 00:00:00 2001
From: Stefan Dombrowski <stefan@uni-bonn.de>
Date: Tue, 5 Oct 2010 18:30:14 +0200
Subject: Send the server changed player direction if it changes during attack

Reviewed-by: Jaxad0127
---
 src/localplayer.cpp | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 9c64c6dc..b4418bbc 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -1007,20 +1007,23 @@ void LocalPlayer::attack(Being *target, bool keep)
         if (mAction != STAND)
             return;
 
+        Uint8 direction = 0;
         if (abs(dist_y) >= abs(dist_x))
         {
             if (dist_y > 0)
-                setDirection(DOWN);
+                direction = DOWN;
             else
-                setDirection(UP);
+                direction = UP;
         }
         else
         {
             if (dist_x > 0)
-                setDirection(RIGHT);
+                direction = RIGHT;
             else
-                setDirection(LEFT);
+                direction = LEFT;
         }
+        Net::getPlayerHandler()->setDirection(direction);
+        setDirection(direction);
 
         mWalkTime = tick_time;
         mTargetTime = tick_time;
-- 
cgit v1.2.3-70-g09d2