1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00

Update src/openrct2/scripting/ScriptEngine.cpp

Co-Authored-By: Breno Rodrigues Guimarães <brenorg@gmail.com>
This commit is contained in:
Ted John
2020-04-24 13:24:26 +01:00
parent 4e1fa6a944
commit ad75cb0754

View File

@@ -821,17 +821,8 @@ bool ScriptEngine::RegisterCustomAction(
void ScriptEngine::RemoveCustomGameActions(const std::shared_ptr<Plugin>& plugin)
{
for (auto it = _customActions.begin(); it != _customActions.end();)
{
if (it->second.Owner == plugin)
{
it = _customActions.erase(it);
}
else
{
it++;
}
}
auto isOwner = [&] (auto& obj) { return obj.second.Owner == plugin; }
std::erase(std::remove_if(_customActions.begin(), _customActions.end(), isOwner), _customActions.end());
}
void ScriptEngine::RunGameActionHooks(const GameAction& action, std::unique_ptr<GameActionResult>& result, bool isExecute)