assert (has) on replace for empty components
This commit is contained in:
@@ -121,6 +121,7 @@ class basic_registry {
|
||||
template<typename... Args>
|
||||
decltype(auto) replace(basic_registry ®istry, const Entity entt, Args &&... args) {
|
||||
if constexpr(std::is_empty_v<Component>) {
|
||||
assert((storage<Entity, Component>::has(entt)));
|
||||
on_replace.publish(registry, entt, Component{});
|
||||
return Component{std::forward<Args>(args)...};
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user