Move pm_refresh check to function

This commit is contained in:
NullBite 2022-04-05 20:34:35 -04:00
parent 290af757e9
commit 3db9cded3e
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -295,9 +295,18 @@ function syncState()
ping.syncState(setLocalState())
end
pm_refresh=false
function pmRefresh()
pm_refresh=true
do
local pm_refresh=false
function pmRefresh()
pm_refresh=true
end
function doPmRefresh()
if pm_refresh then
PartsManager.refreshAll()
pm_refresh=false
end
end
end
function ping.syncState(tbl)
@ -1126,10 +1135,7 @@ function tick()
animateTick()
-- Check for queued PartsManager refresh
if pm_refresh then
PartsManager.refreshAll()
pm_refresh=false
end
doPmRefresh()
-- End of tick --
old_state.health=player.getHealth()
old_state.color_check=color_check