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
|
local MClientCategory = false
|
||||||
for CategoryID, CategoryName in pairs( self.Filter.Categories ) do
|
for CategoryID, CategoryName in pairs( self.Filter.Categories ) do
|
||||||
local ClientCategoryID = _DATABASE:GetCategoryFromClientTemplate( MClientName )
|
local ClientCategoryID = _DATABASE:GetCategoryFromClientTemplate( MClientName )
|
||||||
|
local UnitCategory
|
||||||
if ClientCategoryID==nil and MClient:IsAlive()~=nil then
|
if ClientCategoryID==nil and MClient:IsAlive()~=nil then
|
||||||
ClientCategoryID=MClient:GetCategory()
|
ClientCategoryID,UnitCategory=MClient:GetCategory()
|
||||||
end
|
end
|
||||||
self:T3( { "Category:", ClientCategoryID, self.FilterMeta.Categories[CategoryName], CategoryName } )
|
self:T3( { "Category:", UnitCategory, self.FilterMeta.Categories[CategoryName], CategoryName } )
|
||||||
if self.FilterMeta.Categories[CategoryName] and ClientCategoryID and self.FilterMeta.Categories[CategoryName] == ClientCategoryID then
|
if self.FilterMeta.Categories[CategoryName] and UnitCategory and self.FilterMeta.Categories[CategoryName] == UnitCategory then
|
||||||
MClientCategory = true
|
MClientCategory = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -5196,12 +5197,15 @@ do -- SET_PLAYER
|
|||||||
if MClient then
|
if MClient then
|
||||||
local MClientName = MClient.UnitName
|
local MClientName = MClient.UnitName
|
||||||
|
|
||||||
if self.Filter.Coalitions then
|
if self.Filter.Coalitions and MClientInclude then
|
||||||
local MClientCoalition = false
|
local MClientCoalition = false
|
||||||
for CoalitionID, CoalitionName in pairs( self.Filter.Coalitions ) do
|
for CoalitionID, CoalitionName in pairs( self.Filter.Coalitions ) do
|
||||||
local ClientCoalitionID = _DATABASE:GetCoalitionFromClientTemplate( MClientName )
|
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 } )
|
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
|
MClientCoalition = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -5209,12 +5213,16 @@ do -- SET_PLAYER
|
|||||||
MClientInclude = MClientInclude and MClientCoalition
|
MClientInclude = MClientInclude and MClientCoalition
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.Filter.Categories then
|
if self.Filter.Categories and MClientInclude then
|
||||||
local MClientCategory = false
|
local MClientCategory = false
|
||||||
for CategoryID, CategoryName in pairs( self.Filter.Categories ) do
|
for CategoryID, CategoryName in pairs( self.Filter.Categories ) do
|
||||||
local ClientCategoryID = _DATABASE:GetCategoryFromClientTemplate( MClientName )
|
local ClientCategoryID = _DATABASE:GetCategoryFromClientTemplate( MClientName )
|
||||||
self:T3( { "Category:", ClientCategoryID, self.FilterMeta.Categories[CategoryName], CategoryName } )
|
local UnitCategory
|
||||||
if self.FilterMeta.Categories[CategoryName] and self.FilterMeta.Categories[CategoryName] == ClientCategoryID then
|
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
|
MClientCategory = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -112,19 +112,28 @@ end
|
|||||||
-- * Object.Category.SCENERY = 5
|
-- * Object.Category.SCENERY = 5
|
||||||
-- * Object.Category.Cargo = 6
|
-- * 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
|
-- @param #IDENTIFIABLE self
|
||||||
-- @return DCS#Object.Category The category ID, i.e. a number.
|
-- @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()
|
function IDENTIFIABLE:GetCategory()
|
||||||
self:F2( self.ObjectName )
|
self:F2( self.ObjectName )
|
||||||
|
|
||||||
local DCSObject = self:GetDCSObject()
|
local DCSObject = self:GetDCSObject()
|
||||||
if DCSObject then
|
if DCSObject then
|
||||||
local ObjectCategory = DCSObject:getCategory()
|
local ObjectCategory, UnitCategory = DCSObject:getCategory()
|
||||||
self:T3( ObjectCategory )
|
self:T3( ObjectCategory )
|
||||||
return ObjectCategory
|
return ObjectCategory, UnitCategory
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return nil,nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user