aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKari Salminen2008-07-28 16:46:20 +0000
committerKari Salminen2008-07-28 16:46:20 +0000
commitd2639f0c845b8b1f07a3545868e61c29c067cbca (patch)
treecec6c3a4d5c3512b4bc474360041d25f90720338
parentadd07fceaaa2cbbc9e286c420d4bc66c4d17dc36 (diff)
downloadscummvm-rg350-d2639f0c845b8b1f07a3545868e61c29c067cbca.tar.gz
scummvm-rg350-d2639f0c845b8b1f07a3545868e61c29c067cbca.tar.bz2
scummvm-rg350-d2639f0c845b8b1f07a3545868e61c29c067cbca.zip
Fixed crash when running Operation Stealth introduced in r33339 (There are actually 256 global variables although only 255 of them are saved and loaded from savegames. The last one is VAR_BYPASS_PROTECTION and it is written to in the mainLoop so that's why there was a crash).
svn-id: r33380
-rw-r--r--engines/cine/script_fw.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp
index 08d84d480f..6b4ec2790f 100644
--- a/engines/cine/script_fw.cpp
+++ b/engines/cine/script_fw.cpp
@@ -38,7 +38,13 @@
namespace Cine {
-ScriptVars globalVars(NUM_MAX_VAR);
+/**
+ * Global variables.
+ * 255 of these are saved, but there's one more that's used for bypassing the copy protection.
+ * In CineEngine::mainLoop(int bootScriptIdx) there's this code: globalVars[VAR_BYPASS_PROTECTION] = 0;
+ * And as VAR_BYPASS_PROTECTION is 255 that's why we're allocating one more than we otherwise would.
+ */
+ScriptVars globalVars(NUM_MAX_VAR + 1);
uint16 compareVars(int16 a, int16 b);