aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMatthew Hoops2010-07-29 19:08:07 +0000
committerMatthew Hoops2010-07-29 19:08:07 +0000
commitbc54fde8e1f58b910026644d606ba140aa3032c4 (patch)
treea1489561a34f04b053a78853323c6dd06837b970 /engines/sci
parent483f25b9e68daf41800e4dd51b7740e010782b18 (diff)
downloadscummvm-rg350-bc54fde8e1f58b910026644d606ba140aa3032c4.tar.gz
scummvm-rg350-bc54fde8e1f58b910026644d606ba140aa3032c4.tar.bz2
scummvm-rg350-bc54fde8e1f58b910026644d606ba140aa3032c4.zip
SCI: Ignore setAttribute() on any non-existent menu items
This fixes two fan games: Al Pond 2 and Aquarius. The original interpreter did this as well. svn-id: r51477
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/graphics/menu.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp
index 120c43f379..630626c128 100644
--- a/engines/sci/graphics/menu.cpp
+++ b/engines/sci/graphics/menu.cpp
@@ -271,14 +271,15 @@ 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) {
- // Check if the game actually has a menu. PQ2 demo calls this, for example, but has no menus.
- // (bug report #3034507)
- if (_itemList.size() == 0)
- return;
- else
- error("Tried to setAttribute() on non-existant menu-item %d:%d", menuId, itemId);
+ // PQ2 demo calls this, for example, but has no menus (bug report #3034507). Some SCI
+ // fan games (Al Pond 2, Aquarius) call this too on non-existent menu items. The
+ // original interpreter ignored these as well.
+ debugC(2, kDebugLevelGraphics, "Tried to setAttribute() on non-existent menu-item %d:%d", menuId, itemId);
+ return;
}
+
switch (attributeId) {
case SCI_MENU_ATTRIBUTE_ENABLED:
itemEntry->enabled = value.isNull() ? false : true;