mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-18 13:32:32 +01:00
Revert change to RemoveCustomGameActions
This commit is contained in:
@@ -821,8 +821,17 @@ bool ScriptEngine::RegisterCustomAction(
|
|||||||
|
|
||||||
void ScriptEngine::RemoveCustomGameActions(const std::shared_ptr<Plugin>& plugin)
|
void ScriptEngine::RemoveCustomGameActions(const std::shared_ptr<Plugin>& plugin)
|
||||||
{
|
{
|
||||||
auto isOwner = [&] (auto& obj) { return obj.second.Owner == plugin; }
|
for (auto it = _customActions.begin(); it != _customActions.end();)
|
||||||
std::erase(std::remove_if(_customActions.begin(), _customActions.end(), isOwner), _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)
|
void ScriptEngine::RunGameActionHooks(const GameAction& action, std::unique_ptr<GameActionResult>& result, bool isExecute)
|
||||||
|
|||||||
Reference in New Issue
Block a user