Reworking cargo

This commit is contained in:
FlightControl
2018-09-05 06:03:56 +02:00
parent ed3345b00a
commit 81b0c3a050
12 changed files with 1874 additions and 412 deletions

View File

@@ -285,15 +285,16 @@ do -- CARGO_UNIT
-- @param Wrapper.Client#CLIENT CargoCarrier
-- @param #number NearRadius Default 25 m.
function CARGO_UNIT:onafterBoarding( From, Event, To, CargoCarrier, NearRadius, ... )
--self:F( { From, Event, To, CargoCarrier.UnitName, NearRadius } )
self:F( { From, Event, To, CargoCarrier:GetName() } )
if CargoCarrier and CargoCarrier:IsAlive() and self.CargoObject and self.CargoObject:IsAlive() then
if CargoCarrier:InAir() == false then
if (CargoCarrier:IsAir() and not CargoCarrier:InAir()) or true then
local NearRadius = CargoCarrier:GetBoundingRadius( NearRadius ) + 5
if self:IsNear( CargoCarrier:GetPointVec2(), NearRadius ) then
self:__Load( 1, CargoCarrier, ... )
else
self:__Boarding( -1, CargoCarrier, NearRadius, ... )
self:__Boarding( -5, CargoCarrier, NearRadius, ... )
self.RunCount = self.RunCount + 1
if self.RunCount >= 40 then
self.RunCount = 0