Skip to content

Commit

Permalink
OPS Speed
Browse files Browse the repository at this point in the history
- `AUFTRAG` Fixed speed unit conversion in multiple AUFTRAG types (DCS task parameter speed should be in m/s)
- `OPSGROUP`: Fixed unit conversion for engage target speed
  • Loading branch information
funkyfranky committed Dec 1, 2024
1 parent c0b09b0 commit f644d49
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions Moose Development/Moose/Ops/Auftrag.lua
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ AUFTRAG.Category={

--- AUFTRAG class version.
-- @field #string version
AUFTRAG.version="1.2.1"
AUFTRAG.version="1.2.2"

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- TODO list
Expand Down Expand Up @@ -2302,7 +2302,7 @@ function AUFTRAG:NewCAPTUREZONE(OpsZone, Coalition, Speed, Altitude, Formation)
params.formation=Formation or "Off Road"
params.zone=mission:GetObjective()
params.altitude=mission.missionAltitude
params.speed=mission.missionSpeed
params.speed=mission.missionSpeed and UTILS.KmphToMps(mission.missionSpeed) or nil

mission.DCStask.params=params

Expand Down Expand Up @@ -2352,7 +2352,7 @@ function AUFTRAG:NewGROUNDATTACK(Target, Speed, Formation)

mission.DCStask=mission:GetDCSMissionTask()

mission.DCStask.params.speed=Speed
mission.DCStask.params.speed=mission.missionSpeed and UTILS.KmphToMps(mission.missionSpeed) or nil
mission.DCStask.params.formation=Formation or ENUMS.Formation.Vehicle.Vee

return mission
Expand Down Expand Up @@ -6099,7 +6099,7 @@ function AUFTRAG:GetDCSMissionTask()
local param={}
param.zone=self:GetObjective()
param.altitude=self.missionAltitude
param.speed=self.missionSpeed
param.speed=self.missionSpeed and UTILS.KmphToMps(self.missionSpeed) or nil

DCStask.params=param

Expand Down Expand Up @@ -6179,7 +6179,7 @@ function AUFTRAG:GetDCSMissionTask()
local param={}
param.target=self.engageTarget
param.altitude=self.missionAltitude
param.speed=self.missionSpeed
param.speed=self.missionSpeed and UTILS.KmphToMps(self.missionSpeed) or nil
param.lastindex=nil

DCStask.params=param
Expand Down Expand Up @@ -6352,7 +6352,7 @@ function AUFTRAG:GetDCSMissionTask()
local param={}
param.zone=self:GetObjective()
param.altitude=self.missionAltitude
param.speed=self.missionSpeed
param.speed=self.missionSpeed and UTILS.KmphToMps(self.missionSpeed) or nil

DCStask.params=param

Expand Down Expand Up @@ -6388,7 +6388,7 @@ function AUFTRAG:GetDCSMissionTask()
local param={}
param.zone=self:GetObjective()
param.altitude=self.missionAltitude
param.speed=self.missionSpeed
param.speed=self.missionSpeed and UTILS.KmphToMps(self.missionSpeed) or nil

DCStask.params=param

Expand All @@ -6408,7 +6408,7 @@ function AUFTRAG:GetDCSMissionTask()
local param={}
param.target=self:GetTargetData()
param.action="Wedge"
param.speed=self.missionSpeed
param.speed=self.missionSpeed and UTILS.KmphToMps(self.missionSpeed) or nil

DCStask.params=param

Expand Down
2 changes: 1 addition & 1 deletion Moose Development/Moose/Ops/NavyGroup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ function NAVYGROUP:onafterUpdateRoute(From, Event, To, n, N, Speed, Depth)
if self.verbose>=10 then
for i=1,#waypoints do
local wp=waypoints[i] --Ops.OpsGroup#OPSGROUP.Waypoint
local text=string.format("%s Waypoint [%d] UID=%d speed=%d", self.groupname, i-1, wp.uid or -1, wp.speed)
local text=string.format("%s Waypoint [%d] UID=%d speed=%d m/s", self.groupname, i-1, wp.uid or -1, wp.speed)
self:I(self.lid..text)
COORDINATE:NewFromWaypoint(wp):MarkToAll(text)
end
Expand Down
2 changes: 1 addition & 1 deletion Moose Development/Moose/Ops/OpsGroup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4480,7 +4480,7 @@ function OPSGROUP:_UpdateTask(Task, Mission)
-- Set speed. Default max.
local speed=self.speedMax and UTILS.KmphToKnots(self.speedMax) or nil
if Task.dcstask.params.speed then
speed=Task.dcstask.params.speed
speed=UTILS.MpsToKnots(Task.dcstask.params.speed)
end

if target then
Expand Down

0 comments on commit f644d49

Please sign in to comment.