Bugfix in ecs entity creation in case a table with the same components but in a different order already exists
This commit is contained in:
parent
72508eb445
commit
c0668e2de2
1 changed files with 3 additions and 3 deletions
|
|
@ -12,7 +12,7 @@ namespace psemek::ecs::detail
|
|||
struct table_container
|
||||
{
|
||||
template <typename ... Components>
|
||||
std::pair<table_impl<Components...> *, bool> insert(component_mask const & mask, util::span<util::uuid const> component_uuids);
|
||||
std::pair<table *, bool> insert(component_mask const & mask, util::span<util::uuid const> component_uuids);
|
||||
|
||||
template <typename Function>
|
||||
void apply(Function && function, component_mask const & mask);
|
||||
|
|
@ -22,7 +22,7 @@ namespace psemek::ecs::detail
|
|||
};
|
||||
|
||||
template <typename ... Components>
|
||||
std::pair<table_impl<Components...> *, bool> table_container::insert(component_mask const & mask, util::span<util::uuid const> component_uuids)
|
||||
std::pair<table *, bool> table_container::insert(component_mask const & mask, util::span<util::uuid const> component_uuids)
|
||||
{
|
||||
auto & result = tables_[mask];
|
||||
bool created = false;
|
||||
|
|
@ -31,7 +31,7 @@ namespace psemek::ecs::detail
|
|||
result = std::make_unique<table_impl<Components...>>(component_uuids);
|
||||
created = true;
|
||||
}
|
||||
return {static_cast<table_impl<Components...> *>(result.get()), created};
|
||||
return {result.get(), created};
|
||||
}
|
||||
|
||||
template <typename Function>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue