diff options
author | Strangerke | 2012-05-29 08:30:34 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-03-28 17:36:57 +0200 |
commit | 21d38e3b4c7725c99a5b2da755c0a7ffb2dc696d (patch) | |
tree | 7da952ef082f1211e778b804d36c0e6c72bcebbf /engines | |
parent | 2e9867086cf5f40742c0447fcee970c66e4f854a (diff) | |
download | scummvm-rg350-21d38e3b4c7725c99a5b2da755c0a7ffb2dc696d.tar.gz scummvm-rg350-21d38e3b4c7725c99a5b2da755c0a7ffb2dc696d.tar.bz2 scummvm-rg350-21d38e3b4c7725c99a5b2da755c0a7ffb2dc696d.zip |
LILLIPUT: bugfix: Intro is now completable
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lilliput/lilliput.cpp | 36 | ||||
-rw-r--r-- | engines/lilliput/script.cpp | 2 |
2 files changed, 22 insertions, 16 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp index e34dfd6d80..a31688c7dd 100644 --- a/engines/lilliput/lilliput.cpp +++ b/engines/lilliput/lilliput.cpp @@ -907,7 +907,7 @@ int16 LilliputEngine::sub16DD5(int x1, int y1, int x2, int y2) { int index = (y1 * 64 + x1) * 4; assert(index <= 16380); - byte *isoMap = &_bufferIsoMap[1]; + byte *isoMap = &_bufferIsoMap[index + 1]; int16 dx = x2 - x1; int16 dy = y2 - y1; @@ -1023,7 +1023,7 @@ void LilliputEngine::checkMapClosing(bool &forceReturnFl) { } void LilliputEngine::sub16CA0() { - debugC(2, kDebugEngineTBC, "sub16CA0()"); + debugC(2, kDebugEngine, "sub16CA0()"); for (int index = _numCharacters - 1; index >= 0; index--) { if (_rulesBuffer2_11[index] & 1) @@ -1053,46 +1053,51 @@ void LilliputEngine::sub16CA0() { } else if ((_rulesBuffer2_11[index] & 4) != 0) { _byte16C9F = 0; } else { - if (_characterDirectionArray[index] == 0) { + switch (_characterDirectionArray[index]) { + case 0: if (d1 > c1) { _byte16C9F = 2; if (d2 == c2) _byte16C9F = 3; - if (sub16DD5(c1, d1, c2, d2) != 0) + if (sub16DD5(c1, c2, d1, d2) != 0) _byte16C9F = 1; } - } else if (_characterDirectionArray[index] == 1) { + break; + case 1: if (d2 < c2) { _byte16C9F = 2; if (d1 == c1) _byte16C9F = 3; - if (sub16DD5(c1, d1, c2, d2) != 0) + if (sub16DD5(c1, c2, d1, d2) != 0) _byte16C9F = 1; } - } else if (_characterDirectionArray[index] == 2) { + break; + case 2: if (d2 > c2) { _byte16C9F = 2; if (d1 == c1) _byte16C9F = 3; - if (sub16DD5(c1, d1, c2, d2) != 0) + if (sub16DD5(c1, c2, d1, d2) != 0) _byte16C9F = 1; } - } else { + break; + default: if (d1 < c1) { _byte16C9F = 2; if (d2 == c2) _byte16C9F = 3; - if (sub16DD5(c1, d1, c2, d2) != 0) + if (sub16DD5(c1, c2, d1, d2) != 0) _byte16C9F = 1; } + break; } } } @@ -1100,13 +1105,14 @@ void LilliputEngine::sub16CA0() { } } - int16 val = _scriptHandler->_array10B51[index2 + index * 40]; - val = (val & 0xFF) + ((val & 0xFF) << 8); - if ((val & 0xFF) != _byte16C9F) { + int8 v2 = _scriptHandler->_array10B51[index2 + (index * 40)] & 0xFF; + int8 v1 = v2; + + if (v2 != _byte16C9F) { _scriptHandler->_characterScriptEnabled[index] = 1; - val = (val & 0xFF00) | _byte16C9F; + v2 = _byte16C9F; } - _scriptHandler->_array10B51[index2 + index * 40] = val; + _scriptHandler->_array10B51[index2 + (index * 40)] = (v1 << 8) + v2; } } } diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp index b9286da383..de250c802c 100644 --- a/engines/lilliput/script.cpp +++ b/engines/lilliput/script.cpp @@ -1546,7 +1546,7 @@ byte LilliputScript::OC_compareCoords_1() { // TODO Rename function to "Check if character pos in rectangle" byte LilliputScript::OC_compareCoords_2() { - debugC(1, kDebugScriptTBC, "OC_compareCoords_2()"); + debugC(1, kDebugScript, "OC_compareCoords_2()"); int16 index = getValue1(); Common::Point var1 = Common::Point(_array16123PosX[index], _array1614BPosY[index]); |