From 258e3d29213f850078742fe2cf776fafc2662da0 Mon Sep 17 00:00:00 2001 From: funkyfranky <> Date: Wed, 11 Jul 2018 23:27:44 +0200 Subject: [PATCH] CARGO_GROUP - Fixed issue that units are spawned on top of each other on unboarding. --- Moose Development/Moose/Cargo/CargoGroup.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Cargo/CargoGroup.lua b/Moose Development/Moose/Cargo/CargoGroup.lua index de8b08e6d..69787e721 100644 --- a/Moose Development/Moose/Cargo/CargoGroup.lua +++ b/Moose Development/Moose/Cargo/CargoGroup.lua @@ -364,9 +364,11 @@ do -- CARGO_GROUP -- @param #string From -- @param #string To function CARGO_GROUP:onenterUnBoarding( From, Event, To, ToPointVec2, NearRadius, ... ) - --self:F( {From, Event, To, ToPointVec2, NearRadius } ) + self:F( {From, Event, To, ToPointVec2, NearRadius } ) NearRadius = NearRadius or 25 + + env.info("FF onenterunboarding") local Timer = 1 @@ -381,7 +383,14 @@ do -- CARGO_GROUP --- @param Cargo.Cargo#CARGO Cargo function( Cargo, NearRadius ) if not Cargo:IsDestroyed() then - Cargo:__UnBoard( Timer, ToPointVec2, NearRadius ) + env.info("FF blubblub") + local ToVec=nil + if ToPointVec2==nil then + ToVec=self.CargoCarrier:GetPointVec2():GetRandomPointVec2InRadius(2*NearRadius, NearRadius) + else + ToVec=ToPointVec2 + end + Cargo:__UnBoard( Timer, ToVec, NearRadius ) Timer = Timer + 3 end end, { NearRadius }