Open Spikeone opened 2 years ago
Hm, it should I'd say.
I get
Lua error: [string "function getRequiredLuaVersion()..."]:20: attempt to call method 'GetVersion' (a nil value)
When using this simple script:
function getRequiredLuaVersion()
return 1.3
end
function onSettingsReady()
rttr:Log("Version" ..rttr:GetVersion())
end
(Linenumber in my output is from a larger script, but the shown example is a minimalised version)
EDIT:
Ah I see, it's missing in the void LuaInterfaceGameBase::Register(kaguya::State& state)
isnt it? There is a GetFeatureLevel but GetVersion is missing
No I meant we should have it. But I think we replaced it by GetFeatureLevel
.
The idea is: getRequiredLuaVersion
should return an integer(!) which is then checked against the major version: https://github.com/Return-To-The-Roots/s25client/blob/4ce6199a77ebb44b5b14cdc23c0e0a19e41c77ca/libs/s25main/lua/LuaInterfaceGameBase.cpp#L44 as a change there means incompatible changes
GetFeatureLevel
can then be used to check if a function or similar is available already.
Do you get what I mean? Do you mind updating the docs?
Yeah, I get the idea - can do, but you know that means sooner or later I will have a problem with cmake and ask you :D
You should only update the docs. So no CMake involved :D
The documentation references rttr:GetVersion() two times, but this function seems no longer to exist
https://github.com/Return-To-The-Roots/s25client/blob/master/doc/lua/methods.md#base-functions-callable-in-settings-and-game-mode