mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
OPS
**CHIEF** - Added resources as parameters to `:AddStrategicZone` function **COMMANDER** - Added function to relocate cohorts `:RelocateCohort` **AUFTRAG** - Added new type `AIRDEFENSE` - Added new type `EWR` - Added option to teleport assets to the mission ingress waypoint via `:SetTeleport` - Added `:SetRequiredAttribute` and `:SetRequiredProperty` functions - Added `:SetEmission` function **LEGION** - Fixed bug that assets on GCI dont get additional score for INTERCEPT missions - Assets on ONGUARD or PATROLZONE are not considered for ARTY and GROUNDATTACK missions - Added option for transport to `RelocateCohort` function - Ground/naval assets now automatically return when out of ammo **OPSGROUP** - Immobile groups are teleported to mission ingress point **RECOVERYTANKER** - Added parameter to set TACAN mode/band (e.g. "X") **GROUP** - Fixed bug in `:GetSpeedMax` function **BEACON** - Allowed TACAN "X" mode for AA
This commit is contained in:
@@ -529,26 +529,32 @@ function GROUP:HasAttribute(attribute, all)
|
||||
-- Get all units of the group.
|
||||
local _units=self:GetUnits()
|
||||
|
||||
local _allhave=true
|
||||
local _onehas=false
|
||||
if _units then
|
||||
|
||||
for _,_unit in pairs(_units) do
|
||||
local _unit=_unit --Wrapper.Unit#UNIT
|
||||
if _unit then
|
||||
local _hastit=_unit:HasAttribute(attribute)
|
||||
if _hastit==true then
|
||||
_onehas=true
|
||||
else
|
||||
_allhave=false
|
||||
end
|
||||
end
|
||||
local _allhave=true
|
||||
local _onehas=false
|
||||
|
||||
for _,_unit in pairs(_units) do
|
||||
local _unit=_unit --Wrapper.Unit#UNIT
|
||||
if _unit then
|
||||
local _hastit=_unit:HasAttribute(attribute)
|
||||
if _hastit==true then
|
||||
_onehas=true
|
||||
else
|
||||
_allhave=false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if all==true then
|
||||
return _allhave
|
||||
else
|
||||
return _onehas
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if all==true then
|
||||
return _allhave
|
||||
else
|
||||
return _onehas
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
--- Returns the maximum speed of the group.
|
||||
@@ -563,16 +569,19 @@ function GROUP:GetSpeedMax()
|
||||
|
||||
local Units=self:GetUnits()
|
||||
|
||||
local speedmax=0
|
||||
local speedmax=nil
|
||||
|
||||
for _,unit in pairs(Units) do
|
||||
local unit=unit --Wrapper.Unit#UNIT
|
||||
|
||||
local speed=unit:GetSpeedMax()
|
||||
if speedmax==0 then
|
||||
speedmax=speed
|
||||
elseif speed<speedmax then
|
||||
|
||||
if speedmax==nil or speed<speedmax then
|
||||
speedmax=speed
|
||||
end
|
||||
|
||||
--env.info(string.format("FF unit %s: speed=%.1f, speedmax=%.1f", unit:GetName(), speed, speedmax))
|
||||
|
||||
end
|
||||
|
||||
return speedmax
|
||||
|
||||
Reference in New Issue
Block a user