aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2003-08-05 17:58:38 +0000
committerMax Horn2003-08-05 17:58:38 +0000
commit995ec987d0f8a9b152b8c5880ffe36dfbb602f2d (patch)
tree0c7b1a2ad6dd2d26444c2588dcf6fe1693a69fc1 /scumm
parent4ae47a74bf2c1e79b182ea0301b0bbdd6170e60e (diff)
downloadscummvm-rg350-995ec987d0f8a9b152b8c5880ffe36dfbb602f2d.tar.gz
scummvm-rg350-995ec987d0f8a9b152b8c5880ffe36dfbb602f2d.tar.bz2
scummvm-rg350-995ec987d0f8a9b152b8c5880ffe36dfbb602f2d.zip
fix warning, cleanup code
svn-id: r9511
Diffstat (limited to 'scumm')
-rw-r--r--scumm/script_v2.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index d3ff6aba1c..720b01df76 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -950,15 +950,15 @@ void Scumm_v2::o2_drawSentence() {
strcat(sentence, (const char*)temp);
}
+ // For V1 games, the engine must compute the preposition.
+ // In all other Scumm versions, this is done by the sentence script.
if ((_version == 1) && (VAR(VAR_SENTENCE_PREPOSITION) == 0)) {
- byte *ptr = getOBCDFromObject(VAR(VAR_SENTENCE_OBJECT1)) + 12;
- int prep = (*ptr >> 5);
- VerbSlot *vs = &_verbs[slot];
-
- if (vs->prep == 0xFF)
- VAR(VAR_SENTENCE_PREPOSITION) = (*ptr >> 5);
- else
- VAR(VAR_SENTENCE_PREPOSITION) = vs->prep;
+ if (_verbs[slot].prep == 0xFF) {
+ byte *ptr = getOBCDFromObject(VAR(VAR_SENTENCE_OBJECT1));
+ assert(ptr);
+ VAR(VAR_SENTENCE_PREPOSITION) = (*(ptr+12) >> 5);
+ } else
+ VAR(VAR_SENTENCE_PREPOSITION) = _verbs[slot].prep;
}
}