From 382605d4cf644e464ab6bdf16e51251b8c5bd830 Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 28 Aug 2023 20:23:51 +0200 Subject: [PATCH] Update OpsGroup.lua - Fixed bug loading opsgroups as cargo --- Moose Development/Moose/Ops/OpsGroup.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/OpsGroup.lua b/Moose Development/Moose/Ops/OpsGroup.lua index 3e03fc39d..c628cf603 100644 --- a/Moose Development/Moose/Ops/OpsGroup.lua +++ b/Moose Development/Moose/Ops/OpsGroup.lua @@ -9444,6 +9444,7 @@ function OPSGROUP:onafterLoading(From, Event, To) local weight=nil if cargo.type==OPSTRANSPORT.CargoType.OPSGROUP then + -- Get total weight of group. weight=cargo.opsgroup:GetWeightTotal() -- Find a carrier for this cargo. @@ -9582,8 +9583,10 @@ function OPSGROUP:onafterLoad(From, Event, To, CargoGroup, Carrier) -- No carrier provided. if not carrier then + -- Get total weight of group. + local weight=CargoGroup:GetWeightTotal() -- Try to find a carrier manually. - carrier=self:FindCarrierForCargo(CargoGroup) + carrier=self:FindCarrierForCargo(weight) end if carrier then