aboutsummaryrefslogtreecommitdiff
path: root/engines/cine/various.cpp
diff options
context:
space:
mode:
authorKari Salminen2008-07-14 23:10:51 +0000
committerKari Salminen2008-07-14 23:10:51 +0000
commit60357650e03c8504b06631bba3ca520285977f15 (patch)
treeb3f19914161bf8e52b4b9777d43e8fdbbb50c4ce /engines/cine/various.cpp
parentba4ba85124d5cffdd75093abb6759f7588280f06 (diff)
downloadscummvm-rg350-60357650e03c8504b06631bba3ca520285977f15.tar.gz
scummvm-rg350-60357650e03c8504b06631bba3ca520285977f15.tar.bz2
scummvm-rg350-60357650e03c8504b06631bba3ca520285977f15.zip
Fix for bug #2016647 (FW: crash with italian amiga version).
- Consists of a workaround for a script bug that used local variable 251 when it should've used global variable 251. - Also added a fix for a crash when failing copy protection in Amiga or Atari ST versions of Future Wars. NOTE: That any of the Amiga or Atari ST versions of Future Wars haven't crashed right in the beginning before seems like plain luck because accessing local variable 251 is out of bounds! svn-id: r33068
Diffstat (limited to 'engines/cine/various.cpp')
-rw-r--r--engines/cine/various.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index 4b5d4efe13..69851aeff2 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -1518,12 +1518,22 @@ void mainLoopSub6(void) {
void checkForPendingDataLoad(void) {
if (newPrcName[0] != 0) {
- loadPrc(newPrcName);
+ bool loadPrcOk = loadPrc(newPrcName);
strcpy(currentPrcName, newPrcName);
strcpy(newPrcName, "");
- addScriptToList0(1);
+ // Check that the loading of the script file was successful before
+ // trying to add script 1 from it to the global scripts list. This
+ // fixes a crash when failing copy protection in Amiga or Atari ST
+ // versions of Future Wars.
+ if (loadPrcOk) {
+ addScriptToList0(1);
+ } else if (scumm_stricmp(currentPrcName, COPY_PROT_FAIL_PRC_NAME)) {
+ // We only show an error here for other files than the file that
+ // is loaded if copy protection fails (i.e. L201.ANI).
+ warning("checkForPendingDataLoad: loadPrc(%s) failed", currentPrcName);
+ }
}
if (newRelName[0] != 0) {