Fix redundant checks in world_remove (#198)

This commit is contained in:
lolmanurfunny 2025-02-21 12:10:24 -05:00 committed by GitHub
parent 3815c62442
commit 4c5e5e1968
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -899,7 +899,7 @@ local function world_remove(world: World, entity: i53, id: i53)
end
local to = archetype_traverse_remove(world, id, from)
if from and not (from == to) then
if from ~= to then
local idr = world.component_index[id]
local on_remove = idr.hooks.on_remove
if on_remove then