SentenceTab unk4/unk3 are the sentence objects (think of: 'Use objectA with objectB' or 'Give objectA to objectB' etc.); added a little more V2 sentence hackery; added a FIXME regarding some strange sentence code (accessing objectB before it is set) in script.cpp

svn-id: r7562
This commit is contained in:
Max Horn 2003-05-16 02:16:59 +00:00
parent bfb68f513a
commit 7d08aea4cc
5 changed files with 27 additions and 21 deletions

View file

@ -709,7 +709,7 @@ void Scumm::doSentence(int c, int b, int a) {
// Check if this doSentence request is identical to the previous one;
// if yes, ignore this invocation.
if (_sentenceNum && st->verb == c && st->unk4 == b && st->unk3 == a)
if (_sentenceNum && st->verb == c && st->objectA == b && st->objectB == a)
return;
_sentenceNum++;
@ -719,7 +719,8 @@ void Scumm::doSentence(int c, int b, int a) {
st = &_sentence[_sentenceNum++];
if (!(st->unk3 & 0xFF00))
// FIXME: this seems wrong, it accesses objectB before we ever set it!
if (!(st->objectB & 0xFF00))
st->unk2 = 0;
else
st->unk2 = 1;
@ -727,8 +728,8 @@ void Scumm::doSentence(int c, int b, int a) {
}
st->verb = c;
st->unk4 = b;
st->unk3 = a;
st->objectA = b;
st->objectB = a;
st->freezeCount = 0;
}
@ -755,12 +756,12 @@ void Scumm::checkAndRunSentenceScript() {
_sentenceNum--;
if (!(_features & GF_AFTER_V7))
if (_sentence[_sentenceNum].unk2 && _sentence[_sentenceNum].unk3 == _sentence[_sentenceNum].unk4)
if (_sentence[_sentenceNum].unk2 && _sentence[_sentenceNum].objectB == _sentence[_sentenceNum].objectA)
return;
_localParamList[0] = _sentence[_sentenceNum].verb;
_localParamList[1] = _sentence[_sentenceNum].unk4;
_localParamList[2] = _sentence[_sentenceNum].unk3;
_localParamList[1] = _sentence[_sentenceNum].objectA;
_localParamList[2] = _sentence[_sentenceNum].objectB;
_currentScript = 0xFF;
if (sentenceScript)
runScript(sentenceScript, 0, 0, _localParamList);