aboutsummaryrefslogtreecommitdiff
path: root/engines/lure/hotspots.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2007-11-15 10:07:46 +0000
committerPaul Gilbert2007-11-15 10:07:46 +0000
commit61e8ad7a32e5a50296d2f30c01422399445b8d73 (patch)
tree2ea51cc6e66c11296fadf25e775f010d4dac30a8 /engines/lure/hotspots.cpp
parent41456707d64228c4271a53c4928647419574ee57 (diff)
downloadscummvm-rg350-61e8ad7a32e5a50296d2f30c01422399445b8d73.tar.gz
scummvm-rg350-61e8ad7a32e5a50296d2f30c01422399445b8d73.tar.bz2
scummvm-rg350-61e8ad7a32e5a50296d2f30c01422399445b8d73.zip
Bugfix to prevent characters occasionally facing one way whilst walking in another direction
svn-id: r29507
Diffstat (limited to 'engines/lure/hotspots.cpp')
-rw-r--r--engines/lure/hotspots.cpp28
1 files changed, 19 insertions, 9 deletions
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp
index dd73889102..0bf7020d8d 100644
--- a/engines/lure/hotspots.cpp
+++ b/engines/lure/hotspots.cpp
@@ -820,6 +820,23 @@ void Hotspot::handleTalkDialog() {
debugC(ERROR_DETAILED, kLureDebugAnimations, "Talk countdown = %d", _data->talkCountdown);
if (_data->talkCountdown == CONVERSE_COUNTDOWN_SIZE) {
+ // Check if there's already an active dialog - if so, wait until it's finished
+ if (room.isDialogActive() && (res.getTalkingCharacter() != _hotspotId)) {
+ ++_data->talkCountdown;
+ if (delayCtr() > 0)
+ setDelayCtr(delayCtr() + 2);
+
+ if ((_data->talkDestCharacterId != 0) && (_data->talkDestCharacterId != NOONE_ID)) {
+ Hotspot *destCharacter = res.getActiveHotspot(_data->talkDestCharacterId);
+ if (destCharacter->resource()->talkCountdown > CONVERSE_COUNTDOWN_SIZE) {
+ destCharacter->resource()->talkCountdown += 2;
+ if (destCharacter->delayCtr() > 0)
+ destCharacter->setDelayCtr(destCharacter->delayCtr() + 2);
+ }
+ }
+ return;
+ }
+
// Time to set up the dialog for the character
--_data->talkCountdown;
debugC(ERROR_DETAILED, kLureDebugAnimations, "Talk dialog opening");
@@ -891,15 +908,6 @@ void Hotspot::startTalkDialog() {
if (room.roomNumber() != roomNumber())
return;
- if (room.isDialogActive()) {
- // There's already an active dialog, so need to wait until it's finished
- ++_data->talkCountdown;
- if (delayCtr() > 0)
- setDelayCtr(delayCtr() + 1);
-
- return;
- }
-
room.setTalkDialog(hotspotId(), _data->talkDestCharacterId, _data->useHotspotId,
_data->talkMessageId);
}
@@ -3420,6 +3428,8 @@ void HotspotTickHandlers::talkAnimHandler(Hotspot &h) {
case TALK_RESPONSE_WAIT:
// Wait until the character's response has finished being displayed
+ h.handleTalkDialog();
+
charHotspot = res.getActiveHotspot(talkDestCharacter);
assert(charHotspot);
debugC(ERROR_DETAILED, kLureDebugAnimations, "Player talk dialog countdown %d",