From 030582af001507e441429fb1f2215fe246198624 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 20 Apr 2018 21:00:15 -0400 Subject: XEEN: Ignore monster moves outside map rather than asserting --- engines/xeen/combat.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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]; -- cgit v1.2.3