summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorNinni Pipping <over999ships@gmail.com>2023-08-13 16:13:57 +0200
committerNinni Pipping <over999ships@gmail.com>2023-08-15 10:10:04 +0200
commit97ef4a05369bd68f5ee8397bcc97208c99210ca8 (patch)
tree0e2d87e7da11910c9ba6e2e073f1c693b88b8e16 /core
parentc495eb5102278a110c14bbffbf833ed436d1594d (diff)
downloadredot-engine-97ef4a05369bd68f5ee8397bcc97208c99210ca8.tar.gz
Fix version check for GDExtension
Diffstat (limited to 'core')
-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) {