[Scummvm-git-logs] scummvm master -> 738bdf94aa216aacee378aa574eb869af67e9089

dreammaster dreammaster at scummvm.org
Sat Nov 5 14:47:09 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
738bdf94aa TITANIC: Fix showing replies with multiple response fragments


Commit: 738bdf94aa216aacee378aa574eb869af67e9089
    https://github.com/scummvm/scummvm/commit/738bdf94aa216aacee378aa574eb869af67e9089
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-11-05T09:46:57-04:00

Commit Message:
TITANIC: Fix showing replies with multiple response fragments

Changed paths:
    engines/titanic/true_talk/deskbot_script.cpp
    engines/titanic/true_talk/deskbot_script.h
    engines/titanic/true_talk/tt_response.cpp
    engines/titanic/true_talk/tt_response.h
    engines/titanic/true_talk/tt_script_base.cpp



diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp
index 4df47e0..9fd0662 100644
--- a/engines/titanic/true_talk/deskbot_script.cpp
+++ b/engines/titanic/true_talk/deskbot_script.cpp
@@ -1116,14 +1116,18 @@ int DeskbotScript::preprocess(const TTroomScript *roomScript, const TTsentence *
 		}
 
 	case 78:
+		// "Do you have a reservation?"
 		if (sentence->_field2C == 11 || sentence->_field2C == 13) {
+			// Player said they have a reservation
 			addResponse(getDialogueId(241262));
 		} else if (sentence->_field2C == 12 || sentence->contains("do not")) {
+			// Player said they don't have a reservation
 			setDialRegion(0, 0);
 			setDialRegion(1, 0);
 			addResponse(getDialogueId(241268));
-			add241716();
+			addAskBreakfast();
 		} else {
+			// Player didn't say yes or no
 			addResponse(getDialogueId(240745));
 		}
 
@@ -1149,7 +1153,7 @@ int DeskbotScript::preprocess(const TTroomScript *roomScript, const TTsentence *
 			break;
 		}
 
-		add241716();
+		addAskBreakfast();
 		applyFlag = true;
 		stateFlag = false;
 		break;
@@ -1480,7 +1484,7 @@ int DeskbotScript::checkCommonWords(const TTsentence *sentence) {
 	return 0;
 }
 
-void DeskbotScript::add241716() {
+void DeskbotScript::addAskBreakfast() {
 	addResponse(getDialogueId(241716));
 }
 
diff --git a/engines/titanic/true_talk/deskbot_script.h b/engines/titanic/true_talk/deskbot_script.h
index f597855..1d00abb 100644
--- a/engines/titanic/true_talk/deskbot_script.h
+++ b/engines/titanic/true_talk/deskbot_script.h
@@ -81,9 +81,9 @@ private:
 	int checkCommonWords(const TTsentence *sentence);
 
 	/**
-	 * Adds response dialogue 241716
+	 * Adds a dialogue for asking the player what kind of breakfast they'd like
 	 */
-	void add241716();
+	void addAskBreakfast();
 
 	/**
 	 * Adds a dialogue description for the player's assigned room
diff --git a/engines/titanic/true_talk/tt_response.cpp b/engines/titanic/true_talk/tt_response.cpp
index 1c784ad..3cb8d2c 100644
--- a/engines/titanic/true_talk/tt_response.cpp
+++ b/engines/titanic/true_talk/tt_response.cpp
@@ -49,6 +49,12 @@ TTresponse::~TTresponse() {
 	}
 }
 
+TTresponse *TTresponse::appendResponse(int id) {
+	TTresponse *resp = new TTresponse(id, 3);
+	_nextP = resp;
+	return resp;
+}
+
 TTresponse *TTresponse::copyChain() const {
 	TTresponse *returnResponseP = new TTresponse(this);
 
diff --git a/engines/titanic/true_talk/tt_response.h b/engines/titanic/true_talk/tt_response.h
index d39d18c..950e1cd 100644
--- a/engines/titanic/true_talk/tt_response.h
+++ b/engines/titanic/true_talk/tt_response.h
@@ -42,6 +42,12 @@ public:
 	virtual ~TTresponse();
 
 	/**
+	 * Creates a new response and adds it as the current
+	 * response's next response
+	 */
+	TTresponse *appendResponse(int id);
+
+	/**
 	 * Makes a copy of the chain of responses
 	 */
 	TTresponse *copyChain() const;
diff --git a/engines/titanic/true_talk/tt_script_base.cpp b/engines/titanic/true_talk/tt_script_base.cpp
index 2f58ad1..1fa1ce3 100644
--- a/engines/titanic/true_talk/tt_script_base.cpp
+++ b/engines/titanic/true_talk/tt_script_base.cpp
@@ -129,7 +129,7 @@ void TTscriptBase::appendResponse(int index, int *maxP, int id) {
 	if (id && (!maxP || index <= *maxP)) {
 		if (_respTailP) {
 			// Prior fragments already exist, so append to end of chain
-			_respTailP = new TTresponse(_respTailP);
+			_respTailP = _respTailP->appendResponse(id);
 		} else {
 			// Currently no tail
 			_respTailP = new TTresponse(id, 3);





More information about the Scummvm-git-logs mailing list