From 995ec987d0f8a9b152b8c5880ffe36dfbb602f2d Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 5 Aug 2003 17:58:38 +0000 Subject: fix warning, cleanup code svn-id: r9511 --- scumm/script_v2.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'scumm') 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; } } -- cgit v1.2.3