aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/kmenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/engine/kmenu.cpp')
-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;