| 2146 | } |
| 2147 | |
| 2148 | int32_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 |
no test coverage detected