aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorMax Horn2009-03-24 23:30:48 +0000
committerMax Horn2009-03-24 23:30:48 +0000
commitee42d06a437e5c0b9d96cee65c33e4f88c258dee (patch)
tree1f7a43c24647dbff1d6d5f92fa287b179f14e316 /engines/scumm
parent51751cd0691b25bcdb882b72ab8c8347d8b3cfbb (diff)
downloadscummvm-rg350-ee42d06a437e5c0b9d96cee65c33e4f88c258dee.tar.gz
scummvm-rg350-ee42d06a437e5c0b9d96cee65c33e4f88c258dee.tar.bz2
scummvm-rg350-ee42d06a437e5c0b9d96cee65c33e4f88c258dee.zip
Patch from bug #2710315: INDY3/FOA: bug in patch for series IQ with ScummVM GUI
svn-id: r39677
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/script_v5.cpp16
-rw-r--r--engines/scumm/scumm.cpp3
2 files changed, 12 insertions, 7 deletions
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index a8cd1336e3..e6af16af86 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -1017,9 +1017,13 @@ void ScummEngine_v5::loadVars() {
*/
void ScummEngine_v5::updateIQPoints() {
int seriesIQ;
- int episodeIQStringSize;
+ // IQString[0..72] corresponds to each puzzle's IQ.
+ // IQString[73] indicates that the IQ-file was loaded successfully and is always 0 when
+ // the IQ is calculated, hence it will be ignored here.
+ const int NUM_PUZZLES = 73;
+ byte seriesIQString[NUM_PUZZLES];
byte *episodeIQString;
- byte seriesIQString[73];
+ int episodeIQStringSize;
// load string with IQ points given per puzzle in any savegame
// IMPORTANT: the resource string STRINGID_IQ_SERIES is only valid while
@@ -1032,14 +1036,14 @@ void ScummEngine_v5::updateIQPoints() {
if (!episodeIQString)
return;
episodeIQStringSize = getResourceSize(rtString, STRINGID_IQ_EPISODE);
- if (episodeIQStringSize < 73)
+ if (episodeIQStringSize < NUM_PUZZLES)
return;
// merge episode and series IQ strings and calculate series IQ
seriesIQ = 0;
- // iterate over puzzles (each of the first 73 bytes corresponds to a puzzle's IQ)
- for (int i = 0; i < 73 ; ++i) {
- char puzzleIQ = seriesIQString[i];
+ // iterate over puzzles
+ for (int i = 0; i < NUM_PUZZLES ; ++i) {
+ byte puzzleIQ = seriesIQString[i];
// if puzzle is solved copy points to episode string
if (puzzleIQ > 0)
episodeIQString[i] = puzzleIQ;
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 441150bc9c..1443f2e6df 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2083,7 +2083,8 @@ void ScummEngine::scummLoop_handleSaveLoad() {
}
void ScummEngine_v5::scummLoop_handleSaveLoad() {
- byte saveLoad = (_saveLoadFlag != 0);
+ // copy saveLoadFlag as handleSaveLoad() resets it
+ byte saveLoad = _saveLoadFlag;
ScummEngine::scummLoop_handleSaveLoad();