aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/xeen/combat.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index 3aff7ec730..0678fc0d89 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -716,7 +716,10 @@ void Combat::moveMonster(int monsterId, const Common::Point &moveDelta) {
MazeMonster &monster = map._mobData._monsters[monsterId];
Common::Point newPos = monster._position + moveDelta;
- assert((uint)newPos.x < 32 && (uint)newPos.y < 32);
+ // FIXME: Monster moved outside mapping area. Which shouldn't happen, so ignore the move if it does
+ if ((uint)newPos.x >= 32 || (uint)newPos.y >= 32)
+ return;
+
if (_monsterMap[newPos.y][newPos.x] < 3 && monster._damageType == DT_PHYSICAL && _moveMonsters) {
// Adjust monster's position
++_monsterMap[newPos.y][newPos.x];