aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorFilippos Karapetis2010-08-29 23:25:30 +0000
committerFilippos Karapetis2010-08-29 23:25:30 +0000
commite004831576355d689c1e045e84659e7b16b1feb6 (patch)
treeafc80aca35c55ac83961288216a6671b55b4fc95 /engines/sci/engine
parentb53d4dcd964ac5ac33d81e82d87477838c617afa (diff)
downloadscummvm-rg350-e004831576355d689c1e045e84659e7b16b1feb6.tar.gz
scummvm-rg350-e004831576355d689c1e045e84659e7b16b1feb6.tar.bz2
scummvm-rg350-e004831576355d689c1e045e84659e7b16b1feb6.zip
SCI: Fixed bug #3038767 - "SCI Fanmade - Cascade Quest: Crash when restoring a game"
svn-id: r52447
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kmenu.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp
index c8a6e03556..428c27ca73 100644
--- a/engines/sci/engine/kmenu.cpp
+++ b/engines/sci/engine/kmenu.cpp
@@ -46,12 +46,13 @@ reg_t kSetMenu(EngineState *s, int argc, reg_t *argv) {
uint16 itemId = argv[0].toUint16() & 0xFF;
uint16 attributeId;
int argPos = 1;
+ reg_t value;
while (argPos < argc) {
attributeId = argv[argPos].toUint16();
- if ((argPos + 1) >= argc)
- error("Too few parameters for kSetMenu");
- g_sci->_gfxMenu->kernelSetAttribute(menuId, itemId, attributeId, argv[argPos + 1]);
+ // Happens in the fanmade game Cascade Quest when loading - bug #3038767
+ value = (argPos + 1 < argc) ? argv[argPos + 1] : NULL_REG;
+ g_sci->_gfxMenu->kernelSetAttribute(menuId, itemId, attributeId, value);
argPos += 2;
}
return s->r_acc;
@@ -76,6 +77,11 @@ reg_t kDrawStatus(EngineState *s, int argc, reg_t *argv) {
// Sometimes this is called without giving text, if thats the case dont process it.
text = s->_segMan->getString(textReference);
+ if (text == "Replaying sound") {
+ // Happens in the fanmade game Cascade Quest when loading - ignore it
+ return s->r_acc;
+ }
+
g_sci->_gfxMenu->kernelDrawStatus(g_sci->strSplit(text.c_str(), NULL).c_str(), colorPen, colorBack);
}
return s->r_acc;