[Scummvm-git-logs] scummvm master -> 9d94d97cc60006eac16808c14efdff85fd17f910

dreammaster dreammaster at scummvm.org
Sat Apr 7 03:43:11 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:
9d94d97cc6 XEEN: Fix crash getting Scarab of Imaging


Commit: 9d94d97cc60006eac16808c14efdff85fd17f910
    https://github.com/scummvm/scummvm/commit/9d94d97cc60006eac16808c14efdff85fd17f910
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-04-06T21:05:40-04:00

Commit Message:
XEEN: Fix crash getting Scarab of Imaging

Changed paths:
    engines/xeen/scripts.cpp


diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp
index 82d5304..92204fc 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -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;
@@ -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;





More information about the Scummvm-git-logs mailing list