walder/Skynet-IADS

Issue with mist schedule function

Closed this issue · 2 comments

One thing I did notice, tho was I kept getting the same error over and over in the logs. It didn't seem to affect the script, tho:

[CODE]2020-02-25 00:13:58.136 ERROR SCRIPTING: MIST|doScheduledFunctions|1019: Error in scheduled function: $1[string "F:/Data/Under Development/IADS/skynet-iads-compiled.lua"]:1665: attempt to get length of field 'iadsContacts' (a nil value)

most likely here, if needs a ->> if self.iadsContacts and #self.iadsContacts == 0 or somethink like that.

-- special case if no contacts are found by the EW radars, then shut down all the sams, this needs to be tested
if #self.iadsContacts == 0 then
for i= 1, #self.samSites do
local samSite = self.samSites[i]
samSite:clearTargetsInRange()
samSite:goDark()
end
end

fixed shouldn't have been an instance variable