diff --git a/.github/workflows/build-includes.yml b/.github/workflows/build-includes.yml index 15065ba9e..dd1f90e6a 100644 --- a/.github/workflows/build-includes.yml +++ b/.github/workflows/build-includes.yml @@ -47,6 +47,7 @@ jobs: - name: Update apt-get (needed for act docker image) run: | + sudo rm /etc/apt/sources.list.d/microsoft-prod.list sudo apt-get -qq update - name: Install tree diff --git a/Moose Development/Moose/Wrapper/Weapon.lua b/Moose Development/Moose/Wrapper/Weapon.lua index 5c9ebc53d..3e75d8672 100644 --- a/Moose Development/Moose/Wrapper/Weapon.lua +++ b/Moose Development/Moose/Wrapper/Weapon.lua @@ -40,6 +40,7 @@ -- @field #number coalition Coalition ID. -- @field #number country Country ID. -- @field DCS#Desc desc Descriptor table. +-- @field DCS#Desc guidance Missile guidance descriptor. -- @field DCS#Unit launcher Launcher DCS unit. -- @field Wrapper.Unit#UNIT launcherUnit Launcher Unit. -- @field #string launcherName Name of launcher unit. @@ -196,6 +197,9 @@ function WEAPON:New(WeaponObject) if self:IsMissile() and self.desc.missileCategory then self.categoryMissile=self.desc.missileCategory + if self.desc.guidance then + self.guidance = self.desc.guidance + end end -- Get type name. @@ -667,6 +671,26 @@ function WEAPON:IsTorpedo() return self.category==Weapon.Category.TORPEDO end +--- Check if weapon is a Fox One missile (Radar Semi-Active). +-- @param #WEAPON self +-- @return #boolean If `true`, is a Fox One. +function WEAPON:IsFoxOne() + return self.guidance==Weapon.GuidanceType.RADAR_SEMI_ACTIVE +end + +--- Check if weapon is a Fox Two missile (IR guided). +-- @param #WEAPON self +-- @return #boolean If `true`, is a Fox Two. +function WEAPON:IsFoxTwo() + return self.guidance==Weapon.GuidanceType.IR +end + +--- Check if weapon is a Fox Three missile (Radar Active). +-- @param #WEAPON self +-- @return #boolean If `true`, is a Fox Three. +function WEAPON:IsFoxThree() + return self.guidance==Weapon.GuidanceType.RADAR_ACTIVE +end --- Destroy the weapon object. -- @param #WEAPON self