mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
#UTILS
* UTILS.LoadSetOfStatics(Path,Filename) ignore statics which do not exist
This commit is contained in:
commit
99023a3053
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user