From fd94626f1a578f3065a109312136ef7c9ca7fb1c Mon Sep 17 00:00:00 2001 From: Jake Cattrall Date: Mon, 19 Jun 2023 20:49:22 +0100 Subject: [PATCH] handle new path requirements for 4.1 --- addons/tbloader/src/toFgd.gd | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/tbloader/src/toFgd.gd b/addons/tbloader/src/toFgd.gd index 34cebcf..a24fd68 100644 --- a/addons/tbloader/src/toFgd.gd +++ b/addons/tbloader/src/toFgd.gd @@ -56,7 +56,7 @@ func remove_attached_scripts(files): return filtered_files func get_entity_properties(files = []): - var properties = ["// Generated by Godot FGD Generator https://github.com/krazyjakee/godot-fgd\n\n"] + var properties = [] for file in files: if file.ends_with(".gd"): @@ -248,7 +248,11 @@ func build(entities_dir = "entities"): var files = remove_attached_scripts(all_files) # Remove attached scripts var properties = get_entity_properties(files) # Get the properties of each entity - var file = FileAccess.open("Game.fgd", FileAccess.WRITE) + var file = FileAccess.open("res://Game.fgd", FileAccess.WRITE) + if !file: + push_error("Failed to open/create Game.fgd!") + return + for property in properties: if property: file.store_string(property)