Show Lua deprecation warnings to chat only in debug mode, but always log them too

This commit is contained in:
Celtic Minstrel 2017-05-22 12:03:50 -04:00
parent 8492e8d639
commit 30caf6149a

View file

@ -277,7 +277,10 @@ end
function helper.deprecate(msg, f)
return function(...)
if msg then
wesnoth.message("warning", msg)
if not message_shown and wesnoth.game_config.debug then
wesnoth.message("warning", msg)
end
wesnoth.log("warn", msg)
-- trigger the message only once
msg = nil
end