From 52435e62a21d8cb5282f91399196140be1a5f772 Mon Sep 17 00:00:00 2001 From: Ukendio Date: Sat, 26 Apr 2025 00:55:03 +0200 Subject: [PATCH] dense should be set at index --- CHANGELOG.md | 3 ++- jecs.luau | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9725a5a..5773969 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,8 @@ The format is based on [Keep a Changelog][kac], and this project adheres to ## [Unreleased] - `[world]`: - - Added `world:range` to allow for creating + - Added `world:range` to restrict entity range + - Changed `world:entity` to accept the overload to create an entity at the desired index - Changed `world:clear` to also look through the component record for the cleared `ID` - Removes the cleared ID from every entity that has it - Changed entity ID layouts by putting the index in the lower bits, which should make every world function 1-5 nanoseconds faster diff --git a/jecs.luau b/jecs.luau index 764296c..65417e1 100644 --- a/jecs.luau +++ b/jecs.luau @@ -778,6 +778,7 @@ local function world_entity(world: ecs_world_t, entity: i53?): i53 local any = dense_array[dense] if any == entity then if alive_count > dense then + r.dense = dense return entity end local e_swap = dense_array[alive_count]