- Fixed mission alt for patrol zone auftrag
This commit is contained in:
Frank 2021-11-07 22:32:17 +01:00
parent 6cd00c60a7
commit f157f3b5d6
3 changed files with 11 additions and 6 deletions

View File

@ -2132,6 +2132,7 @@ function CHIEF:RecruitAssetsForZone(StratZone, MissionType, NassetsMin, NassetsM
if MissionType==AUFTRAG.Type.PATROLZONE then
mission=AUFTRAG:NewPATROLZONE(StratZone.opszone.zone)
mission:SetEngageDetected(25, {"Ground Units", "Light armed ships", "Helicopters"})
elseif MissionType==AUFTRAG.Type.ONGUARD then
mission=AUFTRAG:NewONGUARD(StratZone.opszone.zone:GetRandomCoordinate(), nil, nil, {land.SurfaceType.LAND})
end
@ -2161,9 +2162,8 @@ function CHIEF:RecruitAssetsForZone(StratZone, MissionType, NassetsMin, NassetsM
elseif MissionType==AUFTRAG.Type.CAS then
-- Create Patrol zone mission.
--local mission=AUFTRAG:NewCAS(StratZone.opszone.zone, 7000)
local mission=AUFTRAG:NewPATROLZONE(StratZone.opszone.zone, 250, 7000)
mission:SetEngageDetected(25, TargetTypes,EngageZoneSet,NoEngageZoneSet)
local mission=AUFTRAG:NewPATROLZONE(StratZone.opszone.zone)
mission:SetEngageDetected(25, {"Ground Units", "Light armed ships", "Helicopters"})
-- Add assets to mission.
for _,asset in pairs(assets) do

View File

@ -1465,7 +1465,7 @@ end
-- @param Core.Point#COORDINATE Coordinate The coordinate of the waypoint. Use `COORDINATE:SetAltitude()` to define the altitude.
-- @param #number Speed Speed in knots. Default is default cruise speed or 70% of max speed.
-- @param #number AfterWaypointWithID Insert waypoint after waypoint given ID. Default is to insert as last waypoint.
-- @param #number Depth Depth at waypoint in meters. Only for submarines.
-- @param #number Depth Depth at waypoint in feet. Only for submarines.
-- @param #boolean Updateroute If true or nil, call UpdateRoute. If false, no call.
-- @return Ops.OpsGroup#OPSGROUP.Waypoint Waypoint table.
function NAVYGROUP:AddWaypoint(Coordinate, Speed, AfterWaypointWithID, Depth, Updateroute)
@ -1485,6 +1485,11 @@ function NAVYGROUP:AddWaypoint(Coordinate, Speed, AfterWaypointWithID, Depth, Up
-- Create waypoint data table.
local waypoint=self:_CreateWaypoint(wp)
-- Set altitude.
if Depth then
waypoint.alt=UTILS.FeetToMeters(Depth)
end
-- Add waypoint to table.
self:_AddWaypoint(waypoint, wpnumber)

View File

@ -4631,7 +4631,7 @@ function OPSGROUP:RouteToMission(mission, delay)
elseif self:IsArmygroup() then
waypoint=ARMYGROUP.AddWaypoint(self, egresscoord, SpeedToMission, uid, mission.optionFormation, false)
elseif self:IsNavygroup() then
waypoint=NAVYGROUP.AddWaypoint(self, egresscoord, SpeedToMission, uid, mission.missionAltitude or self.altitudeCruise, false)
waypoint=NAVYGROUP.AddWaypoint(self, egresscoord, SpeedToMission, uid, UTILS.MetersToFeet(mission.missionAltitude or self.altitudeCruise), false)
end
waypoint.missionUID=mission.auftragsnummer
mission:SetGroupEgressWaypointUID(self, waypoint.uid)
@ -4854,7 +4854,7 @@ function OPSGROUP:onafterPassingWaypoint(From, Event, To, Waypoint)
-- Speed and altitude.
local Speed=UTILS.KmphToKnots(task.dcstask.params.speed or self.speedCruise)
local Altitude=task.dcstask.params.altitude and UTILS.MetersToFeet(task.dcstask.params.altitude) or nil
local Altitude=UTILS.MetersToFeet(task.dcstask.params.altitude or self.altitudeCruise)
local currUID=self:GetWaypointCurrent().uid