Merge branch 'develop' into FF/OpsDev

This commit is contained in:
Frank
2024-06-27 21:31:24 +02:00
10 changed files with 310 additions and 131 deletions

View File

@@ -1271,7 +1271,11 @@ end
-- @param #string ClientName Name of the Client.
-- @return #number Coalition ID.
function DATABASE:GetCoalitionFromClientTemplate( ClientName )
return self.Templates.ClientsByName[ClientName].CoalitionID
if self.Templates.ClientsByName[ClientName] then
return self.Templates.ClientsByName[ClientName].CoalitionID
end
self:E("ERROR: Template does not exist for client "..tostring(ClientName))
return nil
end
--- Get category ID from client name.
@@ -1279,7 +1283,11 @@ end
-- @param #string ClientName Name of the Client.
-- @return #number Category ID.
function DATABASE:GetCategoryFromClientTemplate( ClientName )
return self.Templates.ClientsByName[ClientName].CategoryID
if self.Templates.ClientsByName[ClientName] then
return self.Templates.ClientsByName[ClientName].CategoryID
end
self:E("ERROR: Template does not exist for client "..tostring(ClientName))
return nil
end
--- Get country ID from client name.
@@ -1287,7 +1295,11 @@ end
-- @param #string ClientName Name of the Client.
-- @return #number Country ID.
function DATABASE:GetCountryFromClientTemplate( ClientName )
return self.Templates.ClientsByName[ClientName].CountryID
if self.Templates.ClientsByName[ClientName] then
return self.Templates.ClientsByName[ClientName].CountryID
end
self:E("ERROR: Template does not exist for client "..tostring(ClientName))
return nil
end
--- Airbase

View File

@@ -2250,7 +2250,7 @@ do -- COORDINATE
-- local MarkGroup = GROUP:FindByName( "AttackGroup" )
-- local MarkID = TargetCoord:MarkToGroup( "This is a target for the attack group", AttackGroup )
-- <<< logic >>>
-- RemoveMark( MarkID ) -- The mark is now removed
-- TargetCoord:RemoveMark( MarkID ) -- The mark is now removed
function COORDINATE:RemoveMark( MarkID )
trigger.action.removeMark( MarkID )
end
@@ -2764,7 +2764,10 @@ do -- COORDINATE
local sunrise=UTILS.GetSunRiseAndSet(DayOfYear, Latitude, Longitude, true, Tdiff)
local sunset=UTILS.GetSunRiseAndSet(DayOfYear, Latitude, Longitude, false, Tdiff)
if sunrise == "N/R" then return false end
if sunrise == "N/S" then return true end
local time=UTILS.ClockToSeconds(clock)
-- Check if time is between sunrise and sunset.

View File

@@ -4729,8 +4729,11 @@ do -- SET_CLIENT
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
@@ -4742,8 +4745,11 @@ do -- SET_CLIENT
local MClientCategory = false
for CategoryID, CategoryName in pairs( self.Filter.Categories ) do
local ClientCategoryID = _DATABASE:GetCategoryFromClientTemplate( MClientName )
if ClientCategoryID==nil and MClient:IsAlive()~=nil then
ClientCategoryID=MClient:GetCategory()
end
self:T3( { "Category:", ClientCategoryID, self.FilterMeta.Categories[CategoryName], CategoryName } )
if self.FilterMeta.Categories[CategoryName] and self.FilterMeta.Categories[CategoryName] == ClientCategoryID then
if self.FilterMeta.Categories[CategoryName] and ClientCategoryID and self.FilterMeta.Categories[CategoryName] == ClientCategoryID then
MClientCategory = true
end
end
@@ -4767,8 +4773,11 @@ do -- SET_CLIENT
local MClientCountry = false
for CountryID, CountryName in pairs( self.Filter.Countries ) do
local ClientCountryID = _DATABASE:GetCountryFromClientTemplate( MClientName )
if ClientCountryID==nil and MClient:IsAlive()~=nil then
ClientCountryID=MClient:GetCountry()
end
self:T3( { "Country:", ClientCountryID, country.id[CountryName], CountryName } )
if country.id[CountryName] and country.id[CountryName] == ClientCountryID then
if country.id[CountryName] and ClientCountryID and country.id[CountryName] == ClientCountryID then
MClientCountry = true
end
end