summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-27 08:57:25 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-27 08:57:25 +0000
commit76b768222f5f9e9ccea25ebea6acf5140e948fa9 (patch)
tree9cf28394835d1526d9a271bfb30f6f7fd6170adc
parentc8104aa3b53448a047a0ee01835a6f68ac62f23c (diff)
downloadmanaserv-76b768222f5f9e9ccea25ebea6acf5140e948fa9.tar.gz
manaserv-76b768222f5f9e9ccea25ebea6acf5140e948fa9.tar.bz2
manaserv-76b768222f5f9e9ccea25ebea6acf5140e948fa9.tar.xz
manaserv-76b768222f5f9e9ccea25ebea6acf5140e948fa9.zip
Fixed assertion failure on being movements.
-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