diff options
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/console.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/gc.cpp | 9 | ||||
-rw-r--r-- | engines/sci/engine/kscripts.cpp | 2 | ||||
-rw-r--r-- | engines/sci/engine/script.cpp | 2 | ||||
-rw-r--r-- | engines/sci/event.cpp | 2 | ||||
-rw-r--r-- | engines/sci/parser/vocabulary.cpp | 6 |
6 files changed, 12 insertions, 11 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 60bd129efc..7f0b641d83 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -3775,7 +3775,7 @@ int Console::printObject(reg_t pos) { DebugPrintf(" -- member variables:\n"); for (i = 0; (uint)i < obj->getVarCount(); i++) { DebugPrintf(" "); - if (i < var_container->getVarCount()) { + if (var_container && i < var_container->getVarCount()) { uint16 varSelector = var_container->getVarSelector(i); DebugPrintf("[%03x] %s = ", varSelector, _engine->getKernel()->getSelectorName(varSelector).c_str()); } else diff --git a/engines/sci/engine/gc.cpp b/engines/sci/engine/gc.cpp index b1d461c561..e395eeab94 100644 --- a/engines/sci/engine/gc.cpp +++ b/engines/sci/engine/gc.cpp @@ -90,14 +90,7 @@ static void processWorkList(SegManager *segMan, WorklistManager &wm, const Commo wm._worklist.pop_back(); if (reg.segment != stackSegment) { // No need to repeat this one debugC(kDebugLevelGC, "[GC] Checking %04x:%04x", PRINT_REG(reg)); - // WORKAROUND: We only check for valid offsets here. Fixes bugs - // #3299458 and #3295849. - // FIXME: Where are these invalid offsets coming from? The check - // below avoids a crash when examining invalid references, but the - // root of the problem lies elsewhere. These shouldn't be in the - // stack at all (unless these really are script bugs, in which case - // we should just keep the sanity check). - if (reg.segment < heap.size() && heap[reg.segment] && heap[reg.segment]->isValidOffset(reg.offset)) { + if (reg.segment < heap.size() && heap[reg.segment]) { // Valid heap object? Find its outgoing references! wm.pushArray(heap[reg.segment]->listAllOutgoingReferences(reg)); } diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp index b9baa3540a..605998c874 100644 --- a/engines/sci/engine/kscripts.cpp +++ b/engines/sci/engine/kscripts.cpp @@ -262,7 +262,7 @@ reg_t kDisposeScript(EngineState *s, int argc, reg_t *argv) { SegmentId id = s->_segMan->getScriptSegment(script); Script *scr = s->_segMan->getScriptIfLoaded(id); - if (scr) { + if (scr && !scr->isMarkedAsDeleted()) { if (s->_executionStack.back().addr.pc.segment != id) scr->setLockers(1); } diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp index 25bf91c3ad..0592940559 100644 --- a/engines/sci/engine/script.cpp +++ b/engines/sci/engine/script.cpp @@ -383,6 +383,7 @@ void Script::relocateSci3(reg_t block) { } void Script::incrementLockers() { + assert(!_markedAsDeleted); _lockers++; } @@ -396,6 +397,7 @@ int Script::getLockers() const { } void Script::setLockers(int lockers) { + assert(lockers == 0 || !_markedAsDeleted); _lockers = lockers; } diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp index 6b5ea64fc4..e8097e4e76 100644 --- a/engines/sci/event.cpp +++ b/engines/sci/event.cpp @@ -253,7 +253,7 @@ SciEvent EventManager::getScummVMEvent() { // When Ctrl AND Alt are pressed together with a regular key, Linux will give us control-key, Windows will give // us the actual key. My opinion is that windows is right, because under DOS the keys worked the same, anyway // we support the other case as well - if ((modifiers & Common::KBD_SHIFT) && input.character > 0 && input.character < 27) + if ((modifiers & Common::KBD_ALT) && input.character > 0 && input.character < 27) input.character += 96; // 0x01 -> 'a' if (getSciVersion() <= SCI_VERSION_1_MIDDLE) { diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp index 25043401cc..11d214b28d 100644 --- a/engines/sci/parser/vocabulary.cpp +++ b/engines/sci/parser/vocabulary.cpp @@ -398,6 +398,12 @@ void Vocabulary::lookupWord(ResultWordList& retval, const char *word, int word_l if (getSciVersion() < SCI_VERSION_01) return; + // WORKAROUND: + // This is a hack to temporarily fix bug #3288328. + // On the master branch this return is unconditional. + if (g_sci->getGameId() == GID_QFG2 && strcmp(word, "healing") == 0) + return; + } // Now try all suffixes |