From f178094762c18c40ba330ba2892157cacd272ed0 Mon Sep 17 00:00:00 2001 From: NullBite Date: Tue, 5 Apr 2022 20:11:29 -0400 Subject: [PATCH] Make pmRefresh run PartsManager in same tick --- script.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/script.lua b/script.lua index e9a85d2..1e720d9 100644 --- a/script.lua +++ b/script.lua @@ -295,8 +295,9 @@ function syncState() ping.syncState(setLocalState()) end +pm_refresh=false function pmRefresh() - rateLimit(1, PartsManager.refreshAll, "refreshAll") + pm_refresh=true end function ping.syncState(tbl) @@ -1126,6 +1127,11 @@ function tick() animateTick() + -- Check for queued PartsManager refresh + if pm_refresh then + PartsManager.refreshAll() + pm_refresh=false + end -- End of tick -- old_state.health=player.getHealth() old_state.color_check=color_check