Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Applevangelist 2022-11-05 14:04:39 +01:00
commit d805352a97

View File

@ -740,7 +740,9 @@ function UTILS.RemoveMark(MarkID, Delay)
if Delay and Delay>0 then if Delay and Delay>0 then
TIMER:New(UTILS.RemoveMark, MarkID):Start(Delay) TIMER:New(UTILS.RemoveMark, MarkID):Start(Delay)
else else
trigger.action.removeMark(MarkID) if MarkID then
trigger.action.removeMark(MarkID)
end
end end
end end
@ -2015,6 +2017,22 @@ function UTILS.GenerateLaserCodes()
return jtacGeneratedLaserCodes return jtacGeneratedLaserCodes
end end
--- Ensure the passed object is a table.
-- @param #table Object The object that should be a table.
-- @return #table The object that is a table. Note that if the Object is `#nil` initially, and empty table `{}` is returned.
function UTILS.EnsureTable(Object)
if Object then
if type(Object)~="table" then
Object={Object}
end
else
Object={}
end
return Object
end
--- Function to save an object to a file --- Function to save an object to a file
-- @param #string Path The path to use. Use double backslashes \\\\ on Windows filesystems. -- @param #string Path The path to use. Use double backslashes \\\\ on Windows filesystems.
-- @param #string Filename The name of the file. Existing file will be overwritten. -- @param #string Filename The name of the file. Existing file will be overwritten.