From bd6eab315f01a4a4b1c903ceca95e272b50b54ce Mon Sep 17 00:00:00 2001 From: kalrnlo Date: Sun, 23 Jun 2024 20:40:03 -0400 Subject: [PATCH] Replace 0x10 with ECS_ID_FLAGS_MASK --- lib/init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/init.lua b/lib/init.lua index 1ce09c1..6aa0fe7 100644 --- a/lib/init.lua +++ b/lib/init.lua @@ -104,12 +104,12 @@ end -- HIGH 24 bits LOW 24 bits local function ECS_GENERATION(e: i53): i24 - return if e > ECS_ENTITY_MASK then (e // 0x10) % ECS_GENERATION_MASK else 0 + return if e > ECS_ENTITY_MASK then (e // ECS_ID_FLAGS_MASK) % ECS_GENERATION_MASK else 0 end local function ECS_GENERATION_INC(e: i53) if e > ECS_ENTITY_MASK then - local flags = e // 0x10 + local flags = e // ECS_ID_FLAGS_MASK local id = flags // ECS_ENTITY_MASK local generation = flags % ECS_GENERATION_MASK @@ -121,12 +121,12 @@ end -- FIRST gets the high ID local function ECS_ENTITY_T_HI(e: i53): i24 - return if e > ECS_ENTITY_MASK then (e // 0x10) % ECS_ENTITY_MASK else e + return if e > ECS_ENTITY_MASK then (e // ECS_ID_FLAGS_MASK) % ECS_ENTITY_MASK else e end -- SECOND local function ECS_ENTITY_T_LO(e: i53): i24 - return if e > ECS_ENTITY_MASK then (e // 0x10) // ECS_ENTITY_MASK else e + return if e > ECS_ENTITY_MASK then (e // ECS_ID_FLAGS_MASK) // ECS_ENTITY_MASK else e end local function ECS_PAIR(pred: i53, obj: i53): i53