Parse dialogue text for keywords after the resultscript runs (Fixes #4210)

pull/337/head
scrawl 7 years ago
parent 7c5d2a1ac4
commit c36d250044

@ -77,6 +77,7 @@ namespace MWDialogue
void DialogueManager::parseText (const std::string& text)
{
updateActorKnownTopics();
std::vector<HyperTextParser::Token> hypertext = HyperTextParser::parseHyperText(text);
for (std::vector<HyperTextParser::Token>::iterator tok = hypertext.begin(); tok != hypertext.end(); ++tok)
@ -145,18 +146,13 @@ namespace MWDialogue
// TODO play sound
}
// first topics update so that parseText knows the keywords to highlight
updateActorKnownTopics();
parseText (info->mResponse);
MWScript::InterpreterContext interpreterContext(&mActor.getRefData().getLocals(),mActor);
callback->addResponse("", Interpreter::fixDefinesDialog(info->mResponse, interpreterContext));
executeScript (info->mResultScript, mActor);
mLastTopic = it->mId;
// update topics again to accommodate changes resulting from executeScript
updateActorKnownTopics();
parseText (info->mResponse);
return true;
}
@ -252,8 +248,6 @@ namespace MWDialogue
const ESM::DialInfo* info = filter.search(dialogue, true);
if (info)
{
parseText (info->mResponse);
std::string title;
if (dialogue.mType==ESM::Dialogue::Persuasion)
{
@ -292,6 +286,8 @@ namespace MWDialogue
executeScript (info->mResultScript, mActor);
parseText (info->mResponse);
mLastTopic = topic;
}
}

Loading…
Cancel
Save