Fix getEntityAgeMs()
This commit is contained in:
parent
7cd6bcc090
commit
1daf9b541f
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue