Skip to content

Commit

Permalink
Fix version check for GDExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
AThousandShips committed Aug 15, 2023
1 parent c495eb5 commit 97ef4a0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions core/extension/gdextension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 97ef4a0

Please sign in to comment.