From f739cca1f4088f867dc07bbdc11f0297ba46b88f Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 26 Dec 2021 18:48:29 +0100 Subject: [PATCH] Now the added resource's rect gets recalculated on add_content() instead in create_content() --- .../world_generator/resources/world_gen_world.gd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/game/addons/world_generator/resources/world_gen_world.gd b/game/addons/world_generator/resources/world_gen_world.gd index a9a6e7e2..8cd8796c 100644 --- a/game/addons/world_generator/resources/world_gen_world.gd +++ b/game/addons/world_generator/resources/world_gen_world.gd @@ -13,17 +13,17 @@ func set_content(arr : Array) -> void: func create_content(item_name : String = "") -> void: var continent : Continent = Continent.new() continent.resource_name = item_name - + + add_content(continent) + +func add_content(entry : WorldGenBaseResource) -> void: var r : Rect2 = get_rect() r.position = Vector2() r.size.x /= 10.0 r.size.y /= 10.0 - continent.set_rect(r) + entry.set_rect(r) - add_content(continent) - -func add_content(entry : WorldGenBaseResource) -> void: continents.append(entry) emit_changed()