From f2c6dcbbeca515f14c2f27768d6faa7e40cb13fb Mon Sep 17 00:00:00 2001 From: Basssiiie Date: Mon, 11 Sep 2023 09:05:35 +0200 Subject: [PATCH] Fix incorrect target api when executing custom actions (#20778) --- distribution/changelog.txt | 1 + src/openrct2/scripting/ScriptEngine.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 92455e8dcb..3e8a44ad49 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.4.7 (in development) ------------------------------------------------------------------------ - Fix: [#20737] Spent money in player window underflows when getting refunds. +- Fix: [#20778] [Plugin] Incorrect target api when executing custom actions. 0.4.6 (2023-09-03) ------------------------------------------------------------------------ diff --git a/src/openrct2/scripting/ScriptEngine.cpp b/src/openrct2/scripting/ScriptEngine.cpp index c064ca486d..c2626a4ae7 100644 --- a/src/openrct2/scripting/ScriptEngine.cpp +++ b/src/openrct2/scripting/ScriptEngine.cpp @@ -1069,7 +1069,7 @@ GameActions::Result ScriptEngine::QueryOrExecuteCustomGameAction(const CustomAct } std::vector pluginCallArgs; - if (GetTargetAPIVersion() <= API_VERSION_68_CUSTOM_ACTION_ARGS) + if (customActionInfo.Owner->GetTargetAPIVersion() <= API_VERSION_68_CUSTOM_ACTION_ARGS) { pluginCallArgs = { *dukArgs }; }