mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-07 19:30:04 -04:00
fixed running global scripts a second time after they have been stopped
This commit is contained in:
parent
74793c1c2f
commit
2a35c7d33a
@ -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…
x
Reference in New Issue
Block a user