Move pm_refresh check to function
This commit is contained in:
parent
290af757e9
commit
3db9cded3e
20
script.lua
20
script.lua
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user