[Scummvm-cvs-logs] CVS: scummvm/kyra debugger.cpp,1.2,1.3 kyra.cpp,1.102,1.103 kyra.h,1.57,1.58 script_v1.cpp,1.52,1.53

Johannes Schickel lordhoto at users.sourceforge.net
Sat Dec 31 07:42:08 CET 2005


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

Modified Files:
	debugger.cpp kyra.cpp kyra.h script_v1.cpp 
Log Message:
Commited patches 1394374 and 1394374 with minor changes.
Thanks to clemmy for that.


Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/debugger.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- debugger.cpp	9 Dec 2005 23:02:16 -0000	1.2
+++ debugger.cpp	31 Dec 2005 15:41:37 -0000	1.3
@@ -59,9 +59,15 @@
 	if (argc > 1) {
 		uint room = atoi(argv[1]);
 
-		if (argc > 2)
+		// game will crash if entering a non-existent room
+		if (room >= _vm->_roomTableSize) {
+			DebugPrintf("room number must be any value between (including) 0 and %d\n", _vm->_roomTableSize-1);
+			return true;
+		}
+
+		if (argc > 2) {
 			direction = atoi(argv[2]);
-		else {
+		} else {
 			if (_vm->_roomTable[room].northExit != 0xff)
 				direction = 3;
 			else if (_vm->_roomTable[room].eastExit != 0xff)
@@ -178,8 +184,15 @@
 }
 
 bool Debugger::cmd_giveItem(int argc, const char **argv) {
-	if (argc) {
+	if (argc == 2) {
 		int item = atoi(argv[1]);
+
+		// Kyrandia 1 has only 108 items (-1 to 106), otherwise it will crash
+		if (item < -1 || item > 106) {
+			DebugPrintf("itemid must be any value between (including) -1 and 106\n");
+			return true;
+		}
+
 		_vm->setMouseItem(item);
 		_vm->_itemInHand = item;
 	} else

Index: kyra.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/kyra.cpp,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- kyra.cpp	30 Dec 2005 16:36:53 -0000	1.102
+++ kyra.cpp	31 Dec 2005 15:41:37 -0000	1.103
@@ -351,6 +351,8 @@
 	_fadeText = false;
 	_noDrawShapesFlag = 0;
 
+	_cauldronState = 0;
+
 	_brandonStatusBit = 0;
 	_brandonStatusBit0x02Flag = _brandonStatusBit0x20Flag = 10;
 	_brandonPosX = _brandonPosY = -1;

Index: kyra.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/kyra.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- kyra.h	29 Dec 2005 22:18:40 -0000	1.57
+++ kyra.h	31 Dec 2005 15:41:37 -0000	1.58
@@ -679,12 +679,14 @@
 	
 	Rect _noDropRects[11];
 	
-	uint16 _birthstoneGemTable[4];
-	uint8 _idolGemsTable[3];
+	int8 _birthstoneGemTable[4];
+	int8 _idolGemsTable[3];
 	
-	int16 _marbleVaseItem;
-	int16 _foyerItemTable[3];
+	int8 _marbleVaseItem;
+	int8 _foyerItemTable[3];
 	
+	int8 _cauldronState;
+
 	uint16 _brandonStatusBit;
 	int _brandonStatusBit0x02Flag;
 	int _brandonStatusBit0x20Flag;

Index: script_v1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/script_v1.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- script_v1.cpp	29 Dec 2005 22:18:40 -0000	1.52
+++ script_v1.cpp	31 Dec 2005 15:41:37 -0000	1.53
@@ -1702,13 +1702,14 @@
 }
 
 int KyraEngine::cmd_queryCauldronState(ScriptState *script) {
-	warning("STUB: cmd_queryCauldronState");
-	return 0;
+	debug(3, "cmd_queryCauldronState(0x%X) ()", script);
+	return _cauldronState;
 }
 
 int KyraEngine::cmd_setCauldronState(ScriptState *script) {
-	warning("STUB: cmd_setCauldronState");
-	return 0;
+	debug(3, "cmd_setCauldronState(0x%X) (%d)", script, stackPos(0));
+	_cauldronState = stackPos(0);
+	return _cauldronState;
 }
 
 int KyraEngine::cmd_queryCrystalState(ScriptState *script) {





More information about the Scummvm-git-logs mailing list