From 3db90ed6122973eb2583629446cb39785f940fb2 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 3 Mar 2024 19:08:20 +0100 Subject: [PATCH] Optimize/change version checking --- src/core.gd | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/core.gd b/src/core.gd index 50d3f9a..311acf8 100644 --- a/src/core.gd +++ b/src/core.gd @@ -57,7 +57,7 @@ var custom_modules_node: Node # Preinitialization func _init(new_config: CoreConfiguration = CoreConfiguration.new()) -> void: name = "CORE" - if !check_godot_version(): queue_free() + if !check_godot_version(): return if !determine_basepath(): queue_free() custom_modules_node = Node.new() reload_configuration(new_config) @@ -270,12 +270,16 @@ func check_godot_version() -> bool: match(version["major"]): 4: pass _: - assert(true, "The CORE Framework does not support Godot versions older or newer than 4.x.x") - return true + printerr("The CORE Framework does not support Godot versions older or newer than 4.x.x") + return false match(version["minor"]): - 0: print("The CORE Framework does not support Godot versions older than 4.2.x. Please update to Godot 4.2.x to ensure full compatibility.") - 1: print("The CORE Framework does not support Godot versions older than 4.2.x. Please update to Godot 4.2.x to ensure full compatibility.") + 0: printerr("The CORE Framework does not support Godot versions older than 4.2.x. Please update to Godot 4.2.x to ensure full compatibility.") + 1: printerr("The CORE Framework does not support Godot versions older than 4.2.x. Please update to Godot 4.2.x to ensure full compatibility.") 2: pass - _: print("The CORE Framework does not support Godot versions newer than 4.2.x. Please downgrade to Godot 4.2.x to ensure full compatibility.") - if version["status"] != "stable": print("The CORE Framework does not support unstable Godot versions. Please switch to Godot stable 4.2.1 to ensure full compatibility.") + _: + printerr("The CORE Framework does not support Godot versions newer than 4.2.x. Please downgrade to Godot 4.2.x.") + return false + if version["status"] != "stable": + printerr("The CORE Framework does not support unstable Godot versions. Please switch to Godot stable 4.2.x.") + return false return true