From f929951dbe45da0511ab378d1ec4e9cac08b4503 Mon Sep 17 00:00:00 2001 From: ttrebuchon Date: Sun, 13 Aug 2023 15:12:51 -0400 Subject: [PATCH 1/4] Fix WAREHOUSE.AssetItem size calculation --- Moose Development/Moose/Functional/Warehouse.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Functional/Warehouse.lua b/Moose Development/Moose/Functional/Warehouse.lua index f420a770e..dc92562b1 100644 --- a/Moose Development/Moose/Functional/Warehouse.lua +++ b/Moose Development/Moose/Functional/Warehouse.lua @@ -4101,9 +4101,9 @@ function WAREHOUSE:_RegisterAsset(group, ngroups, forceattribute, forcecargobay, -- Get the size of an object. local function _GetObjectSize(DCSdesc) if DCSdesc.box then - local x=DCSdesc.box.max.x+math.abs(DCSdesc.box.min.x) --length - local y=DCSdesc.box.max.y+math.abs(DCSdesc.box.min.y) --height - local z=DCSdesc.box.max.z+math.abs(DCSdesc.box.min.z) --width + local x=DCSdesc.box.max.x-DCSdesc.box.min.x --length + local y=DCSdesc.box.max.y-DCSdesc.box.min.y --height + local z=DCSdesc.box.max.z-DCSdesc.box.min.z --width return math.max(x,z), x , y, z end return 0,0,0,0 From d08219f9d9e3f56fd735462210a988ee716a45fa Mon Sep 17 00:00:00 2001 From: ttrebuchon Date: Sun, 13 Aug 2023 15:16:46 -0400 Subject: [PATCH 2/4] Add missing "Mission.escortMissionType" argument to call to AssignAssetsForEscort --- Moose Development/Moose/Ops/Commander.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/Commander.lua b/Moose Development/Moose/Ops/Commander.lua index 0af40ed2d..132b474f0 100644 --- a/Moose Development/Moose/Ops/Commander.lua +++ b/Moose Development/Moose/Ops/Commander.lua @@ -1747,7 +1747,7 @@ function COMMANDER:RecruitAssetsForEscort(Mission, Assets) local Cohorts=self:_GetCohorts(Mission.escortLegions, Mission.escortCohorts, Mission.operation) -- Call LEGION function but provide COMMANDER as self. - local assigned=LEGION.AssignAssetsForEscort(self, Cohorts, Assets, Mission.NescortMin, Mission.NescortMax, Mission.escortTargetTypes, Mission.escortEngageRange) + local assigned=LEGION.AssignAssetsForEscort(self, Cohorts, Assets, Mission.NescortMin, Mission.NescortMax, Mission.escortMissionType, Mission.escortTargetTypes, Mission.escortEngageRange) return assigned end From 2e9320df0309a07f61d4483bfe79c5c4870cc11c Mon Sep 17 00:00:00 2001 From: ttrebuchon Date: Sun, 13 Aug 2023 15:18:09 -0400 Subject: [PATCH 3/4] Add check for whether targetcoord is nil in UpdateMarker() call --- Moose Development/Moose/Ops/Auftrag.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index 7d4deac86..1bf4f8710 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -5776,10 +5776,12 @@ function AUFTRAG:UpdateMarker() -- Get target coordinates. Can be nil! local targetcoord=self:GetTargetCoordinate() - if self.markerCoaliton and self.markerCoaliton>=0 then - self.marker=MARKER:New(targetcoord, text):ReadOnly():ToCoalition(self.markerCoaliton) - else - self.marker=MARKER:New(targetcoord, text):ReadOnly():ToAll() + if targetcoord then + if self.markerCoaliton and self.markerCoaliton>=0 then + self.marker=MARKER:New(targetcoord, text):ReadOnly():ToCoalition(self.markerCoaliton) + else + self.marker=MARKER:New(targetcoord, text):ReadOnly():ToAll() + end end else From 3adf6d635a3e2ba9c9ad35ec2427d1137867f21f Mon Sep 17 00:00:00 2001 From: ttrebuchon Date: Sun, 13 Aug 2023 15:22:05 -0400 Subject: [PATCH 4/4] Handle OPSGROUP:MarkWaypoints() when waypoint altitude is nil --- Moose Development/Moose/Ops/OpsGroup.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/OpsGroup.lua b/Moose Development/Moose/Ops/OpsGroup.lua index 594f916ce..6afe0d51e 100644 --- a/Moose Development/Moose/Ops/OpsGroup.lua +++ b/Moose Development/Moose/Ops/OpsGroup.lua @@ -3013,7 +3013,7 @@ function OPSGROUP:MarkWaypoints(Duration) local waypoint=_waypoint --#OPSGROUP.Waypoint local text=string.format("Waypoint ID=%d of %s", waypoint.uid, self.groupname) - text=text..string.format("\nSpeed=%.1f kts, Alt=%d ft (%s)", UTILS.MpsToKnots(waypoint.speed), UTILS.MetersToFeet(waypoint.alt), "BARO") + text=text..string.format("\nSpeed=%.1f kts, Alt=%d ft (%s)", UTILS.MpsToKnots(waypoint.speed), UTILS.MetersToFeet(waypoint.alt or 0), "BARO") if waypoint.marker then if waypoint.marker.text~=text then