1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2025-12-10 06:52:05 +01:00

Fix #14863: [Script] Improve documentation for GetAPIVersion (#14877)

This commit is contained in:
Charles Pigott
2025-12-07 16:55:41 +00:00
committed by GitHub
parent 0ef15fa991
commit 0bf3de7658

View File

@@ -154,23 +154,23 @@ public:
string CreateInstance();
/**
* Gets the API version this Script is written for. If this function
* does not exist API compatibility with version 0.7 is assumed.
* Gets the API version this Script is written for.
*
* If the function returns something OpenTTD does not understand,
* for example a newer version or a string that is not a version,
* the Script will not be loaded.
*
* Although in the future we might need to make a separate
* compatibility 'wrapper' for a specific version of OpenTTD, for
* example '0.7.1', we will use only the major and minor number
* and not the bugfix number as valid return for this function.
* Valid return values are string representations of the major part
* of the OpenTTD version string (and "<major>.<minor>" prior version 12)
* Some examples:
* - "0.7" (the first valid AI version)
* - "1.2" (the first valid GS version)
* - "1.11" (last major.minor version)
* - "12" (first major-only version)
* - "15"
*
* Valid return values are:
* - "0.7" (for AI only)
* - "1.0" (for AI only)
* - "1.1" (for AI only)
* - "1.2" (for both AI and GS)
* - "1.3" (for both AI and GS)
* This function must exist for GS but for historical reasons AI that
* do not set it will assume API compatibility version "0.7".
*
* @return The version this Script is compatible with.
*/