fixed running global scripts a second time after they have been stopped

actorid
Marc Zinnschlag 11 years ago
parent 74793c1c2f
commit 2a35c7d33a

@ -22,7 +22,11 @@ namespace MWScript
void GlobalScripts::addScript (const std::string& name)
{
if (mScripts.find (Misc::StringUtils::lowerCase (name))==mScripts.end())
std::map<std::string, std::pair<bool, Locals> >::iterator iter =
mScripts.find (Misc::StringUtils::lowerCase (name));
if (iter==mScripts.end())
{
if (const ESM::Script *script = mStore.get<ESM::Script>().find (name))
{
Locals locals;
@ -32,6 +36,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)
{

Loading…
Cancel
Save