This commit is contained in:
Frank 2021-06-25 21:13:24 +02:00
parent 36669c80da
commit a861f8d9d4
2 changed files with 13 additions and 15 deletions

View File

@ -2379,9 +2379,6 @@ function FLIGHTGROUP:_LandAtAirbase(airbase, SpeedTo, SpeedHold, SpeedLand)
-- Holding points. -- Holding points.
local c0=self.group:GetCoordinate() local c0=self.group:GetCoordinate()
local zone=airbase:GetZone()
env.info("FF landatairbase zone:")
self:I({zone=zone})
local p0=airbase:GetZone():GetRandomCoordinate():SetAltitude(UTILS.FeetToMeters(althold)) local p0=airbase:GetZone():GetRandomCoordinate():SetAltitude(UTILS.FeetToMeters(althold))
local p1=nil local p1=nil
local wpap=nil local wpap=nil
@ -3715,8 +3712,6 @@ end
-- @return Wrapper.Airbase#AIRBASE.ParkingSpot Parking spot or nil if no spot is within distance threshold. -- @return Wrapper.Airbase#AIRBASE.ParkingSpot Parking spot or nil if no spot is within distance threshold.
function FLIGHTGROUP:GetParkingSpot(element, maxdist, airbase) function FLIGHTGROUP:GetParkingSpot(element, maxdist, airbase)
env.info("FF Get Parking spot for element "..element.name)
-- Coordinate of unit landed -- Coordinate of unit landed
local coord=element.unit:GetCoordinate() local coord=element.unit:GetCoordinate()
@ -3731,7 +3726,6 @@ function FLIGHTGROUP:GetParkingSpot(element, maxdist, airbase)
coord.x=0 coord.x=0
coord.z=0 coord.z=0
maxdist=500 -- 100 meters was not enough, e.g. on the Seawise Giant, where the spot is 139 meters from the "center" maxdist=500 -- 100 meters was not enough, e.g. on the Seawise Giant, where the spot is 139 meters from the "center"
env.info("FF Airbase is ship")
end end
local spot=nil --Wrapper.Airbase#AIRBASE.ParkingSpot local spot=nil --Wrapper.Airbase#AIRBASE.ParkingSpot
@ -3740,7 +3734,7 @@ function FLIGHTGROUP:GetParkingSpot(element, maxdist, airbase)
for _,_parking in pairs(parking) do for _,_parking in pairs(parking) do
local parking=_parking --Wrapper.Airbase#AIRBASE.ParkingSpot local parking=_parking --Wrapper.Airbase#AIRBASE.ParkingSpot
dist=coord:Get2DDistance(parking.Coordinate) dist=coord:Get2DDistance(parking.Coordinate)
env.info(string.format("FF parking %d dist=%.1f", parking.TerminalID, dist)) --env.info(string.format("FF parking %d dist=%.1f", parking.TerminalID, dist))
if dist<distmin then if dist<distmin then
distmin=dist distmin=dist
spot=_parking spot=_parking

View File

@ -1791,7 +1791,7 @@ end
function OPSGROUP:IsNotCargo(CheckTransport) function OPSGROUP:IsNotCargo(CheckTransport)
local notcargo=self.cargoStatus==OPSGROUP.CargoStatus.NOTCARGO local notcargo=self.cargoStatus==OPSGROUP.CargoStatus.NOTCARGO
if self.cargoTransportUID==nil then if self.cargoTransportUID==nil then
notcargo=true --notcargo=true
end end
return notcargo return notcargo
end end
@ -4835,6 +4835,9 @@ function OPSGROUP:_CheckCargoTransport()
-- Check if there is anything in the queue. -- Check if there is anything in the queue.
if not self.cargoTransport then if not self.cargoTransport then
self.cargoTransport=self:_GetNextCargoTransport() self.cargoTransport=self:_GetNextCargoTransport()
if self.cargoTransport and not self:IsActive() then
self:Activate()
end
end end
-- Now handle the transport. -- Now handle the transport.
@ -4864,7 +4867,7 @@ function OPSGROUP:_CheckCargoTransport()
self:I(self.lid.."Not carrier ==> pickup") self:I(self.lid.."Not carrier ==> pickup")
-- Initiate the cargo transport process. -- Initiate the cargo transport process.
self:Pickup() self:__Pickup(-1)
elseif self:IsPickingup() then elseif self:IsPickingup() then
@ -4897,9 +4900,10 @@ function OPSGROUP:_CheckCargoTransport()
end end
self:I(self.lid.."gotcargo="..tostring(gotcargo)) -- Debug.
self:I(self.lid.."boarding="..tostring(boarding)) --self:I(self.lid.."gotcargo="..tostring(gotcargo))
self:I(self.lid.."required="..tostring(self.cargoTransport:_CheckRequiredCargos())) --self:I(self.lid.."boarding="..tostring(boarding))
--self:I(self.lid.."required="..tostring(self.cargoTransport:_CheckRequiredCargos()))
-- Boarding finished ==> Transport cargo. -- Boarding finished ==> Transport cargo.
if gotcargo and self.cargoTransport:_CheckRequiredCargos() and not boarding then if gotcargo and self.cargoTransport:_CheckRequiredCargos() and not boarding then
@ -5090,7 +5094,7 @@ function OPSGROUP:AddOpsTransport(OpsTransport)
table.insert(self.cargoqueue, OpsTransport) table.insert(self.cargoqueue, OpsTransport)
-- Debug message. -- Debug message.
self:I(self.lid.."FF adding transport to carrier, #self.cargoqueue="..#self.cargoqueue) self:T(self.lid.."Adding transport to carrier, #self.cargoqueue="..#self.cargoqueue)
return self return self
end end
@ -8708,7 +8712,7 @@ function OPSGROUP:_AddElementByName(unitname)
-- Descriptors and type/category. -- Descriptors and type/category.
element.descriptors=unit:GetDesc() element.descriptors=unit:GetDesc()
self:I({desc=element.descriptors}) --self:I({desc=element.descriptors})
element.category=unit:GetUnitCategory() element.category=unit:GetUnitCategory()
element.categoryname=unit:GetCategoryName() element.categoryname=unit:GetCategoryName()
@ -8762,7 +8766,7 @@ function OPSGROUP:_AddElementByName(unitname)
local text=string.format("Adding element %s: status=%s, skill=%s, life=%.1f/%.1f category=%s (%d), type=%s, size=%.1f (L=%.1f H=%.1f W=%.1f), weight=%.1f/%.1f (cargo=%.1f/%.1f)", local text=string.format("Adding element %s: status=%s, skill=%s, life=%.1f/%.1f category=%s (%d), type=%s, size=%.1f (L=%.1f H=%.1f W=%.1f), weight=%.1f/%.1f (cargo=%.1f/%.1f)",
element.name, element.status, element.skill, element.life, element.life0, element.categoryname, element.category, element.typename, element.name, element.status, element.skill, element.life, element.life0, element.categoryname, element.category, element.typename,
element.size, element.length, element.height, element.width, element.weight, element.weightMaxTotal, element.weightCargo, element.weightMaxCargo) element.size, element.length, element.height, element.width, element.weight, element.weightMaxTotal, element.weightCargo, element.weightMaxCargo)
self:I(self.lid..text) self:T(self.lid..text)
-- Debug text. -- Debug text.
--local text=string.format("Adding element %s: status=%s, skill=%s, modex=%s, fuelmass=%.1f (%d), category=%d, categoryname=%s, callsign=%s, ai=%s", --local text=string.format("Adding element %s: status=%s, skill=%s, modex=%s, fuelmass=%.1f (%d), category=%d, categoryname=%s, callsign=%s, ai=%s",