[Scummvm-cvs-logs] SF.net SVN: scummvm: [31907] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Tue May 6 22:55:33 CEST 2008


Revision: 31907
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31907&view=rev
Author:   lordhoto
Date:     2008-05-06 13:55:33 -0700 (Tue, 06 May 2008)

Log Message:
-----------
Fixed possible crash in Debugger_v2 when using 'give'.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/debugger.cpp
    scummvm/trunk/engines/kyra/kyra_hof.cpp
    scummvm/trunk/engines/kyra/kyra_mr.cpp
    scummvm/trunk/engines/kyra/kyra_v2.h

Modified: scummvm/trunk/engines/kyra/debugger.cpp
===================================================================
--- scummvm/trunk/engines/kyra/debugger.cpp	2008-05-06 20:50:27 UTC (rev 31906)
+++ scummvm/trunk/engines/kyra/debugger.cpp	2008-05-06 20:55:33 UTC (rev 31907)
@@ -421,9 +421,8 @@
 	if (argc == 2) {
 		int item = atoi(argv[1]);
 
-		// Kyrandia 2 has only 178 items (-1 to 176), otherwise it will crash
-		if (item < -1 || item > 176) {
-			DebugPrintf("itemid must be any value between (including) -1 and 176\n");
+		if (item < -1 || item > _vm->engineDesc().maxItemId) {
+			DebugPrintf("itemid must be any value between (including) -1 and %d\n", _vm->engineDesc().maxItemId);
 			return true;
 		}
 

Modified: scummvm/trunk/engines/kyra/kyra_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_hof.cpp	2008-05-06 20:50:27 UTC (rev 31906)
+++ scummvm/trunk/engines/kyra/kyra_hof.cpp	2008-05-06 20:55:33 UTC (rev 31907)
@@ -49,7 +49,10 @@
 	8,
 
 	// Animation script specific
-	33
+	33,
+
+	// Item specific
+	175
 };
 
 KyraEngine_HoF::KyraEngine_HoF(OSystem *system, const GameFlags &flags) : KyraEngine_v2(system, flags, _hofEngineDesc), _updateFunctor(this, &KyraEngine_HoF::update) {

Modified: scummvm/trunk/engines/kyra/kyra_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_mr.cpp	2008-05-06 20:50:27 UTC (rev 31906)
+++ scummvm/trunk/engines/kyra/kyra_mr.cpp	2008-05-06 20:55:33 UTC (rev 31907)
@@ -50,7 +50,10 @@
 	9,
 
 	// Animation script specific
-	9
+	9,
+
+	// Item specific
+	71
 };
 
 KyraEngine_MR::KyraEngine_MR(OSystem *system, const GameFlags &flags) : KyraEngine_v2(system, flags, _mrEngineDesc) {

Modified: scummvm/trunk/engines/kyra/kyra_v2.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.h	2008-05-06 20:50:27 UTC (rev 31906)
+++ scummvm/trunk/engines/kyra/kyra_v2.h	2008-05-06 20:55:33 UTC (rev 31907)
@@ -51,6 +51,9 @@
 
 		// Animation script specific
 		const int animScriptFrameAdd;
+
+		// Item specific
+		const int maxItemId;
 	};
 
 	KyraEngine_v2(OSystem *system, const GameFlags &flags, const EngineDesc &desc);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list