Added a deprecation helper.

This commit is contained in:
Guillaume Melquiond 2010-10-03 13:30:37 +00:00
parent 930cd8fe63
commit 406383792f

View file

@ -310,4 +310,15 @@ function helper.rand (possible_values)
return result return result
end end
function helper.deprecate(msg, f)
return function(...)
if msg then
wesnoth.message("WML warning", msg)
-- trigger the message only once
msg = nil
end
return f(...)
end
end
return helper return helper