From 1da8e341c57822a7ed7a8822d9a05416fab7e1fd Mon Sep 17 00:00:00 2001 From: lisyarus Date: Mon, 20 May 2024 16:43:11 +0300 Subject: [PATCH] Trigger constructors when cloning an ecs entity --- libs/ecs/source/container.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/ecs/source/container.cpp b/libs/ecs/source/container.cpp index 6fe56039..067e8416 100644 --- a/libs/ecs/source/container.cpp +++ b/libs/ecs/source/container.cpp @@ -47,11 +47,14 @@ namespace psemek::ecs if (table->get_iteration_data()) table = table->get_delayed_table(); - auto id = entity_list_.create(table, table->row_count()); + auto row = table->row_count(); + auto id = entity_list_.create(table, row); handle handle{id, entity_list_.get_entities()[id].epoch}; table->copy_row(handle, data.table, data.row); + table->trigger_constructors(*this, row); + return handle; }