aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/npcs
diff options
context:
space:
mode:
authorPaul Gilbert2017-09-24 12:39:39 -0400
committerPaul Gilbert2017-09-24 12:39:39 -0400
commita6026fc1fce636b9b8493e8f76b39cbd8406c8dc (patch)
treecf4e7876c73e33f13a8af424ad029388ecd564d2 /engines/titanic/npcs
parentd9eebaf787cb1e4e643d0d4704617d82a94acbcc (diff)
downloadscummvm-rg350-a6026fc1fce636b9b8493e8f76b39cbd8406c8dc.tar.gz
scummvm-rg350-a6026fc1fce636b9b8493e8f76b39cbd8406c8dc.tar.bz2
scummvm-rg350-a6026fc1fce636b9b8493e8f76b39cbd8406c8dc.zip
TITANIC: Fix crash if you exit the game whilst a bot is talking
Diffstat (limited to 'engines/titanic/npcs')
-rw-r--r--engines/titanic/npcs/true_talk_npc.cpp4
1 files changed, 4 insertions, 0 deletions
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;