MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / GetTargetAPIVersion

Method GetTargetAPIVersion

src/openrct2/scripting/ScriptEngine.cpp:2148–2162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2146}
2147
2148int32_t Scripting::GetTargetAPIVersion()
2149{
2150 auto& scriptEngine = GetContext()->GetScriptEngine();
2151 auto& execInfo = scriptEngine.GetExecInfo();
2152
2153 // Commands from the in-game console do not have a plug-in set
2154 auto plugin = execInfo.GetCurrentPlugin();
2155 if (plugin == nullptr)
2156 {
2157 // For in-game console, default to the current API version
2158 return kPluginApiVersion;
2159 }
2160
2161 return plugin->GetTargetAPIVersion();
2162}
2163
2164#endif

Callers 1

Calls 2

GetContextFunction · 0.85
GetCurrentPluginMethod · 0.80

Tested by

no test coverage detected