mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
@@ -1433,7 +1433,16 @@ int32_t OpenRCT2::Scripting::GetTargetAPIVersion()
|
||||
{
|
||||
auto& scriptEngine = GetContext()->GetScriptEngine();
|
||||
auto& execInfo = scriptEngine.GetExecInfo();
|
||||
return execInfo.GetCurrentPlugin()->GetTargetAPIVersion();
|
||||
|
||||
// Commands from the in-game console do not have a plug-in set
|
||||
auto plugin = execInfo.GetCurrentPlugin();
|
||||
if (plugin == nullptr)
|
||||
{
|
||||
// For in-game console, default to the current API version
|
||||
return OPENRCT2_PLUGIN_API_VERSION;
|
||||
}
|
||||
|
||||
return plugin->GetTargetAPIVersion();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user