Micro AIs: only display on-screen error messages when in debug mode

This commit is contained in:
mattsc 2014-11-01 07:45:15 -07:00
parent f890aa00a0
commit ada80cfd34
2 changed files with 3 additions and 0 deletions

View file

@ -32,6 +32,7 @@ Version 1.13.0-dev:
* Fix bug in Return Guardian and Goto Micro AIs when there is no path to
the goal hex
* Several fixes of translatable strings in Micro AIs
* Micro AIs: only display on-screen error messages when in debug mode
* Campaigns:
* Changed all occurrences of {FLAG_VARIANT ragged} to {FLAG_VARIANT6 ragged}
* Singleplayer campaign creation now utilizes the create, configure,

View file

@ -127,8 +127,10 @@ end
----- AI execution helper functions ------
function ai_helper.checked_action_error(action, error_code)
if wesnoth.game_config.debug then
wesnoth.message('Lua AI error', 'If you see this message, something has gone wrong. Please report this on the Wesnoth forums, ideally with a replay and/or savegame.')
error(action .. ' could not be executed. Error code: ' .. error_code)
end
end
function ai_helper.checked_attack(ai, attacker, defender, weapon)