diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/true_talk/true_talk_manager.cpp | 1 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_talker.cpp | 12 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_talker.h | 7 |
3 files changed, 13 insertions, 7 deletions
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp index a7766e8d18..f8ac185351 100644 --- a/engines/titanic/true_talk/true_talk_manager.cpp +++ b/engines/titanic/true_talk/true_talk_manager.cpp @@ -212,6 +212,7 @@ void CTrueTalkManager::removeCompleted() { if (talker->_done) { i = _talkers.erase(i); + talker->speechEnded(); delete talker; } else { ++i; diff --git a/engines/titanic/true_talk/tt_talker.cpp b/engines/titanic/true_talk/tt_talker.cpp index b296ec25d1..a2c5e4cc97 100644 --- a/engines/titanic/true_talk/tt_talker.cpp +++ b/engines/titanic/true_talk/tt_talker.cpp @@ -34,7 +34,12 @@ void TTtalker::speechStarted(const CString &dialogueStr, uint dialogueId, uint s msg.execute(_npc, nullptr, MSGFLAG_BREAK_IF_HANDLED); } -TTtalker::~TTtalker() { +void TTtalker::endSpeech(int val) { + _done = true; + _talkEndState = val; +} + +void TTtalker::speechEnded() { CPetControl *petControl = _npc->getPetControl(); if (petControl) // Add in final line @@ -45,9 +50,4 @@ TTtalker::~TTtalker() { endedMsg.execute(_npc, nullptr, MSGFLAG_BREAK_IF_HANDLED); } -void TTtalker::endSpeech(int val) { - _done = true; - _talkEndState = val; -} - } // End of namespace Titanic diff --git a/engines/titanic/true_talk/tt_talker.h b/engines/titanic/true_talk/tt_talker.h index 60a2e56499..4f0b59c044 100644 --- a/engines/titanic/true_talk/tt_talker.h +++ b/engines/titanic/true_talk/tt_talker.h @@ -44,7 +44,6 @@ public: _dialogueId(0), _talkEndState(0), _done(0) {} TTtalker(CTrueTalkManager *owner, CTrueTalkNPC *npc) : _owner(owner), _npc(npc), _dialogueId(0), _talkEndState(0), _done(0) {} - ~TTtalker(); /** * Start a new speech @@ -55,6 +54,12 @@ public: * End the speech */ void endSpeech(int val); + + /** + * Called when a speech is finished, to signal to the associated character + * that the speech is over + */ + void speechEnded(); }; class TTtalkerList : public List<TTtalker> { |