mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
commit
4511a68a2b
@ -31,7 +31,7 @@
|
|||||||
-- @image OPS_CSAR.jpg
|
-- @image OPS_CSAR.jpg
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Last Update April 2024
|
-- Last Update July 2024
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
--- **CSAR** class, extends Core.Base#BASE, Core.Fsm#FSM
|
--- **CSAR** class, extends Core.Base#BASE, Core.Fsm#FSM
|
||||||
@ -296,7 +296,7 @@ CSAR.AircraftType["OH58D"] = 2
|
|||||||
|
|
||||||
--- CSAR class version.
|
--- CSAR class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
CSAR.version="1.0.24"
|
CSAR.version="1.0.25"
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- ToDo list
|
-- ToDo list
|
||||||
@ -2111,12 +2111,12 @@ function CSAR:_AddMedevacMenuItem()
|
|||||||
local coalition = self.coalition
|
local coalition = self.coalition
|
||||||
local allheligroupset = self.allheligroupset -- Core.Set#SET_GROUP
|
local allheligroupset = self.allheligroupset -- Core.Set#SET_GROUP
|
||||||
local _allHeliGroups = allheligroupset:GetSetObjects()
|
local _allHeliGroups = allheligroupset:GetSetObjects()
|
||||||
|
|
||||||
-- rebuild units table
|
-- rebuild units table
|
||||||
local _UnitList = {}
|
local _UnitList = {}
|
||||||
for _key, _group in pairs (_allHeliGroups) do
|
for _key, _group in pairs (_allHeliGroups) do
|
||||||
local _unit = _group:GetUnit(1) -- Asume that there is only one unit in the flight for players
|
local _unit = _group:GetFirstUnitAlive() -- Asume that there is only one unit in the flight for players
|
||||||
if _unit then
|
if _unit then
|
||||||
|
--self:T("Unitname ".._unit:GetName().." IsAlive "..tostring(_unit:IsAlive()).." IsPlayer "..tostring(_unit:IsPlayer()))
|
||||||
if _unit:IsAlive() and _unit:IsPlayer() then
|
if _unit:IsAlive() and _unit:IsPlayer() then
|
||||||
local unitName = _unit:GetName()
|
local unitName = _unit:GetName()
|
||||||
_UnitList[unitName] = unitName
|
_UnitList[unitName] = unitName
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
-- @module Ops.CTLD
|
-- @module Ops.CTLD
|
||||||
-- @image OPS_CTLD.jpg
|
-- @image OPS_CTLD.jpg
|
||||||
|
|
||||||
-- Last Update April 2024
|
-- Last Update July 2024
|
||||||
|
|
||||||
do
|
do
|
||||||
|
|
||||||
@ -1255,7 +1255,7 @@ CTLD.UnitTypeCapabilities = {
|
|||||||
|
|
||||||
--- CTLD class version.
|
--- CTLD class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
CTLD.version="1.0.54"
|
CTLD.version="1.0.55"
|
||||||
|
|
||||||
--- Instantiate a new CTLD.
|
--- Instantiate a new CTLD.
|
||||||
-- @param #CTLD self
|
-- @param #CTLD self
|
||||||
@ -3670,7 +3670,7 @@ function CTLD:_RefreshF10Menus()
|
|||||||
-- rebuild units table
|
-- rebuild units table
|
||||||
local _UnitList = {}
|
local _UnitList = {}
|
||||||
for _key, _group in pairs (PlayerTable) do
|
for _key, _group in pairs (PlayerTable) do
|
||||||
local _unit = _group:GetUnit(1) -- Wrapper.Unit#UNIT Asume that there is only one unit in the flight for players
|
local _unit = _group:GetFirstUnitAlive() -- Wrapper.Unit#UNIT Asume that there is only one unit in the flight for players
|
||||||
if _unit then
|
if _unit then
|
||||||
if _unit:IsAlive() and _unit:IsPlayer() then
|
if _unit:IsAlive() and _unit:IsPlayer() then
|
||||||
if _unit:IsHelicopter() or (self:IsHercules(_unit) and self.enableHercules) then --ensure no stupid unit entries here
|
if _unit:IsHelicopter() or (self:IsHercules(_unit) and self.enableHercules) then --ensure no stupid unit entries here
|
||||||
|
|||||||
@ -2745,7 +2745,7 @@ do -- Players
|
|||||||
local PlayerNames = {}
|
local PlayerNames = {}
|
||||||
|
|
||||||
local Units = self:GetUnits()
|
local Units = self:GetUnits()
|
||||||
for UnitID, UnitData in pairs( Units ) do
|
for UnitID, UnitData in pairs( Units or {}) do
|
||||||
local Unit = UnitData -- Wrapper.Unit#UNIT
|
local Unit = UnitData -- Wrapper.Unit#UNIT
|
||||||
local PlayerName = Unit:GetPlayerName()
|
local PlayerName = Unit:GetPlayerName()
|
||||||
if PlayerName and PlayerName ~= "" then
|
if PlayerName and PlayerName ~= "" then
|
||||||
|
|||||||
@ -447,7 +447,14 @@ function UNIT:IsPlayer()
|
|||||||
-- Units of template group.
|
-- Units of template group.
|
||||||
local template = group:GetTemplate()
|
local template = group:GetTemplate()
|
||||||
|
|
||||||
if (template == nil) or (template.units == nil ) then return false end
|
if (template == nil) or (template.units == nil ) then
|
||||||
|
local DCSObject = self:GetDCSObject()
|
||||||
|
if DCSObject then
|
||||||
|
if DCSObject:getPlayerName() ~= nil then return true else return false end
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local units=template.units
|
local units=template.units
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user