destroy without exceptions

This commit is contained in:
BlackMATov
2024-11-24 10:45:49 +07:00
parent 6749ed4fb4
commit 5ee7745759
3 changed files with 26 additions and 5 deletions
+22
View File
@@ -31,6 +31,28 @@ do
assert(not e:remove())
end
do
local f1, f2 =
evo.registry.entity(),
evo.registry.entity()
local e = evo.registry.entity()
assert(e:insert(f1))
assert(e:insert(f2))
assert(e:is_alive())
assert(e.__chunk == evo.registry.chunk(f1, f2))
assert(e:destroy())
assert(not e:is_alive())
assert(e.__chunk == nil)
assert(not e:destroy())
assert(not e:is_alive())
assert(e.__chunk == nil)
end
do
local f1, f2, f3, f4, f5 =
evo.registry.entity(),