aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/script.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/scumm/script.cpp')
-rw-r--r--engines/scumm/script.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp
index f91a72b91d..f9871ec190 100644
--- a/engines/scumm/script.cpp
+++ b/engines/scumm/script.cpp
@@ -600,6 +600,29 @@ void ScummEngine::writeVar(uint var, int value) {
if (!(var & 0xF000)) {
checkRange(_numVariables - 1, 0, var, "Variable %d out of range(w)");
+ if (var == VAR_SENTENCE_SCRIPT && _game.id == GID_FT && _defaultFTSentenceScript == -1) {
+ // WORKAROUND for bug #1407789. See checkAndRunSentenceScript()
+ // for the actual workaround.
+
+ // FIXME: We do not yet have all necessary information, but the
+ // following is known:
+ //
+ // * The US PC version uses scripts 28 and 103.
+ // * The French PC version uses scripts 29 and 104.
+ // * The German Mac version uses scripts 29 and 104.
+ // * The German, Italian, Portuguese and Spanish PC versions
+ // use script 29. The other script is not currently known.
+ // * The US Mac demo uses script 28.
+ //
+ // For now we assume that the very first time VAR_SENTENCE_SCRIPT
+ // is set, it is set to the default value (this happens in script 1).
+ // We furtermore assume that both scripts, if their IDs are shifted,
+ // are shifted by the same amount.
+
+ _defaultFTSentenceScript = value;
+ _buggyFTSentenceScript = 103 + (_defaultFTSentenceScript - 28);
+ }
+
if (VAR_SUBTITLES != 0xFF && var == VAR_SUBTITLES) {
// Ignore default setting in HE72-73 games
if (_game.heversion <= 73 && vm.slot[_currentScript].number == 1)