Mod API Reference:IsVersionOrHigher
Jump to navigation
Jump to search
WL.IsVersionOrHigher: A function that can be called to determine what version of the Warzone code is running. It takes a single argument, a string, that identifies what version to compare to, and returns a boolean.
This should be used whenever you are using an API feature that says it was added in a specific version to verify that the feature is available. For example, if a feature says it was added in version 5.34, you could check like this:
if (not WL.IsVersionOrHigher("5.34")) then UI.Alert("You must update your app to the latest version to use this mod"); return; end
Note that the Warzone server can be assumed to always be running the latest version of Warzone code. However, in single-player games, the Server_ hooks are invoked on the client, so you can't assume that you're always in the latest version of the code just because you're in a server hook.