Daniele Bartolini 7 éve
szülő
commit
d67a056189
1 módosított fájl, 5 hozzáadás és 8 törlés
  1. 5 8
      tools/level_editor/project.vala

+ 5 - 8
tools/level_editor/project.vala

@@ -373,14 +373,13 @@ end
 
 				SJSON.save(sprite, Path.build_filename(_source_dir.get_path(), resource_name) + ".sprite");
 
-				// Generate .unit
-				string unit_name = Path.build_filename(_source_dir.get_path(), resource_name) + ".unit";
-				File unit_file = File.new_for_path(unit_name);
 
+				// Generate .unit
 				Database db = new Database();
 
 				// Do not overwrite existing .unit
-				if (unit_file.query_exists())
+				string unit_name = Path.build_filename(_source_dir.get_path(), resource_name) + ".unit";
+				if (File.new_for_path(unit_name).query_exists())
 					db.load(unit_name);
 
 				Unit unit = new Unit(db, GUID_ZERO, null);
@@ -649,13 +648,11 @@ end
 				}
 
 				// Generate .unit
-				string unit_name = Path.build_filename(_source_dir.get_path(), resource_name) + ".unit";
-				File unit_file = File.new_for_path(unit_name);
-
 				Database db = new Database();
 
 				// Do not overwrite existing .unit
-				if (unit_file.query_exists())
+				string unit_name = Path.build_filename(_source_dir.get_path(), resource_name) + ".unit";
+				if (File.new_for_path(unit_name).query_exists())
 					db.load(unit_name);
 
 				Unit unit = new Unit(db, GUID_ZERO, null);