[Scummvm-cvs-logs] CVS: scummvm/scumm script_v5.cpp,1.70,1.71

Max Horn fingolfin at users.sourceforge.net
Wed May 7 16:10:02 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv7825/scumm

Modified Files:
	script_v5.cpp 
Log Message:
fixed bug #734057

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- script_v5.cpp	7 May 2003 22:56:06 -0000	1.70
+++ script_v5.cpp	7 May 2003 23:09:04 -0000	1.71
@@ -1526,16 +1526,21 @@
 	_opcode = fetchScriptByte();
 	if (_opcode != 17)
 		resid = getVarOrDirectByte(0x80);
-	if (_gameId == GID_ZAK256)
-		_opcode &= 0x3F;
-	else
-		_opcode &= 0x1F;
+	if (_gameId != GID_ZAK256) {
+		// FIXME - this probably can be removed eventually, I don't think the following
+		// check will ever be triggered, but then I could be wrong and it's better
+		// to play it safe.
+		if((_opcode & 0x3F) != (_opcode & 0x1F))
+			error("Oops, this shouldn't happen: o5_resourceRoutines opcode %d", _opcode);
+	}
 
-	switch (_opcode) {
+	int op = _opcode & 0x3F;
+
+	switch (_opcode & 0x3F) {
 	case 1:											// load script
 	case 2:											// load sound
 	case 3:											// load costume
-		ensureResourceLoaded(resType[_opcode-1], resid);
+		ensureResourceLoaded(resType[op-1], resid);
 		break;
 	case 4:											// load room 
 		if (_features == GF_AFTER_V3) {
@@ -1555,9 +1560,9 @@
 	case 7:											// nuke costume
 	case 8:											// nuke room
 		if (_gameId == GID_ZAK256)
-			warning("o5_resourceRoutines %d should not occur in Zak256", _opcode);
+			warning("o5_resourceRoutines %d should not occur in Zak256", op);
 		else
-			setResourceCounter(resType[_opcode-5], resid, 0x7F);
+			setResourceCounter(resType[op-5], resid, 0x7F);
 		break;
 
 	case 9:											// lock script





More information about the Scummvm-git-logs mailing list