mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Update Airbase.lua
- Fixed a bug inthe `AIRBASE:GetRunwayData()` function.
This commit is contained in:
parent
e2c1097ec5
commit
aa4f8452fa
@ -1272,8 +1272,7 @@ function AIRBASE:GetRunwayData(magvar, mark)
|
|||||||
name==AIRBASE.PersianGulf.Abu_Dhabi_International_Airport or
|
name==AIRBASE.PersianGulf.Abu_Dhabi_International_Airport or
|
||||||
name==AIRBASE.PersianGulf.Dubai_Intl or
|
name==AIRBASE.PersianGulf.Dubai_Intl or
|
||||||
name==AIRBASE.PersianGulf.Shiraz_International_Airport or
|
name==AIRBASE.PersianGulf.Shiraz_International_Airport or
|
||||||
name==AIRBASE.PersianGulf.Kish_International_Airport
|
name==AIRBASE.PersianGulf.Kish_International_Airport then
|
||||||
then
|
|
||||||
|
|
||||||
-- 1-->4, 2-->3, 3-->2, 4-->1
|
-- 1-->4, 2-->3, 3-->2, 4-->1
|
||||||
exception=1
|
exception=1
|
||||||
@ -1290,13 +1289,14 @@ function AIRBASE:GetRunwayData(magvar, mark)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Function returning the index of the runway coordinate belonding to the given index i.
|
||||||
local function f(i)
|
local function f(i)
|
||||||
|
|
||||||
local j
|
local j
|
||||||
|
|
||||||
if exception==1 then
|
if exception==1 then
|
||||||
|
|
||||||
j=N-(i+1) -- 1-->4, 2-->3
|
j=N-(i-1) -- 1-->4, 2-->3
|
||||||
|
|
||||||
elseif exception==2 then
|
elseif exception==2 then
|
||||||
|
|
||||||
@ -1357,6 +1357,9 @@ function AIRBASE:GetRunwayData(magvar, mark)
|
|||||||
|
|
||||||
-- Get the other spawn point coordinate.
|
-- Get the other spawn point coordinate.
|
||||||
local j=f(i)
|
local j=f(i)
|
||||||
|
|
||||||
|
-- Debug info.
|
||||||
|
--env.info(string.format("Runway i=%s j=%s (N=%d #runwaycoord=%d)", tostring(i), tostring(j), N, #runwaycoords))
|
||||||
|
|
||||||
-- Coordinates of the two runway points.
|
-- Coordinates of the two runway points.
|
||||||
local c1=runwaycoords[i] --Core.Point#COORDINATE
|
local c1=runwaycoords[i] --Core.Point#COORDINATE
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user