Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Applevangelist 2024-07-14 18:48:44 +02:00
commit 4511a68a2b
4 changed files with 17 additions and 10 deletions

View File

@ -31,7 +31,7 @@
-- @image OPS_CSAR.jpg
---
-- Last Update April 2024
-- Last Update July 2024
-------------------------------------------------------------------------
--- **CSAR** class, extends Core.Base#BASE, Core.Fsm#FSM
@ -296,7 +296,7 @@ CSAR.AircraftType["OH58D"] = 2
--- CSAR class version.
-- @field #string version
CSAR.version="1.0.24"
CSAR.version="1.0.25"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- ToDo list
@ -2111,12 +2111,12 @@ function CSAR:_AddMedevacMenuItem()
local coalition = self.coalition
local allheligroupset = self.allheligroupset -- Core.Set#SET_GROUP
local _allHeliGroups = allheligroupset:GetSetObjects()
-- rebuild units table
local _UnitList = {}
for _key, _group in pairs (_allHeliGroups) do
local _unit = _group:GetUnit(1) -- Asume that there is only one unit in the flight for players
if _unit then
local _unit = _group:GetFirstUnitAlive() -- Asume that there is only one unit in the flight for players
if _unit then
--self:T("Unitname ".._unit:GetName().." IsAlive "..tostring(_unit:IsAlive()).." IsPlayer "..tostring(_unit:IsPlayer()))
if _unit:IsAlive() and _unit:IsPlayer() then
local unitName = _unit:GetName()
_UnitList[unitName] = unitName

View File

@ -24,7 +24,7 @@
-- @module Ops.CTLD
-- @image OPS_CTLD.jpg
-- Last Update April 2024
-- Last Update July 2024
do
@ -1255,7 +1255,7 @@ CTLD.UnitTypeCapabilities = {
--- CTLD class version.
-- @field #string version
CTLD.version="1.0.54"
CTLD.version="1.0.55"
--- Instantiate a new CTLD.
-- @param #CTLD self
@ -3670,7 +3670,7 @@ function CTLD:_RefreshF10Menus()
-- rebuild units table
local _UnitList = {}
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:IsAlive() and _unit:IsPlayer() then
if _unit:IsHelicopter() or (self:IsHercules(_unit) and self.enableHercules) then --ensure no stupid unit entries here

View File

@ -2745,7 +2745,7 @@ do -- Players
local PlayerNames = {}
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 PlayerName = Unit:GetPlayerName()
if PlayerName and PlayerName ~= "" then

View File

@ -447,7 +447,14 @@ function UNIT:IsPlayer()
-- Units of template group.
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