mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-30 20:15:35 +00:00
Parse dialogue text for keywords after the resultscript runs (Fixes #4210)
This commit is contained in:
parent
7c5d2a1ac4
commit
c36d250044
1 changed files with 4 additions and 8 deletions
|
@ -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…
Reference in a new issue