[Scummvm-git-logs] scummvm master -> 73d72f4fc84d3c047415f0de2d2f2f0fb5cb7879
dreammaster
dreammaster at scummvm.org
Wed Apr 4 04:58:20 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:
73d72f4fc8 XEEN: Fix cmdIfMapFlag crash when banging Winterkill gong
Commit: 73d72f4fc84d3c047415f0de2d2f2f0fb5cb7879
https://github.com/scummvm/scummvm/commit/73d72f4fc84d3c047415f0de2d2f2f0fb5cb7879
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-04-03T22:58:17-04:00
Commit Message:
XEEN: Fix cmdIfMapFlag crash when banging Winterkill gong
Changed paths:
engines/xeen/scripts.cpp
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp
index 6230d1c..cd95a59 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -1207,14 +1207,25 @@ bool Scripts::cmdDisplayBottom(ParamsIterator ¶ms) {
bool Scripts::cmdIfMapFlag(ParamsIterator ¶ms) {
Map &map = *_vm->_map;
- MazeMonster &monster = map._mobData._monsters[params.readByte()];
+ int monsterNum = params.readByte();
+ int lineNum = params.readByte();
- if (monster._position.x >= 32 || monster._position.y >= 32) {
- _lineNum = params.readByte();
- return false;
+ if (monsterNum == 0xff) {
+ for (monsterNum = 0; monsterNum < (int)map._mobData._monsters.size(); ++monsterNum) {
+ MazeMonster &monster = map._mobData._monsters[monsterNum];
+
+ if ((uint)monster._position.x < 32 && (uint)monster._position.y < 32)
+ return true;
+ }
+ } else {
+ MazeMonster &monster = map._mobData._monsters[monsterNum];
+
+ if ((uint)monster._position.x < 32 && (uint)monster._position.y > 32)
+ return true;
}
- return true;
+ _lineNum = lineNum;
+ return false;
}
bool Scripts::cmdSelectRandomChar(ParamsIterator ¶ms) {
More information about the Scummvm-git-logs
mailing list