mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
xx
This commit is contained in:
parent
703589d8e4
commit
b890dc22a3
@ -4748,11 +4748,12 @@ do -- SET_CLIENT
|
||||
local MClientCategory = false
|
||||
for CategoryID, CategoryName in pairs( self.Filter.Categories ) do
|
||||
local ClientCategoryID = _DATABASE:GetCategoryFromClientTemplate( MClientName )
|
||||
local UnitCategory
|
||||
if ClientCategoryID==nil and MClient:IsAlive()~=nil then
|
||||
ClientCategoryID=MClient:GetCategory()
|
||||
ClientCategoryID,UnitCategory=MClient:GetCategory()
|
||||
end
|
||||
self:T3( { "Category:", ClientCategoryID, self.FilterMeta.Categories[CategoryName], CategoryName } )
|
||||
if self.FilterMeta.Categories[CategoryName] and ClientCategoryID and self.FilterMeta.Categories[CategoryName] == ClientCategoryID then
|
||||
self:T3( { "Category:", UnitCategory, self.FilterMeta.Categories[CategoryName], CategoryName } )
|
||||
if self.FilterMeta.Categories[CategoryName] and UnitCategory and self.FilterMeta.Categories[CategoryName] == UnitCategory then
|
||||
MClientCategory = true
|
||||
end
|
||||
end
|
||||
@ -5196,12 +5197,15 @@ do -- SET_PLAYER
|
||||
if MClient then
|
||||
local MClientName = MClient.UnitName
|
||||
|
||||
if self.Filter.Coalitions then
|
||||
if self.Filter.Coalitions and MClientInclude then
|
||||
local MClientCoalition = false
|
||||
for CoalitionID, CoalitionName in pairs( self.Filter.Coalitions ) do
|
||||
local ClientCoalitionID = _DATABASE:GetCoalitionFromClientTemplate( MClientName )
|
||||
if ClientCoalitionID==nil and MClient:IsAlive()~=nil then
|
||||
ClientCoalitionID=MClient:GetCoalition()
|
||||
end
|
||||
self:T3( { "Coalition:", ClientCoalitionID, self.FilterMeta.Coalitions[CoalitionName], CoalitionName } )
|
||||
if self.FilterMeta.Coalitions[CoalitionName] and self.FilterMeta.Coalitions[CoalitionName] == ClientCoalitionID then
|
||||
if self.FilterMeta.Coalitions[CoalitionName] and ClientCoalitionID and self.FilterMeta.Coalitions[CoalitionName] == ClientCoalitionID then
|
||||
MClientCoalition = true
|
||||
end
|
||||
end
|
||||
@ -5209,12 +5213,16 @@ do -- SET_PLAYER
|
||||
MClientInclude = MClientInclude and MClientCoalition
|
||||
end
|
||||
|
||||
if self.Filter.Categories then
|
||||
if self.Filter.Categories and MClientInclude then
|
||||
local MClientCategory = false
|
||||
for CategoryID, CategoryName in pairs( self.Filter.Categories ) do
|
||||
local ClientCategoryID = _DATABASE:GetCategoryFromClientTemplate( MClientName )
|
||||
self:T3( { "Category:", ClientCategoryID, self.FilterMeta.Categories[CategoryName], CategoryName } )
|
||||
if self.FilterMeta.Categories[CategoryName] and self.FilterMeta.Categories[CategoryName] == ClientCategoryID then
|
||||
local UnitCategory
|
||||
if ClientCategoryID==nil and MClient:IsAlive()~=nil then
|
||||
ClientCategoryID,UnitCategory=MClient:GetCategory()
|
||||
end
|
||||
self:T3( { "Category:", UnitCategory, self.FilterMeta.Categories[CategoryName], CategoryName } )
|
||||
if self.FilterMeta.Categories[CategoryName] and UnitCategory and self.FilterMeta.Categories[CategoryName] == UnitCategory then
|
||||
MClientCategory = true
|
||||
end
|
||||
end
|
||||
|
||||
@ -112,19 +112,28 @@ end
|
||||
-- * Object.Category.SCENERY = 5
|
||||
-- * Object.Category.Cargo = 6
|
||||
--
|
||||
-- For UNITs this returns a second value, one of
|
||||
--
|
||||
-- Unit.Category.AIRPLANE = 0
|
||||
-- Unit.Category.HELICOPTER = 1
|
||||
-- Unit.Category.GROUND_UNIT = 2
|
||||
-- Unit.Category.SHIP = 3
|
||||
-- Unit.Category.STRUCTURE = 4
|
||||
--
|
||||
-- @param #IDENTIFIABLE self
|
||||
-- @return DCS#Object.Category The category ID, i.e. a number.
|
||||
-- @return DCS#Unit.Category The unit category ID, i.e. a number. For units only.
|
||||
function IDENTIFIABLE:GetCategory()
|
||||
self:F2( self.ObjectName )
|
||||
|
||||
local DCSObject = self:GetDCSObject()
|
||||
if DCSObject then
|
||||
local ObjectCategory = DCSObject:getCategory()
|
||||
local ObjectCategory, UnitCategory = DCSObject:getCategory()
|
||||
self:T3( ObjectCategory )
|
||||
return ObjectCategory
|
||||
return ObjectCategory, UnitCategory
|
||||
end
|
||||
|
||||
return nil
|
||||
return nil,nil
|
||||
end
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user