AUTOLASE - added nil check for CanLase()

This commit is contained in:
Applevangelist
2022-02-19 13:26:02 +01:00
parent 6b4975559d
commit 8a3120be39
@@ -674,6 +674,7 @@ end
function AUTOLASE:CanLase(Recce,Unit) function AUTOLASE:CanLase(Recce,Unit)
local canlase = false local canlase = false
-- cooldown? -- cooldown?
if Recce and Recce:IsAlive() == true then
local name = Recce:GetName() local name = Recce:GetName()
local cooldown = self.RecceUnits[name].cooldown and self.forcecooldown local cooldown = self.RecceUnits[name].cooldown and self.forcecooldown
if cooldown then if cooldown then
@@ -694,6 +695,7 @@ function AUTOLASE:CanLase(Recce,Unit)
if distance <= lasedistance and islos then if distance <= lasedistance and islos then
canlase = true canlase = true
end end
end
return canlase return canlase
end end