mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-23 23:04:36 +01:00
Refactor plugin scope
This commit is contained in:
@@ -82,14 +82,13 @@ void HookEngine::Call(HOOK_TYPE type)
|
||||
auto& hookList = GetHookList(type);
|
||||
for (auto& hook : hookList.Hooks)
|
||||
{
|
||||
_execInfo.SetCurrentPlugin(hook.Owner);
|
||||
ScriptExecutionInfo::PluginScope scope(_execInfo, hook.Owner);
|
||||
|
||||
const auto& function = hook.Function;
|
||||
function.push();
|
||||
duk_pcall(function.context(), 0);
|
||||
duk_pop(function.context());
|
||||
}
|
||||
_execInfo.SetCurrentPlugin(nullptr);
|
||||
}
|
||||
|
||||
HookList& HookEngine::GetHookList(HOOK_TYPE type)
|
||||
|
||||
Reference in New Issue
Block a user