Further fixes

This commit is contained in:
Applevangelist
2024-07-16 13:38:42 +02:00
parent 04f2f7d34f
commit c73d8a6339
4 changed files with 36 additions and 20 deletions

View File

@@ -4743,18 +4743,23 @@ do -- SET_CLIENT
self:T( { "Evaluated Coalition", MClientCoalition } )
MClientInclude = MClientInclude and MClientCoalition
end
if self.Filter.Categories and MClientInclude then
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
local UnitCategory = 0
if ClientCategoryID==nil and MClient:IsExist() 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
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
else
self:T3( { "Category:", ClientCategoryID, self.FilterMeta.Categories[CategoryName], CategoryName } )
if self.FilterMeta.Categories[CategoryName] and ClientCategoryID and self.FilterMeta.Categories[CategoryName] == ClientCategoryID then
MClientCategory = true
end
end
end
self:T( { "Evaluated Category", MClientCategory } )
@@ -5217,13 +5222,18 @@ do -- SET_PLAYER
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
local UnitCategory = 0
if ClientCategoryID==nil and MClient:IsExist() 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
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
else
self:T3( { "Category:", ClientCategoryID, self.FilterMeta.Categories[CategoryName], CategoryName } )
if self.FilterMeta.Categories[CategoryName] and ClientCategoryID and self.FilterMeta.Categories[CategoryName] == ClientCategoryID then
MClientCategory = true
end
end
end
self:T( { "Evaluated Category", MClientCategory } )