mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 10:36:42 +00:00
fixed running global scripts a second time after they have been stopped
This commit is contained in:
parent
74793c1c2f
commit
2a35c7d33a
1 changed files with 8 additions and 1 deletions
|
@ -22,7 +22,11 @@ namespace MWScript
|
||||||
|
|
||||||
void GlobalScripts::addScript (const std::string& name)
|
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))
|
if (const ESM::Script *script = mStore.get<ESM::Script>().find (name))
|
||||||
{
|
{
|
||||||
Locals locals;
|
Locals locals;
|
||||||
|
@ -32,6 +36,9 @@ namespace MWScript
|
||||||
mScripts.insert (std::make_pair (name, std::make_pair (true, locals)));
|
mScripts.insert (std::make_pair (name, std::make_pair (true, locals)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
iter->second.first = true;
|
||||||
|
}
|
||||||
|
|
||||||
void GlobalScripts::removeScript (const std::string& name)
|
void GlobalScripts::removeScript (const std::string& name)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue