Skip to content

Commit cd7178c

Browse files
committed
Updated for DCS 2.8.5.40170 Data.lua changes
1 parent 782e151 commit cd7178c

File tree

1 file changed

+9
-3
lines changed
  • DCS-Input-Command-Injector-Quaggles/DCS-Input-Command-Injector-Quaggles/Scripts/Input

1 file changed

+9
-3
lines changed

DCS-Input-Command-Injector-Quaggles/DCS-Input-Command-Injector-Quaggles/Scripts/Input/Data.lua

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -876,9 +876,15 @@ local function loadDeviceProfileDiffFromFile_(filename)
876876
local func, err = loadfile(filename)
877877

878878
if func then
879-
printFileLog('File[' .. filename .. '] opened successfully!')
880-
881-
return func()
879+
local env = {}
880+
setfenv(func, env)
881+
local ok, res = pcall(func)
882+
if ok then
883+
printFileLog('File[' .. filename .. '] opened successfully!')
884+
return res
885+
else
886+
log.error('Input Error:' ..res)
887+
end
882888
else
883889
printFileLog(err)
884890
end

0 commit comments

Comments
 (0)