[Scummvm-cvs-logs] SF.net SVN: scummvm:[51294] scummvm/trunk/engines/sci/graphics/menu.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Jul 26 07:49:00 CEST 2010


Revision: 51294
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51294&view=rev
Author:   thebluegr
Date:     2010-07-26 05:49:00 +0000 (Mon, 26 Jul 2010)

Log Message:
-----------
SCI: Fixed bug #3034507, "PQ2 Demo: Non-existant menu item"

Modified Paths:
--------------
    scummvm/trunk/engines/sci/graphics/menu.cpp

Modified: scummvm/trunk/engines/sci/graphics/menu.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/menu.cpp	2010-07-26 05:40:58 UTC (rev 51293)
+++ scummvm/trunk/engines/sci/graphics/menu.cpp	2010-07-26 05:49:00 UTC (rev 51294)
@@ -271,8 +271,13 @@
 
 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;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list