[Scummvm-cvs-logs] SF.net SVN: scummvm:[34036] scummvm/trunk/engines/cine/bg.cpp

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Tue Aug 19 15:05:39 CEST 2008


Revision: 34036
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34036&view=rev
Author:   buddha_
Date:     2008-08-19 13:05:38 +0000 (Tue, 19 Aug 2008)

Log Message:
-----------
Fix for bug #2057656: FW: Assert during demo (regression).
Future Wars's Amiga demo is trying to load collision data files
'L8_MK.NEO' and 'L23_MK.NEO' that aren't supplied with the demo.
Previous code crashed when a file couldn't be found,
now it gives a warning instead.

Modified Paths:
--------------
    scummvm/trunk/engines/cine/bg.cpp

Modified: scummvm/trunk/engines/cine/bg.cpp
===================================================================
--- scummvm/trunk/engines/cine/bg.cpp	2008-08-19 12:17:17 UTC (rev 34035)
+++ scummvm/trunk/engines/cine/bg.cpp	2008-08-19 13:05:38 UTC (rev 34036)
@@ -41,10 +41,18 @@
 	uint16 header[32];
 	byte *ptr, *dataPtr;
 
+	int16 foundFileIdx = findFileInBundle(ctName);
+	if (foundFileIdx == -1) {
+		warning("loadCtFW: Unable to find collision data file '%s'", ctName);
+		// FIXME: Rework this function's return value policy and return an appropriate value here.
+		// The return value isn't yet used for anything so currently it doesn't really matter.
+		return 0;
+	}
+
 	if (currentCtName != ctName)
 		strcpy(currentCtName, ctName);
 
-	ptr = dataPtr = readBundleFile(findFileInBundle(ctName));
+	ptr = dataPtr = readBundleFile(foundFileIdx);
 
 	loadRelatedPalette(ctName);
 


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