* UTILS.LoadSetOfStatics(Path,Filename) ignore statics which do not exist
This commit is contained in:
Applevangelist 2022-12-15 18:29:46 +01:00
commit 99023a3053
2 changed files with 12 additions and 6 deletions

View File

@ -4203,9 +4203,10 @@ do -- SET_CLIENT
if self.Filter.Active ~= nil then
local MClientActive = false
if self.Filter.Active == false or (self.Filter.Active == true and MClient:IsActive() == true) then
if self.Filter.Active == false or (self.Filter.Active == true and MClient:IsActive() == true and MClient:IsAlive() == true) then
MClientActive = true
end
--self:I( { "Evaluated Active", MClientActive } )
MClientInclude = MClientInclude and MClientActive
end
@ -4287,6 +4288,7 @@ do -- SET_CLIENT
if self.Filter.Playernames then
local MClientPlayername = false
local playername = MClient:GetPlayerName() or "Unknown"
--self:I(playername)
for _,_Playername in pairs(self.Filter.Playernames) do
if playername and string.find(playername,_Playername) then
MClientPlayername = true
@ -4299,6 +4301,7 @@ do -- SET_CLIENT
if self.Filter.Callsigns then
local MClientCallsigns = false
local callsign = MClient:GetCallsign()
--self:I(callsign)
for _,_Callsign in pairs(self.Filter.Callsigns) do
if callsign and string.find(callsign,_Callsign) then
MClientCallsigns = true

View File

@ -2414,11 +2414,14 @@ function UTILS.LoadSetOfStatics(Path,Filename)
local dataset = UTILS.Split(_entry,",")
-- staticname,position.x,position.y,position.z
local staticname = dataset[1]
local posx = tonumber(dataset[2])
local posy = tonumber(dataset[3])
local posz = tonumber(dataset[4])
local coordinate = COORDINATE:NewFromVec3({x=posx, y=posy, z=posz})
datatable:AddObject(STATIC:FindByName(staticname,false))
--local posx = tonumber(dataset[2])
--local posy = tonumber(dataset[3])
--local posz = tonumber(dataset[4])
--local coordinate = COORDINATE:NewFromVec3({x=posx, y=posy, z=posz})
local StaticObject = STATIC:FindByName(staticname,false)
if StaticObject then
datatable:AddObject(StaticObject)
end
end
else
return nil