aboutsummaryrefslogtreecommitdiff
path: root/scumm/script.cpp
diff options
context:
space:
mode:
authorMax Horn2003-05-08 15:58:30 +0000
committerMax Horn2003-05-08 15:58:30 +0000
commit0461222181d648c90e9dbd493909a2ff9b0e800b (patch)
tree56dbb0600f26b2d2efc427ad6d80ff32118acb88 /scumm/script.cpp
parent98881c3a6a513c27a06e596c29e0b40b355844f6 (diff)
downloadscummvm-rg350-0461222181d648c90e9dbd493909a2ff9b0e800b.tar.gz
scummvm-rg350-0461222181d648c90e9dbd493909a2ff9b0e800b.tar.bz2
scummvm-rg350-0461222181d648c90e9dbd493909a2ff9b0e800b.zip
fixed various cases of bad var access
svn-id: r7394
Diffstat (limited to 'scumm/script.cpp')
-rw-r--r--scumm/script.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp
index f1a741d795..8a72b423e1 100644
--- a/scumm/script.cpp
+++ b/scumm/script.cpp
@@ -784,12 +784,17 @@ void Scumm::doSentence(int c, int b, int a) {
void Scumm::checkAndRunSentenceScript() {
int i;
ScriptSlot *ss;
+ int sentenceScript;
+ if (_features & GF_AFTER_V2)
+ sentenceScript = 2;
+ else
+ sentenceScript = VAR(VAR_SENTENCE_SCRIPT);
memset(_localParamList, 0, sizeof(_localParamList));
- if (isScriptInUse(VAR(VAR_SENTENCE_SCRIPT))) {
+ if (isScriptInUse(sentenceScript)) {
ss = vm.slot;
for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++)
- if (ss->number == VAR(VAR_SENTENCE_SCRIPT) && ss->status != ssDead && ss->freezeCount == 0)
+ if (ss->number == sentenceScript && ss->status != ssDead && ss->freezeCount == 0)
return;
}
@@ -806,8 +811,8 @@ void Scumm::checkAndRunSentenceScript() {
_localParamList[1] = _sentence[_sentenceNum].unk4;
_localParamList[2] = _sentence[_sentenceNum].unk3;
_currentScript = 0xFF;
- if (VAR(VAR_SENTENCE_SCRIPT))
- runScript(VAR(VAR_SENTENCE_SCRIPT), 0, 0, _localParamList);
+ if (sentenceScript)
+ runScript(sentenceScript, 0, 0, _localParamList);
}
void Scumm::runInputScript(int a, int cmd, int mode) {