aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-07-07 06:45:33 +0000
committerTorbjörn Andersson2005-07-07 06:45:33 +0000
commite23e1aa1f6e3ffb26774493eed7e2558d69fce99 (patch)
treefeab178f315a088b0dab2fa1315d49bb21fd176e
parentfc4c06309c537e12ac5fe6de2bc161f269d38107 (diff)
downloadscummvm-rg350-e23e1aa1f6e3ffb26774493eed7e2558d69fce99.tar.gz
scummvm-rg350-e23e1aa1f6e3ffb26774493eed7e2558d69fce99.tar.bz2
scummvm-rg350-e23e1aa1f6e3ffb26774493eed7e2558d69fce99.zip
This allows ScummVM to run pre-Dig/FT SCUMM games again when compiled with
GCC 4.0, at least for me. I'm not enough of a language lawyer to say for certain whether the old code was really undefined, but it's a simple enough change that shouldn't possibly do any harm. svn-id: r18507
-rw-r--r--scumm/script_v5.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp
index 0c93bcf491..6abebf7fe6 100644
--- a/scumm/script_v5.cpp
+++ b/scumm/script_v5.cpp
@@ -1446,7 +1446,15 @@ void ScummEngine_v5::o5_equalZero() {
}
void ScummEngine_v5::o5_jumpRelative() {
- _scriptPointer += (int16)fetchScriptWord();
+ // Note that calling fetchScriptWord() will also modify _scriptPointer,
+ // so *don't* do this: _scriptPointer += (int16)fetchScriptWord();
+ //
+ // I'm not enough of a language lawyer to say for certain that this is
+ // undefined, but I do know that GCC 4.0 doesn't think it means what
+ // we want it to mean.
+
+ int16 offset = (int16)fetchScriptWord();
+ _scriptPointer += offset;
}
void ScummEngine_v5::o5_lights() {