[Scummvm-cvs-logs] CVS: scummvm/scumm script_v2.cpp,2.166,2.167

Max Horn fingolfin at users.sourceforge.net
Tue Aug 5 10:59:11 CEST 2003


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

Modified Files:
	script_v2.cpp 
Log Message:
fix warning, cleanup code

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.166
retrieving revision 2.167
diff -u -d -r2.166 -r2.167
--- script_v2.cpp	5 Aug 2003 16:57:47 -0000	2.166
+++ script_v2.cpp	5 Aug 2003 17:58:38 -0000	2.167
@@ -950,15 +950,15 @@
 			strcat(sentence, (const char*)temp);
 		}
 	
+		// For V1 games, the engine must compute the preposition.
+		// In all other Scumm versions, this is done by the sentence script.
 		if ((_version == 1) && (VAR(VAR_SENTENCE_PREPOSITION) == 0)) {
-			byte *ptr = getOBCDFromObject(VAR(VAR_SENTENCE_OBJECT1)) + 12;
-			int prep = (*ptr >> 5);
-			VerbSlot *vs = &_verbs[slot];
-	
-			if (vs->prep == 0xFF)
-				VAR(VAR_SENTENCE_PREPOSITION) = (*ptr >> 5);
-			else
-				VAR(VAR_SENTENCE_PREPOSITION) = vs->prep;
+			if (_verbs[slot].prep == 0xFF) {
+				byte *ptr = getOBCDFromObject(VAR(VAR_SENTENCE_OBJECT1));
+				assert(ptr);
+				VAR(VAR_SENTENCE_PREPOSITION) = (*(ptr+12) >> 5);
+			} else
+				VAR(VAR_SENTENCE_PREPOSITION) = _verbs[slot].prep;
 		}
 	}
 





More information about the Scummvm-git-logs mailing list