Files
factorio-scenario-ExpCluster/locale/StdLib/core.lua
2017-07-01 17:20:18 +01:00

16 lines
370 B
Lua

--- Core module
-- @module Core
Core = {} --luacheck: allow defined top
--- Errors if the variable evaluates to false, with an optional msg
-- @param var variable to evaluate
-- @tparam[opt='missing value'] string msg message
function Core.fail_if_missing(var, msg)
if not var then
error(msg or "Missing value", 3)
end
return false
end
return Core