Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make adding non-existent global script more forgiving (bug #5364) #2772

Merged
merged 2 commits into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Make adding non-existent global script more forgiving (bug #5364)
  • Loading branch information
Capostrophic committed Apr 10, 2020
commit feeab8a335f02415c6d621dc19809b3ccc9d0c98
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
0.47.0
------

Bug #5364: Script fails/stops if trying to startscript an unknown script

0.46.0
------
Expand Down
6 changes: 5 additions & 1 deletion apps/openmw/mwscript/globalscripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace MWScript

if (iter==mScripts.end())
{
if (const ESM::Script *script = mStore.get<ESM::Script>().find (name))
if (const ESM::Script *script = mStore.get<ESM::Script>().search(name))
{
GlobalScriptDesc desc;
desc.mRunning = true;
Expand All @@ -37,6 +37,10 @@ namespace MWScript

mScripts.insert (std::make_pair (name, desc));
}
else
{
Log(Debug::Error) << "Failed to add global script " << name << ": script record not found";
}
}
else if (!iter->second.mRunning)
{
Expand Down