Merge pull request #436 from FlightControl-Master/master-353-task-cargo-transport

Master 353 task cargo transport
This commit is contained in:
Sven Van de Velde 2017-04-17 18:54:39 +02:00 committed by GitHub
commit 83dd39d318

View File

@ -697,7 +697,7 @@ function CARGO_UNIT:onenterBoarding( From, Event, To, CargoCarrier, NearRadius,
NearRadius = NearRadius or 25
if From == "UnLoaded" then
if From == "UnLoaded" or From == "Boarding" then
local CargoCarrierPointVec2 = CargoCarrier:GetPointVec2()
local CargoCarrierHeading = CargoCarrier:GetHeading() -- Get Heading of object in degrees.
local CargoDeployHeading = ( ( CargoCarrierHeading + Angle ) >= 360 ) and ( CargoCarrierHeading + Angle - 360 ) or ( CargoCarrierHeading + Angle )
@ -709,25 +709,6 @@ function CARGO_UNIT:onenterBoarding( From, Event, To, CargoCarrier, NearRadius,
Points[#Points+1] = PointStartVec2:RoutePointGround( Speed )
Points[#Points+1] = CargoDeployPointVec2:RoutePointGround( Speed )
-- I need to do this mess, otherwise the units will stop boarding at a point in time...
-- This is a DCS bug that i am handling in this way.
do
local CargoBooardPointVec2 = CargoDeployPointVec2:GetRandomPointVec2InRadius(NearRadius,0)
Points[#Points+1] = CargoBooardPointVec2:RoutePointGround( Speed )
end
do
local CargoBooardPointVec2 = CargoDeployPointVec2:GetRandomPointVec2InRadius(NearRadius,0)
Points[#Points+1] = CargoBooardPointVec2:RoutePointGround( Speed )
end
do
local CargoBooardPointVec2 = CargoDeployPointVec2:GetRandomPointVec2InRadius(NearRadius,0)
Points[#Points+1] = CargoBooardPointVec2:RoutePointGround( Speed )
end
do
local CargoBooardPointVec2 = CargoDeployPointVec2:GetRandomPointVec2InRadius(NearRadius,0)
Points[#Points+1] = CargoBooardPointVec2:RoutePointGround( Speed )
end
local TaskRoute = self.CargoObject:TaskRoute( Points )
self.CargoObject:SetTask( TaskRoute, 2 )