mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Autolase - small update on nil check
This commit is contained in:
parent
90dbfb31a6
commit
d4bd57ee70
@ -109,7 +109,7 @@ AUTOLASE = {
|
|||||||
|
|
||||||
--- AUTOLASE class version.
|
--- AUTOLASE class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
AUTOLASE.version = "0.0.10"
|
AUTOLASE.version = "0.0.11"
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
-- Begin Functional.Autolase.lua
|
-- Begin Functional.Autolase.lua
|
||||||
@ -736,20 +736,22 @@ function AUTOLASE:onafterMonitor(From, Event, To)
|
|||||||
local contact = _contact -- Ops.Intelligence#INTEL.Contact
|
local contact = _contact -- Ops.Intelligence#INTEL.Contact
|
||||||
local grp = contact.group
|
local grp = contact.group
|
||||||
local coord = contact.position
|
local coord = contact.position
|
||||||
local reccename = contact.recce
|
local reccename = contact.recce or "none"
|
||||||
local reccegrp = UNIT:FindByName(reccename)
|
local reccegrp = UNIT:FindByName(reccename)
|
||||||
local reccecoord = reccegrp:GetCoordinate()
|
if reccegrp then
|
||||||
local distance = math.floor(reccecoord:Get3DDistance(coord))
|
local reccecoord = reccegrp:GetCoordinate()
|
||||||
local text = string.format("%s of %s | Distance %d km | Threatlevel %d",contact.attribute, contact.groupname, math.floor(distance/1000), contact.threatlevel)
|
local distance = math.floor(reccecoord:Get3DDistance(coord))
|
||||||
report:Add(text)
|
local text = string.format("%s of %s | Distance %d km | Threatlevel %d",contact.attribute, contact.groupname, math.floor(distance/1000), contact.threatlevel)
|
||||||
self:T(text)
|
report:Add(text)
|
||||||
if self.debug then self:I(text) end
|
self:T(text)
|
||||||
lines = lines + 1
|
if self.debug then self:I(text) end
|
||||||
-- sort out groups beyond sight
|
lines = lines + 1
|
||||||
local lasedistance = self:GetLosFromUnit(reccegrp)
|
-- sort out groups beyond sight
|
||||||
if grp:IsGround() and lasedistance >= distance then
|
local lasedistance = self:GetLosFromUnit(reccegrp)
|
||||||
table.insert(groupsbythreat,{contact.group,contact.threatlevel})
|
if grp:IsGround() and lasedistance >= distance then
|
||||||
self.RecceNames[contact.groupname] = contact.recce
|
table.insert(groupsbythreat,{contact.group,contact.threatlevel})
|
||||||
|
self.RecceNames[contact.groupname] = contact.recce
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user