fixup! Improve error message when Lua config helper functions are not passed a config as the first argument

This commit is contained in:
Celtic Minstrel 2017-02-28 19:15:57 -05:00
parent 4849756835
commit 80cdac5b89

View file

@ -40,7 +40,7 @@ local function ensure_config(cfg)
return true
end
if type(cfg) == 'userdata' then
if getmetatable(cfg) == 'vconfig' then return true end
if getmetatable(cfg) == 'wml object' then return true end
helper.wml_error("Expected a config or vconfig but got " .. getmetatable(cfg))
else
helper.wml_error("Expected a config or vconfig but got " .. type(cfg))