mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
First fixes
This commit is contained in:
@@ -368,14 +368,19 @@ function CONTROLLABLE:SetTask( DCSTask, WaitTime )
|
||||
|
||||
if DCSControllable then
|
||||
|
||||
local DCSControllableName = self:GetName()
|
||||
|
||||
-- When a controllable SPAWNs, it takes about a second to get the controllable in the simulator. Setting tasks to unspawned controllables provides unexpected results.
|
||||
-- Therefore we schedule the functions to set the mission and options for the Controllable.
|
||||
-- Controller.setTask( Controller, DCSTask )
|
||||
|
||||
local function SetTask( Controller, DCSTask )
|
||||
local Controller = self:_GetController()
|
||||
Controller:setTask( DCSTask )
|
||||
if self and self:IsAlive() then
|
||||
local Controller = self:_GetController()
|
||||
Controller:setTask( DCSTask )
|
||||
else
|
||||
error( DCSControllableName .. " is not alive anymore. Cannot set DCSTask " .. DCSTask )
|
||||
end
|
||||
end
|
||||
|
||||
if not WaitTime or WaitTime == 0 then
|
||||
|
||||
Reference in New Issue
Block a user