Browse Source

tools: fix resource path

Daniele Bartolini 5 years ago
parent
commit
46433216be
1 changed files with 3 additions and 2 deletions
  1. 3 2
      tools/level_editor/project.vala

+ 3 - 2
tools/level_editor/project.vala

@@ -95,12 +95,13 @@ public class Project
 	/// Loads the unit @a name and all its prefabs recursively into the database.
 	/// Loads the unit @a name and all its prefabs recursively into the database.
 	public void load_unit(string name)
 	public void load_unit(string name)
 	{
 	{
+		string resource_path = name + ".unit";
+
 		// If the unit is already loaded.
 		// If the unit is already loaded.
-		if (_database.has_property(GUID_ZERO, name))
+		if (_database.has_property(GUID_ZERO, resource_path))
 			return;
 			return;
 
 
 		// Try to load from toolchain directory first.
 		// Try to load from toolchain directory first.
-		string resource_path = name + ".unit";
 		string path = Path.build_filename(toolchain_dir(), resource_path);
 		string path = Path.build_filename(toolchain_dir(), resource_path);
 		if (!File.new_for_path(path).query_exists())
 		if (!File.new_for_path(path).query_exists())
 			path = Path.build_filename(source_dir(), resource_path);
 			path = Path.build_filename(source_dir(), resource_path);