add error reporting to [insert_tag] if it has no variable= field

The lack of reporting here is somewhat annoying so i patched it.
This commit is contained in:
Chris Beck 2014-06-21 18:13:42 -04:00
parent c7c69f260b
commit 762efc278f

View file

@ -297,6 +297,9 @@ local function handle_event_commands(cfg)
if cmd == "insert_tag" then
cmd = arg.name
local from = arg.variable
if not from then
helper.wml_error("[insert_tag] found with no variable= field")
end
arg = wesnoth.get_variable(from)
if type(arg) ~= "table" then
-- Corner case: A missing variable is replaced