#FLIGHTCONTROL

* Fix for shelters, puts the guy out front and not on top.
This commit is contained in:
Applevangelist 2023-11-08 11:09:39 +01:00
parent eed6119193
commit b4058ecab2

View File

@ -329,7 +329,7 @@ FLIGHTCONTROL.FlightStatus={
--- FlightControl class version.
-- @field #string version
FLIGHTCONTROL.version="0.7.4"
FLIGHTCONTROL.version="0.7.5"
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO list
@ -4441,11 +4441,21 @@ function FLIGHTCONTROL:SpawnParkingGuard(unit)
-- Length of the unit + 3 meters.
local size, x, y, z=unit:GetObjectSize()
local xdiff = 3
--Fix for hangars, puts the guy out front and not on top.
if AIRBASE._CheckTerminalType(spot.TerminalType, AIRBASE.TerminalType.Shelter) then
xdiff = 27-(x*0.5)
end
if (AIRBASE._CheckTerminalType(spot.TerminalType, AIRBASE.TerminalType.OpenMed) or AIRBASE._CheckTerminalType(spot.TerminalType, AIRBASE.TerminalType.Shelter)) and self.airbasename == AIRBASE.Sinai.Ramon_Airbase then
xdiff = 12
end
-- Debug message.
self:T2(self.lid..string.format("Parking guard for %s: heading=%d, distance x=%.1f m", unit:GetName(), heading, x))
self:T2(self.lid..string.format("Parking guard for %s: heading=%d, length x=%.1f m, xdiff=%.1f m", unit:GetName(), heading, x, xdiff))
-- Coordinate for the guard.
local Coordinate=coordinate:Translate(0.75*x+3, heading)
local Coordinate=coordinate:Translate(x*0.5+xdiff, heading)
-- Let him face the aircraft.
local lookat=heading-180