[Scummvm-cvs-logs] CVS: scummvm/scumm script_v2.cpp,2.62,2.63

Max Horn fingolfin at users.sourceforge.net
Wed May 14 05:27:09 CEST 2003


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

Modified Files:
	script_v2.cpp 
Log Message:
fixed v2 verb handling

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.62
retrieving revision 2.63
diff -u -d -r2.62 -r2.63
--- script_v2.cpp	13 May 2003 23:42:40 -0000	2.62
+++ script_v2.cpp	14 May 2003 12:26:23 -0000	2.63
@@ -725,15 +725,15 @@
 }
 
 void Scumm_v2::o2_verbOps() {
-	int opcode = fetchScriptByte();
-	int verb, slot, state;
+	int verb = fetchScriptByte();
+	int slot, state;
 	
-	switch (opcode) {
+	switch (verb) {
 	case 0:		// Delete Verb
-		verb = getVarOrDirectByte(0x80);
-		slot = getVerbSlot(verb, 0);
+		slot = getVarOrDirectByte(0x80) + 1;
+		assert(0 < slot && slot < _maxVerbs);
 
-		printf("o2_verbOps delete verb = %d, slot = %d\n", verb, slot);
+		//printf("o2_verbOps delete slot = %d\n", slot);
 		killVerb(slot);
 		break;
 	
@@ -742,7 +742,7 @@
 		state = fetchScriptByte();
 		slot = getVerbSlot(verb, 0);
 
-		printf("o2_verbOps Verb On/Off: verb = %d, slot = %d, state = %d\n", verb, slot, state);
+		//printf("o2_verbOps Verb On/Off: verb = %d, slot = %d, state = %d\n", verb, slot, state);
 		
 		_verbs[slot].curmode = state;
 
@@ -751,22 +751,12 @@
 	default: {	// New Verb
 		int x = fetchScriptByte() << 3;
 		int y = fetchScriptByte() << 3;
-		verb = getVarOrDirectByte(0x80);
+		slot = getVarOrDirectByte(0x80) + 1;
 		int unk = fetchScriptByte(); // ?
 		
-		printf("o2_verbOps: opcode = %d, x = %d, y = %d, slot = %d, unk = %d, name = %s\n",
-				opcode, x, y, verb, unk, _scriptPointer);
-
 		VerbSlot *vs;
-		slot = getVerbSlot(verb, 0);
-		if (slot == 0) {
-			for (slot = 1; slot < _maxVerbs; slot++) {
-				if (_verbs[slot].verbid == 0)
-					break;
-			}
-			if (slot == _maxVerbs)
-				error("Too many verbs");
-		}
+		assert(0 < slot && slot < _maxVerbs);
+
 		vs = &_verbs[slot];
 		vs->verbid = verb;
 		vs->color = 2;
@@ -782,6 +772,9 @@
 		
 		vs->x = x;
 		vs->y = y;
+
+		//printf("o2_verbOps: verb = %d, slot = %d, x = %d, y = %d, unk = %d, name = %s\n",
+		//		verb, slot, x, y, unk, _scriptPointer);
 
 		// It follows the verb name
 		loadPtrToResource(rtVerb, slot, NULL);





More information about the Scummvm-git-logs mailing list