notifications
4n0n 2 years ago
parent 34460ba87c
commit 1254134ac4
  1. 8
      src/Unit/Unit.lua

@ -550,7 +550,7 @@ function Unit:PredictHealth(time)
local x = {} local x = {}
local y = {} local y = {}
if #self.regression_history > 10 then if #self.regression_history > 20 then
table.remove(self.regression_history, 1) table.remove(self.regression_history, 1)
end end
@ -571,7 +571,7 @@ function Unit:PredictTime(percent)
local x = {} local x = {}
local y = {} local y = {}
if #self.regression_history > 10 then if #self.regression_history > 20 then
table.remove(self.regression_history, 1) table.remove(self.regression_history, 1)
end end
@ -594,9 +594,9 @@ function Unit:TimeToDie()
return 0 return 0
end end
local timeto = GetTime() - self:PredictTime(0) local timeto = self:PredictTime(0) - GetTime()
if timeto ~= timeto or timeto == math.huge or timeto < 0 then if timeto ~= timeto or timeto < 0 or timeto == math.huge then
return 0 return 0
end end

Loading…
Cancel
Save