aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2007-12-09 10:39:50 +0000
committerPaul Gilbert2007-12-09 10:39:50 +0000
commit04bfc7158a0f4fc6ab16caa5570bda965005e324 (patch)
tree3084146be36874007b0e1b98130b900b4625335c
parentf89dbfe91c6382acfce89c9636e760cc73b0bcb2 (diff)
downloadscummvm-rg350-04bfc7158a0f4fc6ab16caa5570bda965005e324.tar.gz
scummvm-rg350-04bfc7158a0f4fc6ab16caa5570bda965005e324.tar.bz2
scummvm-rg350-04bfc7158a0f4fc6ab16caa5570bda965005e324.zip
Bugfix to correctly display a hotspot name in message dialogs that include it
svn-id: r29776
-rw-r--r--engines/lure/hotspots.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp
index d514807792..1211634b94 100644
--- a/engines/lure/hotspots.cpp
+++ b/engines/lure/hotspots.cpp
@@ -757,6 +757,7 @@ void Hotspot::showMessage(uint16 messageId, uint16 destCharacterId) {
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 @@ void Hotspot::showMessage(uint16 messageId, uint16 destCharacterId) {
} 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) {