From 2a35c7d33a825f293b07769f87ccf7949f2a06da Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 12 Dec 2013 13:16:32 +0100 Subject: [PATCH] fixed running global scripts a second time after they have been stopped --- apps/openmw/mwscript/globalscripts.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwscript/globalscripts.cpp b/apps/openmw/mwscript/globalscripts.cpp index d55ad0063..1400d6675 100644 --- a/apps/openmw/mwscript/globalscripts.cpp +++ b/apps/openmw/mwscript/globalscripts.cpp @@ -22,7 +22,11 @@ namespace MWScript void GlobalScripts::addScript (const std::string& name) { - if (mScripts.find (Misc::StringUtils::lowerCase (name))==mScripts.end()) + std::map >::iterator iter = + mScripts.find (Misc::StringUtils::lowerCase (name)); + + if (iter==mScripts.end()) + { if (const ESM::Script *script = mStore.get().find (name)) { Locals locals; @@ -31,6 +35,9 @@ namespace MWScript mScripts.insert (std::make_pair (name, std::make_pair (true, locals))); } + } + else + iter->second.first = true; } void GlobalScripts::removeScript (const std::string& name)