diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index 9000fd95a..98d42aa37 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -2185,6 +2185,7 @@ function AUFTRAG:NewARTY(Target, Nshots, Radius, Altitude) mission.optionAlarm=0 mission.missionFraction=0.0 + mission.missionWaypointRadius=0.0 -- Evaluate after 8 min. mission.dTevaluate=8*60 diff --git a/Moose Development/Moose/Ops/OpsGroup.lua b/Moose Development/Moose/Ops/OpsGroup.lua index c9a59be3c..352e30045 100644 --- a/Moose Development/Moose/Ops/OpsGroup.lua +++ b/Moose Development/Moose/Ops/OpsGroup.lua @@ -1345,12 +1345,12 @@ function OPSGROUP:GetCoordinateInRange(TargetCoord, WeaponBitType, RefCoord, Sur local weapondata=self:GetWeaponData(WeaponBitType) -- Heading intervals to search for a possible new coordinate in range. - local dh={0, -5, 5, -10, 10, -15, 15, -20, 20, -25, 25, -30, 30} + local dh={0, -5, 5, -10, 10, -15, 15, -20, 20, -25, 25, -30, 30, -35, 35, -40, 40, -45, 45, -50, 50, -55, 55, -60, 60, -65, 65, -70, 70, -75, 75, -80, 80} - -- Function that checks if the given surface type is valid.ss + -- Function that checks if the given surface type is valid local function _checkSurface(point) if SurfaceTypes then - local stype=land.getSurfaceType(point) + local stype=point:GetSurfaceType() for _,sf in pairs(SurfaceTypes) do if sf==stype then return true @@ -1387,7 +1387,7 @@ function OPSGROUP:GetCoordinateInRange(TargetCoord, WeaponBitType, RefCoord, Sur local h=heading+delta -- New waypoint coord. - coordInRange=TargetCoord:Translate(range*1.02, h) + coordInRange=TargetCoord:Translate(range, h) if _checkSurface(coordInRange) then break @@ -6100,13 +6100,12 @@ function OPSGROUP:RouteToMission(mission, delay) -- Target Coord. local targetcoord=mission:GetTargetCoordinate() - -- In range already? - local inRange=self:InWeaponRange(targetcoord, mission.engageWeaponType) + local inRange=self:InWeaponRange(targetcoord, mission.engageWeaponType, waypointcoord) if inRange then - waypointcoord=self:GetCoordinate(true) + --waypointcoord=self:GetCoordinate(true) else @@ -6183,8 +6182,6 @@ function OPSGROUP:RouteToMission(mission, delay) formation=ENUMS.Formation.Vehicle.OffRoad end - waypointcoord:MarkToAll("Bla Bla") - waypoint=ARMYGROUP.AddWaypoint(self, waypointcoord, SpeedToMission, uid, formation, false) elseif self:IsNavygroup() then