This commit is contained in:
Frank
2019-08-30 23:48:41 +02:00
parent 3531b6a3e6
commit 1ecbf22f0a
4 changed files with 83 additions and 54 deletions
+11 -9
View File
@@ -1251,17 +1251,19 @@ do -- COORDINATE
-- Loop over all airbases.
for _,_airbase in pairs(airbases) do
local airbase=_airbase --Wrapper.Airbase#AIRBASE
local category=airbase:GetDesc().category
if Category and Category==category or Category==nil then
local dist=self:Get2DDistance(airbase:GetCoordinate())
if closest==nil then
distmin=dist
closest=airbase
else
if dist<distmin then
if airbase then
local category=airbase:GetCategory()
if Category and Category==category or Category==nil then
local dist=self:Get2DDistance(airbase:GetCoordinate())
if closest==nil then
distmin=dist
closest=airbase
end
else
if dist<distmin then
distmin=dist
closest=airbase
end
end
end
end
end