mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
* Update Database.lua Remove duplicate function * Update PseudoATC.lua Added nil check
This commit is contained in:
parent
f50c374d04
commit
1fdf4f371d
@ -241,16 +241,6 @@ function DATABASE:DeleteAirbase( AirbaseName )
|
|||||||
self.AIRBASES[AirbaseName] = nil
|
self.AIRBASES[AirbaseName] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Finds an AIRBASE based on the AirbaseName.
|
|
||||||
-- @param #DATABASE self
|
|
||||||
-- @param #string AirbaseName
|
|
||||||
-- @return Wrapper.Airbase#AIRBASE The found AIRBASE.
|
|
||||||
function DATABASE:FindAirbase( AirbaseName )
|
|
||||||
|
|
||||||
local AirbaseFound = self.AIRBASES[AirbaseName]
|
|
||||||
return AirbaseFound
|
|
||||||
end
|
|
||||||
|
|
||||||
do -- Zones
|
do -- Zones
|
||||||
|
|
||||||
--- Finds a @{Zone} based on the zone name.
|
--- Finds a @{Zone} based on the zone name.
|
||||||
|
|||||||
@ -949,11 +949,14 @@ function PSEUDOATC:LocalAirports(GID, UID)
|
|||||||
for _,airbase in pairs(airports) do
|
for _,airbase in pairs(airports) do
|
||||||
|
|
||||||
local name=airbase:getName()
|
local name=airbase:getName()
|
||||||
local q=AIRBASE:FindByName(name):GetCoordinate()
|
local a=AIRBASE:FindByName(name)
|
||||||
|
if a then
|
||||||
|
local q=a:GetCoordinate()
|
||||||
local d=q:Get2DDistance(pos)
|
local d=q:Get2DDistance(pos)
|
||||||
|
|
||||||
-- Add to table.
|
-- Add to table.
|
||||||
table.insert(self.group[GID].player[UID].airports, {distance=d, name=name})
|
table.insert(self.group[GID].player[UID].airports, {distance=d, name=name})
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user