[Scummvm-cvs-logs] SF.net SVN: scummvm: [29776] scummvm/trunk/engines/lure/hotspots.cpp

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sun Dec 9 11:39:50 CET 2007


Revision: 29776
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29776&view=rev
Author:   dreammaster
Date:     2007-12-09 02:39:50 -0800 (Sun, 09 Dec 2007)

Log Message:
-----------
Bugfix to correctly display a hotspot name in message dialogs that include it

Modified Paths:
--------------
    scummvm/trunk/engines/lure/hotspots.cpp

Modified: scummvm/trunk/engines/lure/hotspots.cpp
===================================================================
--- scummvm/trunk/engines/lure/hotspots.cpp	2007-12-09 10:08:41 UTC (rev 29775)
+++ scummvm/trunk/engines/lure/hotspots.cpp	2007-12-09 10:39:50 UTC (rev 29776)
@@ -757,6 +757,7 @@
 	debugC(ERROR_DETAILED, kLureDebugStrings, "Hotspot::showMessage messageId=%xh srcChar=%xh, destChar=%xh",
 		messageId, _hotspotId, destCharacterId);
 	Resources &res = Resources::getReference();
+	char nameBuffer[MAX_HOTSPOT_NAME_SIZE];
 	MemoryBlock *data = res.messagesData();
 	Hotspot *hotspot;
 	uint16 *v = (uint16 *) data->data();
@@ -794,9 +795,13 @@
 	} else if (idVal >= 0x8000) {
 		// Handle string display
 		idVal &= 0x7fff;
-		hotspot = res.getActiveHotspot(res.fieldList().getField(ACTIVE_HOTSPOT_ID));
-		const char *itemName = (hotspot == NULL) ? NULL : hotspot->getName();
-
+		HotspotData *hotspotData = res.getHotspot(res.fieldList().getField(ACTIVE_HOTSPOT_ID));
+		const char *itemName = NULL;
+		if (hotspotData != NULL) {
+			StringData::getReference().getString(hotspotData->nameId, nameBuffer);
+			itemName = nameBuffer;
+		}
+			
 		Dialog::show(idVal, itemName, this->getName());
 		
 	} else if (idVal != 0) {


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