mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-19 22:17:13 +00:00
Refactoring
This commit is contained in:
@@ -1444,21 +1444,12 @@ function CONTROLLABLE:TaskFireAtPoint( Vec2, Radius, AmmoCount, WeaponType )
|
||||
params = {
|
||||
point = Vec2,
|
||||
zoneRadius = Radius,
|
||||
expendQty = 100, -- dummy value
|
||||
expendQtyEnabled = false,
|
||||
expendQty = AmmoCount or 100,
|
||||
expendQtyEnabled = AmmoCount and true or false,
|
||||
weaponType = WeaponType or ENUMS.WeaponFlag.Auto,
|
||||
}
|
||||
}
|
||||
|
||||
if AmmoCount then
|
||||
DCSTask.params.expendQty = AmmoCount
|
||||
DCSTask.params.expendQtyEnabled = true
|
||||
end
|
||||
|
||||
if WeaponType then
|
||||
DCSTask.params.weaponType=WeaponType
|
||||
end
|
||||
|
||||
self:T3( { DCSTask } )
|
||||
return DCSTask
|
||||
end
|
||||
|
||||
|
||||
@@ -602,6 +602,26 @@ function POSITIONABLE:IsGround()
|
||||
end
|
||||
|
||||
|
||||
--- Returns if the unit is of ship category.
|
||||
-- @param #POSITIONABLE self
|
||||
-- @return #boolean Ship category evaluation result.
|
||||
function POSITIONABLE:IsShip()
|
||||
self:F2()
|
||||
|
||||
local DCSUnit = self:GetDCSObject()
|
||||
|
||||
if DCSUnit then
|
||||
local UnitDescriptor = DCSUnit:getDesc()
|
||||
|
||||
local IsShip = ( UnitDescriptor.category == Unit.Category.SHIP )
|
||||
|
||||
return IsShip
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
--- Returns true if the POSITIONABLE is in the air.
|
||||
-- Polymorphic, is overridden in GROUP and UNIT.
|
||||
-- @param Wrapper.Positionable#POSITIONABLE self
|
||||
|
||||
Reference in New Issue
Block a user