Дизайнер
-
Автор темы
- #1
Код:
local TIMETOTICKS = function(time) return math.floor(time / globals.tickinterval + .5) end
local is_defensive do
local activity = 0
is_defensive = function (me)
local net_channel, simtime = utils.net_channel(), me:get_simulation_time()
local difference = TIMETOTICKS(simtime.current - simtime.old)
if difference < 0 then
activity = globals.tickcount + math.abs(difference) - TIMETOTICKS(net_channel.latency[0])
end
return activity > globals.tickcount
end
end
Последнее редактирование: