diff options
author | Filippos Karapetis | 2010-07-26 05:49:00 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-07-26 05:49:00 +0000 |
commit | 27ce375a9526effe904b1d2c36f862043c516fd3 (patch) | |
tree | 1e112031e502f0690122c23997c3702a95713378 | |
parent | b28b290c7086b1d16df3403b727bc9686d006f13 (diff) | |
download | scummvm-rg350-27ce375a9526effe904b1d2c36f862043c516fd3.tar.gz scummvm-rg350-27ce375a9526effe904b1d2c36f862043c516fd3.tar.bz2 scummvm-rg350-27ce375a9526effe904b1d2c36f862043c516fd3.zip |
SCI: Fixed bug #3034507, "PQ2 Demo: Non-existant menu item"
svn-id: r51294
-rw-r--r-- | engines/sci/graphics/menu.cpp | 9 |
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; |