-
-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Can get negative sizes when despawning and then immediately spawning within the same commit commands.
This is caused by the spawnAt functionality:
if not willBeDeleted then
self._size += 1
end
executeDespawn will still occur even if a later spawnAt command it executed, and executeDespawn will always decrement the _size by 1, even if markedForDeletion is no longer set.
Steps to reproduce
world:commitCommands()
world:spawnAt(1)
world:commitCommands()
world:despawn(1)
world:spawnAt(1)
world:commitCommands()
world:despawn(1)
world:spawnAt(1)
world:commitCommands()
world:despawn(1)
world:spawnAt(1)
world:commitCommands()
print(world:size())
Expected behavior
Keep the appropriate _size value.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working