CARGO_GROUP

- Fixed issue that units are spawned on top of each other on unboarding.
This commit is contained in:
funkyfranky 2018-07-11 23:27:44 +02:00
parent fda061d8c8
commit 258e3d2921

View File

@ -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 }