|
|
@ -24,7 +24,7 @@ namespace MWScript
|
|
|
|
addStartup();
|
|
|
|
addStartup();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GlobalScripts::addScript (const std::string& name)
|
|
|
|
void GlobalScripts::addScript (const std::string& name, const std::string& targetId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::map<std::string, GlobalScriptDesc>::iterator iter =
|
|
|
|
std::map<std::string, GlobalScriptDesc>::iterator iter =
|
|
|
|
mScripts.find (::Misc::StringUtils::lowerCase (name));
|
|
|
|
mScripts.find (::Misc::StringUtils::lowerCase (name));
|
|
|
@ -36,12 +36,16 @@ namespace MWScript
|
|
|
|
GlobalScriptDesc desc;
|
|
|
|
GlobalScriptDesc desc;
|
|
|
|
desc.mRunning = true;
|
|
|
|
desc.mRunning = true;
|
|
|
|
desc.mLocals.configure (*script);
|
|
|
|
desc.mLocals.configure (*script);
|
|
|
|
|
|
|
|
desc.mId = targetId;
|
|
|
|
|
|
|
|
|
|
|
|
mScripts.insert (std::make_pair (name, desc));
|
|
|
|
mScripts.insert (std::make_pair (name, desc));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else if (!iter->second.mRunning)
|
|
|
|
|
|
|
|
{
|
|
|
|
iter->second.mRunning = true;
|
|
|
|
iter->second.mRunning = true;
|
|
|
|
|
|
|
|
iter->second.mId = targetId;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GlobalScripts::removeScript (const std::string& name)
|
|
|
|
void GlobalScripts::removeScript (const std::string& name)
|
|
|
|