diff --git a/Moose Development/Moose/Core/Point.lua b/Moose Development/Moose/Core/Point.lua index ca1529950..8d4bf015c 100644 --- a/Moose Development/Moose/Core/Point.lua +++ b/Moose Development/Moose/Core/Point.lua @@ -774,12 +774,8 @@ do -- COORDINATE local a={x=TargetCoordinate.x-self.x, y=0, z=TargetCoordinate.z-self.z} - return UTILS.VecNorm(a) - - --local TargetVec3 = TargetCoordinate:GetVec3() - --local SourceVec3 = self:GetVec3() - - --return ( ( TargetVec3.x - SourceVec3.x ) ^ 2 + ( TargetVec3.z - SourceVec3.z ) ^ 2 ) ^ 0.5 + local norm=UTILS.VecNorm(a) + return norm end --- Returns the temperature in Degrees Celsius. diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index 82786e869..a98f3b52c 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -94,6 +94,7 @@ -- @field #number missionAltitude Mission altitude in meters. -- @field #number missionFraction Mission coordiante fraction. Default is 0.5. -- @field #number missionRange Mission range in meters. Used in AIRWING class. +-- @field Core.Point#COORDINATE missionWaypointCoord Mission waypoint coordinate. -- -- @field #table enrouteTasks Mission enroute tasks. -- @@ -1061,7 +1062,7 @@ end --- Create an ESCORT (or FOLLOW) mission. Flight will escort another group and automatically engage certain target types. -- @param #AUFTRAG self -- @param Wrapper.Group#GROUP EscortGroup The group to escort. --- @param DCS#Vec3 OffsetVector A table with x, y and z components specifying the offset of the flight to the escorted group. Default {x=200, y=0, z=-100} for 200 meters to the right, same alitude, 100 meters behind. +-- @param DCS#Vec3 OffsetVector A table with x, y and z components specifying the offset of the flight to the escorted group. Default {x=-100, y=0, z=200} for z=200 meters to the right, same alitude, x=100 meters behind. -- @param #number EngageMaxDistance Max engage distance of targets in meters. Default auto (*nil*). -- @param #table TargetTypes Types of targets to engage automatically. Default is {"Air"}, i.e. all enemy airborne units. Use an empty set {} for a simple "FOLLOW" mission. -- @return #AUFTRAG self @@ -1072,7 +1073,7 @@ function AUFTRAG:NewESCORT(EscortGroup, OffsetVector, EngageMaxDistance, TargetT mission:_TargetFromObject(EscortGroup) -- DCS task parameters: - mission.escortVec3=OffsetVector or {x=200, y=0, z=-100} + mission.escortVec3=OffsetVector or {x=-100, y=0, z=200} mission.engageMaxDistance=EngageMaxDistance mission.engageTargetTypes=TargetTypes or {"Air"} @@ -2140,9 +2141,9 @@ function AUFTRAG:Evaluate() --- -- Check if failed. - if self.type==AUFTRAG.Type.TROOPTRANSPORT then + if self.type==AUFTRAG.Type.TROOPTRANSPORT or self.type==AUFTRAG.Type.ESCORT then - -- Transported groups have to survive. + -- Transported or escorted groups have to survive. if Ntargets