From a6026fc1fce636b9b8493e8f76b39cbd8406c8dc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 24 Sep 2017 12:39:39 -0400 Subject: TITANIC: Fix crash if you exit the game whilst a bot is talking --- engines/titanic/npcs/true_talk_npc.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/titanic/npcs') diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp index d67fd3628e..6393f26567 100644 --- a/engines/titanic/npcs/true_talk_npc.cpp +++ b/engines/titanic/npcs/true_talk_npc.cpp @@ -130,6 +130,10 @@ bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMs bool CTrueTalkNPC::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg) { debugC(DEBUG_DETAILED, kDebugScripts, "%s TrueTalkNotifySpeechEndedMsg flags=%x dialogueId=%d", getName().c_str(), _npcFlags, msg->_dialogueId); + + if (!getGameManager()) + return false; + _npcFlags &= ~NPCFLAG_SPEAKING; --_speechCounter; _speechDuration = 0; -- cgit v1.2.3