changed tick behavior again

This commit is contained in:
Redo 2020-04-22 19:41:33 -05:00
parent ce22e04ec7
commit 44a32017e3

View File

@ -15,6 +15,7 @@ OPT_TICK_ENABLED = true
OPT_TICK_TIME = 0.001
OPT_FX_UPDATES = true
OPT_FX_TIME = 0.03
OPT_TICK_INF = 13
local tickdelay = 0
local ticksperinterval = 0
@ -295,18 +296,23 @@ while 1 do
if time-lastticktime >= OPT_TICK_TIME then
lastticktime = time
sim:tick()
ticks = ticks+1
if OPT_TICK_TIME==0 then
for i = 1, OPT_TICK_INF do
sim:tick()
end
ticks = ticks+OPT_TICK_INF
else
sim:tick()
ticks = ticks+1
end
local sleeptime = time-os.clock()+OPT_TICK_TIME-0.03
local sleeptime = time+OPT_TICK_TIME-os.clock()-0.03
if sleeptime>0 then socket.sleep(sleeptime) end
end
else
socket.sleep(0.05)
end
lastticktime = time
if time-lastfxtime >= OPT_FX_TIME then
sim:sendfxupdate()
sim:sendcallbacks()