aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicola Mettifogo2011-01-29 07:21:13 +0000
committerNicola Mettifogo2011-01-29 07:21:13 +0000
commitc3698a2cd5c98bf69ed7eb5425398f15f3453021 (patch)
tree37f150a14573ba498ca3d10c6c85262ef623f796
parentd39d75779e876154ac94e6626029de69bda0d354 (diff)
downloadscummvm-rg350-c3698a2cd5c98bf69ed7eb5425398f15f3453021.tar.gz
scummvm-rg350-c3698a2cd5c98bf69ed7eb5425398f15f3453021.tar.bz2
scummvm-rg350-c3698a2cd5c98bf69ed7eb5425398f15f3453021.zip
PARALLACTION: Clarify strategy for choosing (answer) dialogue paths.
svn-id: r55604
-rw-r--r--engines/parallaction/dialogue.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp
index f642c4eb89..5922d002c6 100644
--- a/engines/parallaction/dialogue.cpp
+++ b/engines/parallaction/dialogue.cpp
@@ -110,7 +110,7 @@ protected:
void transitionToState(DialogueState newState);
bool displayQuestion();
- bool displayAnswers();
+ void displayAnswers();
bool testAnswerFlags(Answer *a);
virtual void addVisibleAnswers(Question *q) = 0;
virtual int16 selectAnswer() = 0;
@@ -187,12 +187,7 @@ bool DialogueManager::testAnswerFlags(Answer *a) {
return ((a->_yesFlags & flags) == a->_yesFlags) && ((a->_noFlags & ~flags) == a->_noFlags);
}
-bool DialogueManager::displayAnswers() {
-
- addVisibleAnswers(_q);
- if (_numVisAnswers == 0) {
- return false;
- }
+void DialogueManager::displayAnswers() {
// create balloons
int id;
@@ -216,8 +211,6 @@ bool DialogueManager::displayAnswers() {
_faceId = _vm->_gfx->setItem(_answerer, _ballonPos._answerChar.x, _ballonPos._answerChar.y);
_vm->_gfx->setItemFrame(_faceId, mood);
-
- return true;
}
int16 DialogueManager::selectAnswer1() {
@@ -282,18 +275,24 @@ void DialogueManager::nextAnswer() {
}
// try and check if there are any suitable answers,
- // given the current game state
+ // given the current game state.
addVisibleAnswers(_q);
if (!_numVisAnswers) {
+ // if there are no answers, then chicken out
transitionToState(DIALOGUE_OVER);
return;
}
if (!_visAnswers[0]._a->_text.compareToIgnoreCase("NULL")) {
+ // if the first answer is null (it's implied that it's the
+ // only one because we already called addVisibleAnswers),
+ // then jump to the next question
_answerId = _visAnswers[0]._index;
transitionToState(NEXT_QUESTION);
} else {
- transitionToState(displayAnswers() ? RUN_ANSWER : DIALOGUE_OVER);
+ // at this point we are sure there are non-null answers to show
+ displayAnswers();
+ transitionToState(RUN_ANSWER);
}
}