Make pmRefresh run PartsManager in same tick

This commit is contained in:
NullBite 2022-04-05 20:11:29 -04:00
parent 111384703e
commit f178094762
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -295,8 +295,9 @@ function syncState()
ping.syncState(setLocalState()) ping.syncState(setLocalState())
end end
pm_refresh=false
function pmRefresh() function pmRefresh()
rateLimit(1, PartsManager.refreshAll, "refreshAll") pm_refresh=true
end end
function ping.syncState(tbl) function ping.syncState(tbl)
@ -1126,6 +1127,11 @@ function tick()
animateTick() animateTick()
-- Check for queued PartsManager refresh
if pm_refresh then
PartsManager.refreshAll()
pm_refresh=false
end
-- End of tick -- -- End of tick --
old_state.health=player.getHealth() old_state.health=player.getHealth()
old_state.color_check=color_check old_state.color_check=color_check