#CONTROLLABLE - Make waypoint function a bit more robust

This commit is contained in:
Applevangelist
2026-02-07 16:57:48 +01:00
parent d3ad70b019
commit 7ec43c9913
@@ -2184,7 +2184,8 @@ function CONTROLLABLE:TaskFunction( FunctionString, ... )
local ArgumentKey = '_' .. tostring( arg ):match( "table: (.*)" )
self:SetState( self, ArgumentKey, arg )
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
DCSScript[#DCSScript + 1] = FunctionString .. "( MissionControllable )"
end