mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Merge pull request #1505 from Applevangelist/revert-1491-patch-83
Revert "Update Group.lua"
This commit is contained in:
commit
235e40cb26
@ -2169,40 +2169,6 @@ function GROUP:GetThreatLevel()
|
|||||||
return threatlevelMax
|
return threatlevelMax
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get the unit in the group with the highest threat level, which is still alive.
|
|
||||||
-- @param #GROUP self
|
|
||||||
-- @return Wrapper.Unit#UNIT The most dangerous unit in the group.
|
|
||||||
-- @return #number Threat level of the unit.
|
|
||||||
function GROUP:GetHighestThreat()
|
|
||||||
|
|
||||||
-- Get units of the group.
|
|
||||||
local units=self:GetUnits()
|
|
||||||
|
|
||||||
if units then
|
|
||||||
|
|
||||||
local threat=nil ; local maxtl=0
|
|
||||||
for _,_unit in pairs(units or {}) do
|
|
||||||
local unit=_unit --Wrapper.Unit#UNIT
|
|
||||||
|
|
||||||
if unit and unit:IsAlive() then
|
|
||||||
|
|
||||||
-- Threat level of group.
|
|
||||||
local tl=unit:GetThreatLevel()
|
|
||||||
|
|
||||||
-- Check if greater the current threat.
|
|
||||||
if tl>maxtl then
|
|
||||||
maxtl=tl
|
|
||||||
threat=unit
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return threat, maxtl
|
|
||||||
end
|
|
||||||
|
|
||||||
return nil, nil
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
--- Returns true if the first unit of the GROUP is in the air.
|
--- Returns true if the first unit of the GROUP is in the air.
|
||||||
-- @param Wrapper.Group#GROUP self
|
-- @param Wrapper.Group#GROUP self
|
||||||
@ -2585,23 +2551,6 @@ do -- Players
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- GROUND - Switch on/off radar emissions
|
|
||||||
-- @param #GROUP self
|
|
||||||
-- @param #boolean switch
|
|
||||||
function GROUP:EnableEmission(switch)
|
|
||||||
self:F2( self.GroupName )
|
|
||||||
local switch = switch or false
|
|
||||||
|
|
||||||
local DCSUnit = self:GetDCSObject()
|
|
||||||
|
|
||||||
if DCSUnit then
|
|
||||||
|
|
||||||
DCSUnit:enableEmission(switch)
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
--do -- Smoke
|
--do -- Smoke
|
||||||
--
|
--
|
||||||
----- Signal a flare at the position of the GROUP.
|
----- Signal a flare at the position of the GROUP.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user