summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-07-24 14:49:24 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-07-24 14:49:24 +0000
commit59fa52906b1ac1f53e895f28e035d985cbee24a9 (patch)
tree9d5a1b4703cbb998aaea2ffeef066e05e596a5a4
parent362a5f5db4a1c4792ddc4feca5e581edff439c34 (diff)
downloadmana-59fa52906b1ac1f53e895f28e035d985cbee24a9.tar.gz
mana-59fa52906b1ac1f53e895f28e035d985cbee24a9.tar.bz2
mana-59fa52906b1ac1f53e895f28e035d985cbee24a9.tar.xz
mana-59fa52906b1ac1f53e895f28e035d985cbee24a9.zip
Fixed setDirection() semantics.
Removed a printf-leftover.
-rw-r--r--ChangeLog10
-rw-r--r--src/being.cpp14
-rw-r--r--src/localplayer.cpp4
3 files changed, 16 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 920e290b..7d420885 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
-2006-07-24 Frode Lindeijer <f.lindeijer@gmail.com>
+2006-07-24 Björn Steinbrink <B.Steinbrink@gmx.de>
- * /tmw/trunk/data/graphics/sprites/npcs.png: Added the organdealer to the NPCs
+ * src/localplayer.cpp, src/being.cpp: Fixed setDirection() semantics.
+ Removed a printf-leftover.
+
+2006-07-24 Frode Lindeijer <f.lindeijer@gmail.com>
+
+ * data/graphics/sprites/npcs.png: Added the organdealer to
+ the NPCs
2006-07-24 Eugenio Favalli <elvenprogrammer@gmail.com>
diff --git a/src/being.cpp b/src/being.cpp
index 69057c09..8a55f2e2 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -230,7 +230,7 @@ Being::setAction(Action action)
void
Being::setDirection(Uint8 direction)
{
- mDirection |= direction;
+ mDirection = direction;
std::string dir;
if (direction & UP)
@@ -268,15 +268,17 @@ Being::nextStep()
PATH_NODE node = mPath.front();
mPath.pop_front();
- mDirection = 0;
+ int dir = 0;
if (node.x > mX)
- setDirection(RIGHT);
+ dir |= RIGHT;
else if (node.x < mX)
- setDirection(LEFT);
+ dir |= LEFT;
if (node.y > mY)
- setDirection(DOWN);
+ dir |= DOWN;
else if (node.y < mY)
- setDirection(UP);
+ dir |= UP;
+
+ setDirection(dir);
mX = node.x;
mY = node.y;
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 8b601326..802da92f 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -212,7 +212,6 @@ void LocalPlayer::walk(unsigned char dir)
// Warning: Not communicated to the server yet
// If the being can't move, just change direction
- mDirection = dir;
setDirection(dir);
}
}
@@ -347,10 +346,7 @@ void LocalPlayer::attack(Being *target, bool keep)
if (abs(dist_y) >= abs(dist_x))
{
if (dist_y > 0)
- {
setDirection(DOWN);
- printf("DOWN\n");
- }
else
setDirection(UP);
}