mirror of https://github.com/OpenRCT2/OpenRCT2.git
Revert change to RemoveCustomGameActions
This commit is contained in:
parent
4162ad0eb6
commit
4ebd8da630
|
@ -821,8 +821,17 @@ bool ScriptEngine::RegisterCustomAction(
|
|||
|
||||
void ScriptEngine::RemoveCustomGameActions(const std::shared_ptr<Plugin>& plugin)
|
||||
{
|
||||
auto isOwner = [&] (auto& obj) { return obj.second.Owner == plugin; }
|
||||
std::erase(std::remove_if(_customActions.begin(), _customActions.end(), isOwner), _customActions.end());
|
||||
for (auto it = _customActions.begin(); it != _customActions.end();)
|
||||
{
|
||||
if (it->second.Owner == plugin)
|
||||
{
|
||||
it = _customActions.erase(it);
|
||||
}
|
||||
else
|
||||
{
|
||||
it++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEngine::RunGameActionHooks(const GameAction& action, std::unique_ptr<GameActionResult>& result, bool isExecute)
|
||||
|
|
Loading…
Reference in New Issue