aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/graphics/menu.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp
index 44d4e6968f..b280f78b3c 100644
--- a/engines/sci/graphics/menu.cpp
+++ b/engines/sci/graphics/menu.cpp
@@ -271,8 +271,13 @@ GuiMenuItemEntry *GfxMenu::findItem(uint16 menuId, uint16 itemId) {
void GfxMenu::kernelSetAttribute(uint16 menuId, uint16 itemId, uint16 attributeId, reg_t value) {
GuiMenuItemEntry *itemEntry = findItem(menuId, itemId);
- if (!itemEntry)
- error("Tried to setAttribute() on non-existant menu-item %d:%d", menuId, itemId);
+ if (!itemEntry) {
+ // Check if the game actually has a menu. PQ2 demo calls this, for example, but has no menus.
+ if (_itemList.size() == 0)
+ return;
+ else
+ error("Tried to setAttribute() on non-existant menu-item %d:%d", menuId, itemId);
+ }
switch (attributeId) {
case SCI_MENU_ATTRIBUTE_ENABLED:
itemEntry->enabled = value.isNull() ? false : true;