[Client] Don't start dialogue via client scripts if already in dialogue

This prevents infinite greeting spam in scripts such as hlormarScript.
pull/253/head
David Cernat 8 years ago
parent e6e5d406b8
commit 2f551aba02

@ -5,6 +5,7 @@
Include additional headers for multiplayer purposes
*/
#include "../mwbase/windowmanager.hpp"
#include "../mwmp/Main.hpp"
#include "../mwmp/LocalPlayer.hpp"
/*
@ -178,7 +179,17 @@ namespace MWScript
if (!ptr.getRefData().isEnabled())
return;
MWBase::Environment::get().getDialogueManager()->startDialogue (ptr);
/*
Start of tes3mp change (major)
Don't start a dialogue if the target is already engaged in one, thus
preventing infinite greeting loops
*/
if (!MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_Dialogue))
MWBase::Environment::get().getDialogueManager()->startDialogue(ptr);
/*
End of tes3mp change (major)
*/
}
};

Loading…
Cancel
Save