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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user