[Scummvm-git-logs] scummvm master -> 030582af001507e441429fb1f2215fe246198624
dreammaster
dreammaster at scummvm.org
Sat Apr 21 03:27:53 CEST 2018
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
030582af00 XEEN: Ignore monster moves outside map rather than asserting
Commit: 030582af001507e441429fb1f2215fe246198624
https://github.com/scummvm/scummvm/commit/030582af001507e441429fb1f2215fe246198624
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-04-20T21:00:15-04:00
Commit Message:
XEEN: Ignore monster moves outside map rather than asserting
Changed paths:
engines/xeen/combat.cpp
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index 3aff7ec..0678fc0 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];
More information about the Scummvm-git-logs
mailing list