aboutsummaryrefslogtreecommitdiff
path: root/engines/lilliput
diff options
context:
space:
mode:
authorStrangerke2012-05-05 00:10:55 +0200
committerEugene Sandulenko2018-03-28 17:36:57 +0200
commit0eea1447d378d1b7e1667aaf06dd93d1a7aa01e1 (patch)
tree4882a4fe36c555c89f19572b858deac3d4090fbc /engines/lilliput
parent8d25611dcb8417dc874a444f077eed3459a76db1 (diff)
downloadscummvm-rg350-0eea1447d378d1b7e1667aaf06dd93d1a7aa01e1.tar.gz
scummvm-rg350-0eea1447d378d1b7e1667aaf06dd93d1a7aa01e1.tar.bz2
scummvm-rg350-0eea1447d378d1b7e1667aaf06dd93d1a7aa01e1.zip
LILLIPUT: fix a bug in OC_sub17D04
Diffstat (limited to 'engines/lilliput')
-rw-r--r--engines/lilliput/lilliput.cpp1
-rw-r--r--engines/lilliput/script.cpp6
2 files changed, 3 insertions, 4 deletions
diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index 95407cda7a..a86fed852e 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -2746,6 +2746,7 @@ void LilliputEngine::initialize() {
byte *LilliputEngine::getCharacterVariablesPtr(int16 index) {
debugC(1, kDebugEngine, "getCharacterVariablesPtr(%d)", index);
+ assert((index > -3120) && (index < 1400));
if (index >= 0)
return &_characterVariables_[index];
else
diff --git a/engines/lilliput/script.cpp b/engines/lilliput/script.cpp
index 75e1fd7da9..f27682234b 100644
--- a/engines/lilliput/script.cpp
+++ b/engines/lilliput/script.cpp
@@ -1372,8 +1372,6 @@ byte *LilliputScript::getCharacterVariablePtr() {
int index = tmpVal * 32;
index += _currScript->readUint16LE();
- assert(index < 1400);
-
return _vm->getCharacterVariablesPtr(index);
}
@@ -2979,10 +2977,10 @@ void LilliputScript::OC_sub18367() {
void LilliputScript::OC_sub17D04() {
debugC(1, kDebugScript, "OC_sub17D04()");
- byte var1 = getValue1();
+ int16 index = getValue1();
byte var2 = _currScript->readUint16LE() & 0xFF;
- sub1823E(var1, var2, _vm->getCharacterVariablesPtr(var1));
+ sub1823E(index, var2, _vm->getCharacterVariablesPtr(index * 32));
}
void LilliputScript::OC_sub18387() {