mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-18 05:05:56 +00:00
Merge remote-tracking branch 'origin/master-ng' into branch
This commit is contained in:
@@ -3042,6 +3042,14 @@ function RAT:_SetRoute(takeoff, landing, _departure, _destination, _waypoint)
|
|||||||
if landing==RAT.wp.air then
|
if landing==RAT.wp.air then
|
||||||
local vec2=destination:GetRandomVec2()
|
local vec2=destination:GetRandomVec2()
|
||||||
Pdestination=COORDINATE:NewFromVec2(vec2)
|
Pdestination=COORDINATE:NewFromVec2(vec2)
|
||||||
|
elseif destination:IsShip() then
|
||||||
|
-- Crudely predict where the ship will be
|
||||||
|
local _ship = UNIT:FindByName(destination:GetName())
|
||||||
|
local _shipHeading = _ship:GetHeading()
|
||||||
|
Pdestination=destination:GetCoordinate()
|
||||||
|
local _transitTime = Pdeparture:Get2DDistance(Pdestination) / VxCruise
|
||||||
|
Pdestination.x = Pdestination.x + (_ship:GetGroundSpeed() * math.cos(math.rad(_shipHeading)) * _transitTime)
|
||||||
|
Pdestination.z = Pdestination.z + (_ship:GetGroundSpeed() * math.sin(math.rad(_shipHeading)) * _transitTime)
|
||||||
else
|
else
|
||||||
Pdestination=destination:GetCoordinate()
|
Pdestination=destination:GetCoordinate()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2184,7 +2184,8 @@ function CONTROLLABLE:TaskFunction( FunctionString, ... )
|
|||||||
local ArgumentKey = '_' .. tostring( arg ):match( "table: (.*)" )
|
local ArgumentKey = '_' .. tostring( arg ):match( "table: (.*)" )
|
||||||
self:SetState( self, ArgumentKey, arg )
|
self:SetState( self, ArgumentKey, arg )
|
||||||
DCSScript[#DCSScript + 1] = "local Arguments = MissionControllable:GetState( MissionControllable, '" .. ArgumentKey .. "' ) "
|
DCSScript[#DCSScript + 1] = "local Arguments = MissionControllable:GetState( MissionControllable, '" .. ArgumentKey .. "' ) "
|
||||||
DCSScript[#DCSScript + 1] = FunctionString .. "( MissionControllable, unpack( Arguments ) )"
|
--DCSScript[#DCSScript + 1] = FunctionString .. "( MissionControllable, unpack( Arguments ) )"
|
||||||
|
DCSScript[#DCSScript + 1] = FunctionString .. "( MissionControllable, ((type(Arguments)=='table') and unpack(Arguments) or nil))"
|
||||||
else
|
else
|
||||||
DCSScript[#DCSScript + 1] = FunctionString .. "( MissionControllable )"
|
DCSScript[#DCSScript + 1] = FunctionString .. "( MissionControllable )"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user