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())
|
ping.syncState(setLocalState())
|
||||||
end
|
end
|
||||||
|
|
||||||
pm_refresh=false
|
do
|
||||||
function pmRefresh()
|
local pm_refresh=false
|
||||||
pm_refresh=true
|
function pmRefresh()
|
||||||
|
pm_refresh=true
|
||||||
|
end
|
||||||
|
|
||||||
|
function doPmRefresh()
|
||||||
|
if pm_refresh then
|
||||||
|
PartsManager.refreshAll()
|
||||||
|
pm_refresh=false
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function ping.syncState(tbl)
|
function ping.syncState(tbl)
|
||||||
@ -1126,10 +1135,7 @@ function tick()
|
|||||||
animateTick()
|
animateTick()
|
||||||
|
|
||||||
-- Check for queued PartsManager refresh
|
-- Check for queued PartsManager refresh
|
||||||
if pm_refresh then
|
doPmRefresh()
|
||||||
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user