From 82e1dcfc047ed46e302501ed798fed383b2e0a4b Mon Sep 17 00:00:00 2001 From: shaji Date: Mon, 31 Mar 2025 13:11:56 +0200 Subject: [PATCH 1/2] [Fixed] Parameter #1 (unit name) is incorrect --- 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 352e30045..d268151a5 100644 --- a/Moose Development/Moose/Ops/OpsGroup.lua +++ b/Moose Development/Moose/Ops/OpsGroup.lua @@ -9045,7 +9045,7 @@ function OPSGROUP:AddWeightCargo(UnitName, Weight) self:T(self.lid..string.format("%s: Adding %.1f kg cargo weight. New cargo weight=%.1f kg", UnitName, Weight, element.weightCargo)) -- For airborne units, we set the weight in game. - if self.isFlightgroup then + if self.isFlightgroup and element.name then trigger.action.setUnitInternalCargo(element.name, element.weightCargo) --https://wiki.hoggitworld.com/view/DCS_func_setUnitInternalCargo end From 222722225e0dbb4ff8978e7fb0565794e8f9c2c7 Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Mon, 31 Mar 2025 14:04:07 +0200 Subject: [PATCH 2/2] Update OpsGroup.lua Better make this a unit and alive check --- 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 d268151a5..268dfd008 100644 --- a/Moose Development/Moose/Ops/OpsGroup.lua +++ b/Moose Development/Moose/Ops/OpsGroup.lua @@ -9045,7 +9045,7 @@ function OPSGROUP:AddWeightCargo(UnitName, Weight) self:T(self.lid..string.format("%s: Adding %.1f kg cargo weight. New cargo weight=%.1f kg", UnitName, Weight, element.weightCargo)) -- For airborne units, we set the weight in game. - if self.isFlightgroup and element.name then + if self.isFlightgroup and element.unit and element.unit:IsAlive() then -- #2272 trying to deduct cargo weight from possibly dead units trigger.action.setUnitInternalCargo(element.name, element.weightCargo) --https://wiki.hoggitworld.com/view/DCS_func_setUnitInternalCargo end