summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-08-16 09:14:16 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-08-16 09:14:16 +0200
commit4ed3f67229d2c8b8dbdc9306e41e22dda7b33889 (patch)
tree1ec4c63b7b231f98a8baf49e94a27de37d1216d0
parentd1b8e9abd618a21daaec56cf4c71e4eedae51910 (diff)
parent97ef4a05369bd68f5ee8397bcc97208c99210ca8 (diff)
downloadredot-engine-4ed3f67229d2c8b8dbdc9306e41e22dda7b33889.tar.gz
Merge pull request #80591 from AThousandShips/compat_ver
Fix version check for GDExtension
-rw-r--r--core/extension/gdextension.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/core/extension/gdextension.cpp b/core/extension/gdextension.cpp
index 67b55db3db..9a735f5aa6 100644
--- a/core/extension/gdextension.cpp
+++ b/core/extension/gdextension.cpp
@@ -607,12 +607,13 @@ Ref<Resource> GDExtensionResourceLoader::load(const String &p_path, const String
}
bool compatible = true;
- if (VERSION_MAJOR < compatibility_minimum[0]) {
- compatible = false;
- } else if (VERSION_MINOR < compatibility_minimum[1]) {
- compatible = false;
- } else if (VERSION_PATCH < compatibility_minimum[2]) {
- compatible = false;
+ // Check version lexicographically.
+ if (VERSION_MAJOR != compatibility_minimum[0]) {
+ compatible = VERSION_MAJOR > compatibility_minimum[0];
+ } else if (VERSION_MINOR != compatibility_minimum[1]) {
+ compatible = VERSION_MINOR > compatibility_minimum[1];
+ } else {
+ compatible = VERSION_PATCH >= compatibility_minimum[2];
}
if (!compatible) {
if (r_error) {