[Scummvm-cvs-logs] CVS: scummvm/scumm scumm.cpp,1.127,1.128

Max Horn fingolfin at users.sourceforge.net
Sat Aug 21 16:13:23 CEST 2004


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

Modified Files:
	scumm.cpp 
Log Message:
HACK to work around bug #1009344 (Doesn't distinguish monkey and monkey1)

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.127
retrieving revision 1.128
diff -u -d -r1.127 -r1.128
--- scumm.cpp	21 Aug 2004 22:33:23 -0000	1.127
+++ scumm.cpp	21 Aug 2004 23:12:11 -0000	1.128
@@ -3082,9 +3082,25 @@
 			if (elem) {
 				if (!exactMatch)
 					detectedGames.clear();	// Clear all the non-exact candidates
+
+				const char *target = elem->target;
+
+				// HACK to work around bug #1009344
+				if (!strcmp(target, "monkey")) {
+					const char *str = name;
+					int len = 0;
+					// Scan to the end of the string...
+					while (*str++)
+						len++;
+					// ...so that we can check if it ends with 'monkey1.000'
+					const char *monkey1 = "monkey1.000";	// Len: 11
+					if (len >= 11 && !scumm_stricmp(str-11-1, monkey1))
+						target = "monkey1";
+				}
+
 				// Find the GameSettings for that target
 				for (g = scumm_settings; g->name; ++g) {
-					if (0 == scumm_stricmp(g->name, elem->target))
+					if (0 == scumm_stricmp(g->name, target))
 						break;
 				}
 				assert(g->name);





More information about the Scummvm-git-logs mailing list