Undetected

Check if submarine is undetected

Usage: Used in 2 task(s)

Lua Implementation

-- Undetected
function evaluate(params)
    -- Check if any hostile has us in their contact list
    local allContacts = vrf.getAllSimObjects()

    for _, other in ipairs(allContacts) do
        if other:isValid() and IsHostile{target = other} then
            local theirContacts = other:getContactList()
            for _, contact in ipairs(theirContacts) do
                if contact:getObjectId() == this:getObjectId() then
                    return false
                end
            end
        end
    end

    return true
end