diff options
author | Nicola Mettifogo | 2011-01-29 07:20:57 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2011-01-29 07:20:57 +0000 |
commit | d39d75779e876154ac94e6626029de69bda0d354 (patch) | |
tree | 6ba2c09fbfa97b53531e9cc50f5bfc102359054d | |
parent | 6d4d253ec44408006b37f5e08d9c284618175ff9 (diff) | |
download | scummvm-rg350-d39d75779e876154ac94e6626029de69bda0d354.tar.gz scummvm-rg350-d39d75779e876154ac94e6626029de69bda0d354.tar.bz2 scummvm-rg350-d39d75779e876154ac94e6626029de69bda0d354.zip |
PARALLACTION: Don't show 'null' answers in dialogues.
Skip a 'runanswer' state when the text of the only answer available is 'null'.
svn-id: r55603
-rw-r--r-- | engines/parallaction/dialogue.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp index 1865171053..f642c4eb89 100644 --- a/engines/parallaction/dialogue.cpp +++ b/engines/parallaction/dialogue.cpp @@ -281,18 +281,20 @@ void DialogueManager::nextAnswer() { return; } - if (!_q->_answers[0]->_text.compareToIgnoreCase("NULL")) { - addVisibleAnswers(_q); - if (_numVisAnswers) { - _answerId = _visAnswers[0]._index; - transitionToState(NEXT_QUESTION); - } else { - transitionToState(DIALOGUE_OVER); - } + // try and check if there are any suitable answers, + // given the current game state + addVisibleAnswers(_q); + if (!_numVisAnswers) { + transitionToState(DIALOGUE_OVER); return; } - - transitionToState(displayAnswers() ? RUN_ANSWER : DIALOGUE_OVER); + + if (!_visAnswers[0]._a->_text.compareToIgnoreCase("NULL")) { + _answerId = _visAnswers[0]._index; + transitionToState(NEXT_QUESTION); + } else { + transitionToState(displayAnswers() ? RUN_ANSWER : DIALOGUE_OVER); + } } void DialogueManager::runAnswer() { |