summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--src/object.cpp10
2 files changed, 9 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index fc99d77c..7fea8e31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-08-27 Guillaume Melquiond <guillaume.melquiond@gmail.com>
+
+ * src/object.cpp: Fixed assertion failure on being movements.
+
2006-08-26 Rogier Polak <rogier_polak@users.sourceforge.net>
* src/netcomputer.h, src/netcomputer.cpp, src/connectionhandler.cpp:
diff --git a/src/object.cpp b/src/object.cpp
index f6863cd4..b20fa7dc 100644
--- a/src/object.cpp
+++ b/src/object.cpp
@@ -59,19 +59,19 @@ void MovingObject::move()
mNewY = mDstY = mSrcY;
return;
}
+ path.pop_back();
}
int tileCX = tileSX, tileCY = tileSY, fracCX = fracSX, fracCY = fracSY;
- int tileNX = tileDX, tileNY = tileDY, left = mSpeed;
+ int left = mSpeed;
int vecX = 0, vecY = 0, cost = 0;
for (std::list<PATH_NODE>::const_iterator it = path.begin(),
it_end = path.end(); it != it_end; ++it) {
- tileNX = it->x;
- tileNY = it->y;
- assert(tileNX != tileCX && tileNY != tileCY &&
- tileNX != tileDX && tileNY != tileDY);
+ int tileNX = it->x, tileNY = it->y;
+ assert((tileNX != tileCX || tileNY != tileCY) &&
+ (tileNX != tileDX || tileNY != tileDY));
if (fracCX != 0 || fracCY != 0) {
// not at the tile center, move toward the next tile center