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:
@@ -4203,9 +4203,10 @@ do -- SET_CLIENT
|
|||||||
|
|
||||||
if self.Filter.Active ~= nil then
|
if self.Filter.Active ~= nil then
|
||||||
local MClientActive = false
|
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
|
MClientActive = true
|
||||||
end
|
end
|
||||||
|
--self:I( { "Evaluated Active", MClientActive } )
|
||||||
MClientInclude = MClientInclude and MClientActive
|
MClientInclude = MClientInclude and MClientActive
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -4287,6 +4288,7 @@ do -- SET_CLIENT
|
|||||||
if self.Filter.Playernames then
|
if self.Filter.Playernames then
|
||||||
local MClientPlayername = false
|
local MClientPlayername = false
|
||||||
local playername = MClient:GetPlayerName() or "Unknown"
|
local playername = MClient:GetPlayerName() or "Unknown"
|
||||||
|
--self:I(playername)
|
||||||
for _,_Playername in pairs(self.Filter.Playernames) do
|
for _,_Playername in pairs(self.Filter.Playernames) do
|
||||||
if playername and string.find(playername,_Playername) then
|
if playername and string.find(playername,_Playername) then
|
||||||
MClientPlayername = true
|
MClientPlayername = true
|
||||||
@@ -4299,6 +4301,7 @@ do -- SET_CLIENT
|
|||||||
if self.Filter.Callsigns then
|
if self.Filter.Callsigns then
|
||||||
local MClientCallsigns = false
|
local MClientCallsigns = false
|
||||||
local callsign = MClient:GetCallsign()
|
local callsign = MClient:GetCallsign()
|
||||||
|
--self:I(callsign)
|
||||||
for _,_Callsign in pairs(self.Filter.Callsigns) do
|
for _,_Callsign in pairs(self.Filter.Callsigns) do
|
||||||
if callsign and string.find(callsign,_Callsign) then
|
if callsign and string.find(callsign,_Callsign) then
|
||||||
MClientCallsigns = true
|
MClientCallsigns = true
|
||||||
|
|||||||
@@ -2414,11 +2414,14 @@ function UTILS.LoadSetOfStatics(Path,Filename)
|
|||||||
local dataset = UTILS.Split(_entry,",")
|
local dataset = UTILS.Split(_entry,",")
|
||||||
-- staticname,position.x,position.y,position.z
|
-- staticname,position.x,position.y,position.z
|
||||||
local staticname = dataset[1]
|
local staticname = dataset[1]
|
||||||
local posx = tonumber(dataset[2])
|
--local posx = tonumber(dataset[2])
|
||||||
local posy = tonumber(dataset[3])
|
--local posy = tonumber(dataset[3])
|
||||||
local posz = tonumber(dataset[4])
|
--local posz = tonumber(dataset[4])
|
||||||
local coordinate = COORDINATE:NewFromVec3({x=posx, y=posy, z=posz})
|
--local coordinate = COORDINATE:NewFromVec3({x=posx, y=posy, z=posz})
|
||||||
datatable:AddObject(STATIC:FindByName(staticname,false))
|
local StaticObject = STATIC:FindByName(staticname,false)
|
||||||
|
if StaticObject then
|
||||||
|
datatable:AddObject(StaticObject)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user