From 985282ba555a24d53f4d4f0992c29daf715f9dd6 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Wed, 20 Mar 2019 18:03:24 +0100 Subject: [PATCH] Debug --- Moose Development/Moose/Wrapper/Group.lua | 3 +++ Moose Development/Moose/Wrapper/Unit.lua | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index a790deddd..afe7667f2 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -2107,8 +2107,11 @@ do -- Players local PlayerNames = {} + self:F({Group = self:GetName()}) + local Units = self:GetUnits() for UnitID, UnitData in pairs( Units ) do + self:F({UnitData:GetName()}) local Unit = UnitData -- Wrapper.Unit#UNIT local PlayerName = Unit:GetPlayerName() if PlayerName and PlayerName ~= "" then diff --git a/Moose Development/Moose/Wrapper/Unit.lua b/Moose Development/Moose/Wrapper/Unit.lua index 91d157515..51b5f2ecb 100644 --- a/Moose Development/Moose/Wrapper/Unit.lua +++ b/Moose Development/Moose/Wrapper/Unit.lua @@ -324,13 +324,16 @@ end -- @return #string Player Name -- @return #nil The DCS Unit is not existing or alive. function UNIT:GetPlayerName() - self:F2( self.UnitName ) + self:F( self.UnitName ) local DCSUnit = self:GetDCSObject() -- DCS#Unit if DCSUnit then + self:F({self:GetName()}) + local PlayerName = DCSUnit:getPlayerName() + self:F({PlayerName = PlayerName}) -- TODO Workaround DCS-BUG-3 - https://github.com/FlightControl-Master/MOOSE/issues/696 -- if PlayerName == nil or PlayerName == "" then -- local PlayerCategory = DCSUnit:getDesc().category