diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sherlock/scalpel/scalpel_talk.cpp | 4 | ||||
-rw-r--r-- | engines/sherlock/scalpel/scalpel_talk.h | 6 | ||||
-rw-r--r-- | engines/sherlock/talk.cpp | 11 | ||||
-rw-r--r-- | engines/sherlock/talk.h | 5 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_talk.cpp | 6 | ||||
-rw-r--r-- | engines/sherlock/tattoo/tattoo_talk.h | 5 | ||||
-rw-r--r-- | engines/sherlock/tattoo/widget_talk.cpp | 2 |
7 files changed, 35 insertions, 4 deletions
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp index 8261304675..80e9b79364 100644 --- a/engines/sherlock/scalpel/scalpel_talk.cpp +++ b/engines/sherlock/scalpel/scalpel_talk.cpp @@ -537,6 +537,10 @@ void ScalpelTalk::talkWait(const byte *&str) { } } +void ScalpelTalk::nothingToSay() { + error("Character had no talk options available"); +} + void ScalpelTalk::switchSpeaker(int subIndex) { // If it's the 3DO, pass on to start the actor's conversation movie if (IS_3DO) diff --git a/engines/sherlock/scalpel/scalpel_talk.h b/engines/sherlock/scalpel/scalpel_talk.h index 3ae36336df..7ef67050d0 100644 --- a/engines/sherlock/scalpel/scalpel_talk.h +++ b/engines/sherlock/scalpel/scalpel_talk.h @@ -63,13 +63,17 @@ protected: */ virtual void talkWait(const byte *&str); - /** * Called when the active speaker is switched */ virtual void switchSpeaker(int subIndex); /** + * Called when a character being spoken to has no talk options to display + */ + virtual void nothingToSay(); + + /** * Show the talk display */ virtual void showTalk(); diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp index 83596e4e85..1b12c6afb4 100644 --- a/engines/sherlock/talk.cpp +++ b/engines/sherlock/talk.cpp @@ -468,8 +468,15 @@ void Talk::talk(int objNum) { break; } } - if (select == -1) - error("No entry matched all required flags"); + + if (select == -1) { + freeTalkVars(); + if (!scumm_strnicmp(talkFilename.c_str(), "PATH", 4)) + error("No entries found to execute in path file"); + + nothingToSay(); + return; + } // See if the statement is a stealth mode reply Statement &statement = _statements[select]; diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h index 2f7f2d0c42..767c7c803c 100644 --- a/engines/sherlock/talk.h +++ b/engines/sherlock/talk.h @@ -256,6 +256,11 @@ protected: virtual void showTalk() = 0; /** + * Called when a character being spoken to has no talk options to display + */ + virtual void nothingToSay() = 0; + + /** * Called when the active speaker is switched */ virtual void switchSpeaker(int subIndex) {} diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp index 7762b4814b..ee6856c6d4 100644 --- a/engines/sherlock/tattoo/tattoo_talk.cpp +++ b/engines/sherlock/tattoo/tattoo_talk.cpp @@ -21,6 +21,7 @@ */ #include "sherlock/tattoo/tattoo_talk.h" +#include "sherlock/tattoo/tattoo_fixed_text.h" #include "sherlock/tattoo/tattoo_people.h" #include "sherlock/tattoo/tattoo_scene.h" #include "sherlock/tattoo/tattoo_user_interface.h" @@ -200,6 +201,11 @@ void TattooTalk::talkInterface(const byte *&str) { _wait = true; } +void TattooTalk::nothingToSay() { + TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui; + ui.putMessage("%s", FIXED(NothingToSay)); +} + void TattooTalk::showTalk() { TattooPeople &people = *(TattooPeople *)_vm->_people; TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui; diff --git a/engines/sherlock/tattoo/tattoo_talk.h b/engines/sherlock/tattoo/tattoo_talk.h index 64a329e3f8..cd961835d6 100644 --- a/engines/sherlock/tattoo/tattoo_talk.h +++ b/engines/sherlock/tattoo/tattoo_talk.h @@ -87,6 +87,11 @@ protected: virtual void talkInterface(const byte *&str); /** + * Called when a character being spoken to has no talk options to display + */ + virtual void nothingToSay(); + + /** * Show the talk display */ virtual void showTalk(); diff --git a/engines/sherlock/tattoo/widget_talk.cpp b/engines/sherlock/tattoo/widget_talk.cpp index d33da658ab..dfb2360208 100644 --- a/engines/sherlock/tattoo/widget_talk.cpp +++ b/engines/sherlock/tattoo/widget_talk.cpp @@ -311,7 +311,7 @@ void WidgetTalk::handleEvents() { if (select == -1) { talk.freeTalkVars(); - ui.putMessage("%s", FIXED(NothingToSay)); + talk.nothingToSay(); return; } |