fix bug saving multiple entities

This commit is contained in:
Nitwel 2024-01-28 17:37:26 +01:00
parent 1fc6abb5f3
commit a47d4c2040

View File

@ -37,7 +37,11 @@ func update_house():
var new_room = Store.house.rooms[index]
create_room(new_room.name, 0)
for entity in Store.house.entities:
print(Store.house.entities)
for entity_index in range(Store.house.entities.size()):
var entity = Store.house.entities[entity_index]
var entity_instance = create_entity_in(entity.id, entity.room)
if entity_instance == null:
@ -174,8 +178,6 @@ func create_entity_in(entity_id: String, room_name: String):
room.get_node("Entities").add_child(entity)
entity.global_position = room.get_aabb().position + room.get_aabb().size / 2.0
save_all_entities()
return entity
func update_mini_view():