This commit is contained in:
FlightControl
2017-03-25 07:31:47 +01:00
parent 0539ae3b2f
commit 14ca38bc8b
2 changed files with 288 additions and 2 deletions

View File

@@ -244,8 +244,8 @@ function AI_CARGO:New( Type, Name, Weight, ReportRadius, NearRadius )
self.Type = Type
self.Name = Name
self.Weight = Weight
self.ReportRadius = ReportRadius
self.NearRadius = NearRadius
self.ReportRadius = ReportRadius or 1000
self.NearRadius = NearRadius or 200
self.CargoObject = nil
self.CargoCarrier = nil
self.Representable = false
@@ -288,6 +288,20 @@ function AI_CARGO:IsNear( PointVec2 )
end
end
--- Get the current PointVec2 of the cargo.
-- @param #AI_CARGO self
-- @return Core.Point#POINT_VEC2
function AI_CARGO:GetPointVec2()
return self.CargoObject:GetPointVec2()
end
--- Get the range till cargo will board.
-- @param #AI_CARGO self
-- @return #number The range till cargo will board.
function AI_CARGO:GetBoardingRange()
return self.NearRadius
end
end
do -- AI_CARGO_REPRESENTABLE