remove/clear/multi_remove return success for dead entities now

This commit is contained in:
BlackMATov
2025-01-30 09:18:24 +07:00
parent 5ef3bd78c3
commit f6952cc970
2 changed files with 8 additions and 6 deletions
+5 -3
View File
@@ -2587,7 +2587,7 @@ do
end)
:on_remove(function(e, f, c)
f2_remove_count = f2_remove_count + 1
assert(evo.is_alive(e))
assert(evo.get(e, f) == nil)
assert(evo.is_alive(f))
assert(c == 82)
end)
@@ -5065,11 +5065,13 @@ do
assert(not evo.set(e, f1, 11))
assert(not evo.assign(e, f1, 11))
assert(not evo.insert(e, f1, 11))
assert(evo.remove(e, f1))
assert(evo.clear(e))
assert(not evo.multi_set(e, { f1 }, { 11 }))
assert(not evo.multi_assign(e, { f1 }, { 11 }))
assert(not evo.multi_insert(e, { f1 }, { 11 }))
assert(not evo.multi_remove(e, { f1 }))
assert(evo.multi_remove(e, { f1 }))
end
do
@@ -5080,7 +5082,7 @@ do
assert(evo.set(e, f1, 11))
assert(evo.clear(e) and evo.clear(e))
assert(evo.destroy(e) and evo.destroy(e))
assert(not evo.clear(e))
assert(evo.clear(e))
end
do
+3 -3
View File
@@ -3908,7 +3908,7 @@ function evolved.remove(entity, ...)
local entity_index = entity % 0x100000
if __freelist_ids[entity_index] ~= entity then
return false, false
return true, false
end
local entity_chunks = __entity_chunks
@@ -4007,7 +4007,7 @@ function evolved.clear(entity)
local entity_index = entity % 0x100000
if __freelist_ids[entity_index] ~= entity then
return false, false
return true, false
end
local entity_chunks = __entity_chunks
@@ -4533,7 +4533,7 @@ function evolved.multi_remove(entity, fragments)
local entity_index = entity % 0x100000
if __freelist_ids[entity_index] ~= entity then
return false, false
return true, false
end
local entity_chunks = __entity_chunks