Skip to content

Commit

Permalink
XEEN: Fix crash getting Scarab of Imaging
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Apr 7, 2018
1 parent 4586cee commit 9d94d97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engines/xeen/scripts.cpp
Expand Up @@ -214,7 +214,7 @@ int Scripts::checkEvents() {
MazeObject &selectedObj = map._mobData._objects[intf._objNumber];

if (selectedObj._spriteId == (ccNum ? 15 : 16)) {
for (uint idx = 0; idx < 16; ++idx) {
for (uint idx = 0; idx < MIN((int)map._mobData._objects.size(), 16); ++idx) {
MazeObject &obj = map._mobData._objects[idx];
if (obj._spriteId == (ccNum ? 62 : 57)) {
selectedObj._id = idx;
Expand All @@ -223,7 +223,7 @@ int Scripts::checkEvents() {
}
}
} else if (selectedObj._spriteId == 73) {
for (uint idx = 0; idx < 16; ++idx) {
for (uint idx = 0; idx < MIN((int)map._mobData._objects.size(), 16); ++idx) {
MazeObject &obj = map._mobData._objects[idx];
if (obj._spriteId == 119) {
selectedObj._id = idx;
Expand Down

0 comments on commit 9d94d97

Please sign in to comment.