From 61e8ad7a32e5a50296d2f30c01422399445b8d73 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 15 Nov 2007 10:07:46 +0000 Subject: Bugfix to prevent characters occasionally facing one way whilst walking in another direction svn-id: r29507 --- engines/lure/hotspots.cpp | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'engines') 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", -- cgit v1.2.3