From 3275fd2e5bb81be770eb950927a4c6f7d969f583 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Wed, 26 Sep 2018 21:16:47 +0200 Subject: [PATCH] Fixed issue with NearRadius. --- Moose Development/Moose/Cargo/CargoUnit.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Cargo/CargoUnit.lua b/Moose Development/Moose/Cargo/CargoUnit.lua index f499fb7a8..bb3df8657 100644 --- a/Moose Development/Moose/Cargo/CargoUnit.lua +++ b/Moose Development/Moose/Cargo/CargoUnit.lua @@ -242,7 +242,7 @@ do -- CARGO_UNIT if not self.CargoInAir then -- If NearRadius is given, then use the given NearRadius, otherwise calculate the NearRadius -- based upon the Carrier bounding radius, which is calculated from the bounding rectangle on the Y axis. - local NearRadius = CargoCarrier:GetBoundingRadius( NearRadius ) + 5 + local NearRadius = NearRadius or CargoCarrier:GetBoundingRadius( NearRadius ) + 5 if self:IsNear( CargoCarrier:GetPointVec2(), NearRadius ) then self:Load( CargoCarrier, NearRadius, ... ) else @@ -293,7 +293,7 @@ do -- CARGO_UNIT if CargoCarrier and CargoCarrier:IsAlive() and self.CargoObject and self.CargoObject:IsAlive() then if (CargoCarrier:IsAir() and not CargoCarrier:InAir()) or true then - local NearRadius = CargoCarrier:GetBoundingRadius( NearRadius ) + 5 + local NearRadius = NearRadius or CargoCarrier:GetBoundingRadius( NearRadius ) + 5 if self:IsNear( CargoCarrier:GetPointVec2(), NearRadius ) then self:__Load( 1, CargoCarrier, ... ) else