mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Fixed issue with NearRadius.
This commit is contained in:
@@ -242,7 +242,7 @@ do -- CARGO_UNIT
|
|||||||
if not self.CargoInAir then
|
if not self.CargoInAir then
|
||||||
-- If NearRadius is given, then use the given NearRadius, otherwise calculate the NearRadius
|
-- 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.
|
-- 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
|
if self:IsNear( CargoCarrier:GetPointVec2(), NearRadius ) then
|
||||||
self:Load( CargoCarrier, NearRadius, ... )
|
self:Load( CargoCarrier, NearRadius, ... )
|
||||||
else
|
else
|
||||||
@@ -293,7 +293,7 @@ do -- CARGO_UNIT
|
|||||||
|
|
||||||
if CargoCarrier and CargoCarrier:IsAlive() and self.CargoObject and self.CargoObject:IsAlive() then
|
if CargoCarrier and CargoCarrier:IsAlive() and self.CargoObject and self.CargoObject:IsAlive() then
|
||||||
if (CargoCarrier:IsAir() and not CargoCarrier:InAir()) or true 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
|
if self:IsNear( CargoCarrier:GetPointVec2(), NearRadius ) then
|
||||||
self:__Load( 1, CargoCarrier, ... )
|
self:__Load( 1, CargoCarrier, ... )
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user