diff options
author | Kari Salminen | 2008-08-19 13:05:38 +0000 |
---|---|---|
committer | Kari Salminen | 2008-08-19 13:05:38 +0000 |
commit | b7dce00942611cb84dd96a0e81fce6ddaea26ef5 (patch) | |
tree | ce0ed10557923874de2e5227213d075c0359203f /engines | |
parent | 97463309ba623606850b5d3b0baf7c9bdf9b6fba (diff) | |
download | scummvm-rg350-b7dce00942611cb84dd96a0e81fce6ddaea26ef5.tar.gz scummvm-rg350-b7dce00942611cb84dd96a0e81fce6ddaea26ef5.tar.bz2 scummvm-rg350-b7dce00942611cb84dd96a0e81fce6ddaea26ef5.zip |
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.
svn-id: r34036
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cine/bg.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/engines/cine/bg.cpp b/engines/cine/bg.cpp index 45bfae7925..cc7e843c2b 100644 --- a/engines/cine/bg.cpp +++ b/engines/cine/bg.cpp @@ -41,10 +41,18 @@ byte loadCtFW(const char *ctName) { 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); |