From d0c6a9756ca196210588e302d33f26075503a601 Mon Sep 17 00:00:00 2001 From: funkyfranky Date: Sun, 8 Oct 2017 22:56:22 +0200 Subject: [PATCH 1/2] Fixes in cargo --- Moose Development/Moose/Core/Cargo.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Moose Development/Moose/Core/Cargo.lua b/Moose Development/Moose/Core/Cargo.lua index 2f5199abb..f10214bad 100644 --- a/Moose Development/Moose/Core/Cargo.lua +++ b/Moose Development/Moose/Core/Cargo.lua @@ -484,9 +484,11 @@ end -- @param #number NearRadius The radius when the cargo will board the Carrier (to avoid collision). -- @return #boolean function CARGO:IsNear( PointVec2, NearRadius ) - self:F( { PointVec2, NearRadius } ) + self:E( { PointVec2, NearRadius } ) + self:E(self.CargoObject:GetPointVec2()) - local Distance = PointVec2:DistanceFromPointVec2( self.CargoObject:GetPointVec2() ) + --local Distance = PointVec2:DistanceFromPointVec2( self.CargoObject:GetPointVec2() ) + local Distance = PointVec2:Get2DDistance( self.CargoObject:GetPointVec2() ) self:T( Distance ) if Distance <= NearRadius then @@ -869,9 +871,9 @@ function CARGO_UNIT:onenterUnLoaded( From, Event, To, ToPointVec2 ) local StartPointVec2 = self.CargoCarrier:GetPointVec2() local CargoCarrierHeading = self.CargoCarrier:GetHeading() -- Get Heading of object in degrees. local CargoDeployHeading = ( ( CargoCarrierHeading + Angle ) >= 360 ) and ( CargoCarrierHeading + Angle - 360 ) or ( CargoCarrierHeading + Angle ) - local CargoDeployPointVec2 = StartPointVec2:Translate( Distance, CargoDeployHeading ) + local CargoDeployCoord = StartPointVec2:Translate( Distance, CargoDeployHeading ) - ToPointVec2 = ToPointVec2 or POINT_VEC2:New( CargoDeployPointVec2:GetX(), CargoDeployPointVec2:GetY() ) + ToPointVec2 = ToPointVec2 or POINT_VEC2:New( CargoDeployCoord.x, CargoDeployCoord.z ) -- Respawn the group... if self.CargoObject then From 09fd43a3c9d2a029c670ef136bfede43317febd6 Mon Sep 17 00:00:00 2001 From: funkyfranky Date: Sun, 8 Oct 2017 22:58:39 +0200 Subject: [PATCH 2/2] Trace value changed --- Moose Development/Moose/Core/Cargo.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Moose Development/Moose/Core/Cargo.lua b/Moose Development/Moose/Core/Cargo.lua index f10214bad..1dd1bee64 100644 --- a/Moose Development/Moose/Core/Cargo.lua +++ b/Moose Development/Moose/Core/Cargo.lua @@ -484,8 +484,7 @@ end -- @param #number NearRadius The radius when the cargo will board the Carrier (to avoid collision). -- @return #boolean function CARGO:IsNear( PointVec2, NearRadius ) - self:E( { PointVec2, NearRadius } ) - self:E(self.CargoObject:GetPointVec2()) + self:F( { PointVec2, NearRadius } ) --local Distance = PointVec2:DistanceFromPointVec2( self.CargoObject:GetPointVec2() ) local Distance = PointVec2:Get2DDistance( self.CargoObject:GetPointVec2() )