registry: non-const try_get doesn't create pools anymore

This commit is contained in:
Michele Caini
2021-03-26 09:34:27 +01:00
parent bd648c0745
commit 85bff4525a

View File

@@ -861,8 +861,7 @@ public:
ENTT_ASSERT(valid(entity));
if constexpr(sizeof...(Component) == 1) {
auto *cpool = assure<Component...>();
return cpool->contains(entity) ? &cpool->get(entity) : nullptr;
return (const_cast<Component *>(std::as_const(*this).template try_get<Component>(entity)), ...);
} else {
return std::make_tuple(try_get<Component>(entity)...);
}