[Scummvm-cvs-logs] CVS: scummvm/scumm script.cpp,1.162,1.163

Max Horn fingolfin at users.sourceforge.net
Sat Jul 31 16:35:01 CEST 2004


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13397

Modified Files:
	script.cpp 
Log Message:
Fix for bug #941275 (FOA: Game crashes when clicking statue part (Sentry Statue))

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -d -r1.162 -r1.163
--- script.cpp	24 Jul 2004 07:18:18 -0000	1.162
+++ script.cpp	31 Jul 2004 23:34:07 -0000	1.163
@@ -843,10 +843,23 @@
 	/* Nuke local object names */
 	if (_newNames) {
 		for (i = 0; i < _numNewNames; i++) {
-			int j = _newNames[i];
-			if (j && getOwner(j) == 0) {
-				_newNames[i] = 0;
-				nukeResource(rtObjectName, i);
+			const int obj = _newNames[i];
+			if (obj) {
+				const int owner = getOwner(obj);
+				// We can delete custom name resources if either the object is
+				// no longer in use (i.e. not owned by anyone anymore); or if
+				// it is an object which is owned by a room.
+				if (owner == 0 || owner == OF_OWNER_ROOM) {
+					// WORKAROUND for a problem mentioned in bug report #941275:
+					// In FOA in the sentry room, in the chest plate of the statue,
+					// the pegs may be renamed to mouth: this custom name is lost
+					// when leaving the room; this hack prevents this).
+					if (owner == OF_OWNER_ROOM && _gameId == GID_INDY4 && 336 <= obj && obj <= 340)
+						continue;
+
+					_newNames[i] = 0;
+					nukeResource(rtObjectName, i);
+				}
 			}
 		}
 	}





More information about the Scummvm-git-logs mailing list