Make Goodbye and Choice choices mutually exclusive

This commit is contained in:
Capostrophic 2018-06-08 14:56:09 +03:00 committed by Capostrophic
parent 53e8882366
commit 11103211c5

View file

@ -430,11 +430,13 @@ namespace MWDialogue
} }
void DialogueManager::addChoice (const std::string& text, int choice) void DialogueManager::addChoice (const std::string& text, int choice)
{
if (!mGoodbye)
{ {
mIsInChoice = true; mIsInChoice = true;
mChoices.push_back(std::make_pair(text, choice)); mChoices.push_back(std::make_pair(text, choice));
} }
}
const std::vector<std::pair<std::string, int> >& DialogueManager::getChoices() const std::vector<std::pair<std::string, int> >& DialogueManager::getChoices()
{ {
@ -448,7 +450,7 @@ namespace MWDialogue
void DialogueManager::goodbye() void DialogueManager::goodbye()
{ {
mIsInChoice = false; if (!mIsInChoice)
mGoodbye = true; mGoodbye = true;
} }