AB 0.996w

This commit is contained in:
funkyfranky 2019-03-27 16:23:39 +01:00
parent ec155ed80c
commit de0c8e3789
3 changed files with 24 additions and 11 deletions

View File

@ -1470,12 +1470,20 @@ function SPAWN:SpawnAtAirbase( SpawnAirbase, Takeoff, TakeoffAltitude, TerminalT
self:T( { "Current point of ", self.SpawnTemplatePrefix, SpawnAirbase } )
-- Template group, unit and its attributes.
local TemplateGroup = GROUP:FindByName(self.SpawnTemplatePrefix)
local TemplateUnit=TemplateGroup:GetUnit(1)
--local TemplateGroup = GROUP:FindByName(self.SpawnTemplatePrefix)
--local TemplateUnit=TemplateGroup:GetUnit(1)
--local ishelo=TemplateUnit:HasAttribute("Helicopters")
--local isbomber=TemplateUnit:HasAttribute("Bombers")
--local istransport=TemplateUnit:HasAttribute("Transports")
--local isfighter=TemplateUnit:HasAttribute("Battleplanes")
local group=TemplateGroup
local istransport=group:HasAttribute("Transports") and group:HasAttribute("Planes")
local isawacs=group:HasAttribute("AWACS")
local isfighter=group:HasAttribute("Fighters") or group:HasAttribute("Interceptors") or group:HasAttribute("Multirole fighters") or (group:HasAttribute("Bombers") and not group:HasAttribute("Strategic bombers"))
local isbomber=group:HasAttribute("Strategic bombers")
local istanker=group:HasAttribute("Tankers")
local ishelo=TemplateUnit:HasAttribute("Helicopters")
local isbomber=TemplateUnit:HasAttribute("Bombers")
local istransport=TemplateUnit:HasAttribute("Transports")
local isfighter=TemplateUnit:HasAttribute("Battleplanes")
-- Number of units in the group. With grouping this can actually differ from the template group size!
local nunits=#SpawnTemplate.units
@ -1585,10 +1593,7 @@ function SPAWN:SpawnAtAirbase( SpawnAirbase, Takeoff, TakeoffAltitude, TerminalT
else
-- Fixed wing aircraft is spawned.
if termtype==nil then
--TODO: Add some default cases for transport, bombers etc. if no explicit terminal type is provided.
--TODO: We don't want Bombers to spawn in shelters. But I don't know a good attribute for just fighers.
--TODO: Some attributes are "Helicopters", "Bombers", "Transports", "Battleplanes". Need to check it out.
if isbomber or istransport then
if isbomber or istransport or istanker or isawacs then
-- First we fill the potentially bigger spots.
self:T(string.format("Transport/bomber group %s is at %s using terminal type %d.", self.SpawnTemplatePrefix, SpawnAirbase:GetName(), AIRBASE.TerminalType.OpenBig))
spots=SpawnAirbase:FindFreeParkingSpotForAircraft(TemplateGroup, AIRBASE.TerminalType.OpenBig, scanradius, scanunits, scanstatics, scanscenery, verysafe, nunits)

View File

@ -9055,9 +9055,17 @@ function AIRBOSS:_Break(playerData, part)
self:_AbortPattern(playerData, X, Z, breakpoint, true)
return
end
-- Player made a very tight turn and did not trigger the latebreak threshold at 0.8 NM.
local tooclose=false
if part==AIRBOSS.PatternStep.LATEBREAK then
if X<0 and Z<UTILS.NMToMeters(0.8) then
tooclose=true
end
end
-- Check limits.
if self:_CheckLimits(X, Z, breakpoint) then
if self:_CheckLimits(X, Z, breakpoint) or tooclose then
-- Hint for player about altitude, AoA etc.
self:_PlayerHint(playerData)

View File

@ -884,7 +884,7 @@ function RECOVERYTANKER:onafterStart(From, Event, To)
else
-- Spawn tanker at airbase.
self.tanker=Spawn:SpawnAtAirbase(self.airbase, self.takeoff)
self.tanker=Spawn:SpawnAtAirbase(self.airbase, self.takeoff, nil, AIRBASE.TerminalType.OpenBig)
end