fix bug saving multiple entities
This commit is contained in:
parent
1fc6abb5f3
commit
a47d4c2040
|
@ -37,7 +37,11 @@ func update_house():
|
||||||
var new_room = Store.house.rooms[index]
|
var new_room = Store.house.rooms[index]
|
||||||
create_room(new_room.name, 0)
|
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)
|
var entity_instance = create_entity_in(entity.id, entity.room)
|
||||||
|
|
||||||
if entity_instance == null:
|
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)
|
room.get_node("Entities").add_child(entity)
|
||||||
entity.global_position = room.get_aabb().position + room.get_aabb().size / 2.0
|
entity.global_position = room.get_aabb().position + room.get_aabb().size / 2.0
|
||||||
|
|
||||||
save_all_entities()
|
|
||||||
|
|
||||||
return entity
|
return entity
|
||||||
|
|
||||||
func update_mini_view():
|
func update_mini_view():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user