mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
ZCC
- Fixed unit counting in status report.
This commit is contained in:
parent
b91a8cf4c8
commit
431e8a05f9
@ -750,7 +750,7 @@ function ZONE_RADIUS:GetScannedUnits()
|
||||
end
|
||||
|
||||
|
||||
--- Count the number of different coalitions inside the zone.
|
||||
--- Get a set of scanned units.
|
||||
-- @param #ZONE_RADIUS self
|
||||
-- @return Core.Set#SET_UNIT Set of units and statics inside the zone.
|
||||
function ZONE_RADIUS:GetScannedSetUnit()
|
||||
@ -949,7 +949,6 @@ function ZONE_RADIUS:SearchZone( EvaluateFunction, ObjectCategories )
|
||||
|
||||
local function EvaluateZone( ZoneDCSUnit )
|
||||
|
||||
--env.info( ZoneDCSUnit:getName() )
|
||||
|
||||
local ZoneUnit = UNIT:Find( ZoneDCSUnit )
|
||||
|
||||
|
||||
@ -874,16 +874,23 @@ do -- ZONE_CAPTURE_COALITION
|
||||
self:Capture()
|
||||
end
|
||||
|
||||
-- Get red and blue unit sets.
|
||||
local unitsetRed=self:GetScannedSetUnit():FilterCoalitions("red"):FilterActive(true):FilterOnce()
|
||||
local unitsetBlu=self:GetScannedSetUnit():FilterCoalitions("blue"):FilterActive(true):FilterOnce()
|
||||
|
||||
-- Count number of units.
|
||||
local nRed=unitsetRed:Count()
|
||||
local nBlu=unitsetBlu:Count()
|
||||
-- Count stuff in zone.
|
||||
local unitset=self:GetScannedSetUnit()
|
||||
local nRed=0
|
||||
local nBlue=0
|
||||
for _,object in pairs(unitset:GetSet()) do
|
||||
local coal=object:GetCoalition()
|
||||
if object:IsAlive() then
|
||||
if coal==coalition.side.RED then
|
||||
nRed=nRed+1
|
||||
elseif coal==coalition.side.BLUE then
|
||||
nBlue=nBlue+1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Status text.
|
||||
local text=string.format("CAPTURE ZONE %s: Owner=%s (Previous=%s): #blue=%d, #red=%d, Status %s", self:GetZoneName(), self:GetCoalitionName(), UTILS.GetCoalitionName(self:GetPreviousCoalition()), nBlu, nRed, State)
|
||||
local text=string.format("CAPTURE ZONE %s: Owner=%s (Previous=%s): #blue=%d, #red=%d, Status %s", self:GetZoneName(), self:GetCoalitionName(), UTILS.GetCoalitionName(self:GetPreviousCoalition()), nBlue, nRed, State)
|
||||
local NewState = self:GetState()
|
||||
if NewState~=State then
|
||||
text=text..string.format(" --> %s", NewState)
|
||||
|
||||
@ -243,6 +243,10 @@
|
||||
-- 
|
||||
--
|
||||
-- **Note** that the default folder name is *ATIS Soundfiles/*. If you want to change it, you can use the @{#ATIS.SetSoundfilesPath}(*path*), where *path* is the path of the directory. This must end with a slash "/"!
|
||||
--
|
||||
-- # Marks on the F10 Map
|
||||
--
|
||||
-- You can place marks on the F10 map via the @{#ATIS.SetMapMarks}() function. These will contain info about the ATIS frequency, the currently active runway and some basic info about the weather (wind, pressure and temperature).
|
||||
--
|
||||
-- # Examples
|
||||
--
|
||||
|
||||
@ -2380,6 +2380,7 @@ do -- Route methods
|
||||
|
||||
local FromCoordinate = self:GetCoordinate()
|
||||
|
||||
--local FromWP = FromCoordinate:WaypointGround()
|
||||
local FromWP = FromCoordinate:WaypointGround(Speed, Formation)
|
||||
local ToWP = ToCoordinate:WaypointGround( Speed, Formation )
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user