This fixes issue #433

This commit is contained in:
FlightControl 2017-04-17 18:53:32 +02:00
parent 59c89cab39
commit 469e1a3c9b

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 )