aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/klists.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/engine/klists.cpp')
-rw-r--r--engines/sci/engine/klists.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp
index 2ca5a65fc0..330b78b2b2 100644
--- a/engines/sci/engine/klists.cpp
+++ b/engines/sci/engine/klists.cpp
@@ -835,6 +835,10 @@ reg_t kArrayGetSize(EngineState *s, int argc, reg_t *argv) {
}
reg_t kArrayGetElement(EngineState *s, int argc, reg_t *argv) {
+ if (getSciVersion() == SCI_VERSION_2_1_LATE) {
+ return kStringGetChar(s, argc, argv);
+ }
+
SciArray &array = *s->_segMan->lookupArray(argv[0]);
return array.getAsID(argv[1].toUint16());
}
@@ -846,6 +850,10 @@ reg_t kArraySetElements(EngineState *s, int argc, reg_t *argv) {
}
reg_t kArrayFree(EngineState *s, int argc, reg_t *argv) {
+ if (getSciVersion() == SCI_VERSION_2_1_LATE && !s->_segMan->isValidAddr(argv[0], SEG_TYPE_ARRAY)) {
+ return s->r_acc;
+ }
+
s->_segMan->freeArray(argv[0]);
return s->r_acc;
}