diff options
author | Paul Gilbert | 2017-09-24 12:39:39 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-09-24 12:39:39 -0400 |
commit | a6026fc1fce636b9b8493e8f76b39cbd8406c8dc (patch) | |
tree | cf4e7876c73e33f13a8af424ad029388ecd564d2 /engines/titanic/npcs | |
parent | d9eebaf787cb1e4e643d0d4704617d82a94acbcc (diff) | |
download | scummvm-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.cpp | 4 |
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; |