From 8490dfd294a3932f92667671a9666f0ddb1e7da2 Mon Sep 17 00:00:00 2001 From: Ukendio Date: Fri, 6 Jun 2025 00:38:23 +0200 Subject: [PATCH] Prevent partial matching of destroyed archetype --- jecs.luau | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jecs.luau b/jecs.luau index 7531134..798052b 100644 --- a/jecs.luau +++ b/jecs.luau @@ -1934,6 +1934,9 @@ local function query_cached(query: ecs_query_data_t) local function on_delete_callback(archetype) local i = table.find(archetypes, archetype) :: number + if i == nil then + return + end local n = #archetypes archetypes[i] = archetypes[n] archetypes[n] = nil