Fix getEntityAgeMs()

This commit is contained in:
Sage Vaillancourt 2025-03-21 18:58:06 -04:00
parent 7cd6bcc090
commit 1daf9b541f
1 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,7 @@ function tinyDebug.getEntityAgeMs(entity)
if ENTITY_INIT_MS == nil then if ENTITY_INIT_MS == nil then
error("trackEntityAges() has not been enabled!") error("trackEntityAges() has not been enabled!")
end end
return entity[ENTITY_INIT_MS] return getCurrentTimeMilliseconds() - entity[ENTITY_INIT_MS]
end end
function tinyDebug.warnWhenNonDataOnEntities() function tinyDebug.warnWhenNonDataOnEntities()
@ -87,7 +87,7 @@ end
function tinyDebug.throwOnUnusedEntities() function tinyDebug.throwOnUnusedEntities()
---@return boolean ---@return boolean
local function entityMatchesASystem(world, entity) local function entityMatchesSomeSystem(world, entity)
local systems = world.systems local systems = world.systems
for i = 1, #systems do for i = 1, #systems do
local system = systems[i] local system = systems[i]
@ -106,7 +106,7 @@ function tinyDebug.throwOnUnusedEntities()
local el = world.entities local el = world.entities
for i = 1, #el do for i = 1, #el do
if not entityMatchesASystem(world, el[i]) then if not entityMatchesSomeSystem(world, el[i]) then
unmatchedEntities[#unmatchedEntities + 1] = el[i] unmatchedEntities[#unmatchedEntities + 1] = el[i]
end end
end end