mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-04 22:43:17 +00:00
Make an error message slightly more useful.
This commit is contained in:
parent
fce50aa29f
commit
634de56f4a
15
src/ai.cpp
15
src/ai.cpp
@ -378,11 +378,16 @@ bool ai::recruit_usage(const std::string& usage)
|
|||||||
if (found) {
|
if (found) {
|
||||||
LOG_AI << "No available units to recruit that come under the price.\n";
|
LOG_AI << "No available units to recruit that come under the price.\n";
|
||||||
} else if (usage != "") {
|
} else if (usage != "") {
|
||||||
const std::string warning = "Trying to recruit a: " + usage + " but no "
|
//FIXME: This message should be suppressed when WML author
|
||||||
"unit of that type (usage=) is available. Check the recruit and "
|
//chooses the default recruitment pattern.
|
||||||
"[ai] recruitment_pattern keys for team '" + current_team().name() + "' against the usage key "
|
const std::string warning = "At difficulty level " +
|
||||||
"of the units in question! Removing invalid recruitment_pattern "
|
state_.sog().difficulty + ", trying to recruit a: " +
|
||||||
"entry and continuing...\n";
|
usage + " but no unit of that type (usage=) is "
|
||||||
|
"available. Check the recruit and [ai] "
|
||||||
|
"recruitment_pattern keys for team '" +
|
||||||
|
current_team().name() + "' against the usage key of the"
|
||||||
|
"units in question! Removing invalid "
|
||||||
|
" recruitment_pattern entry and continuing...\n";
|
||||||
WRN_AI << warning;
|
WRN_AI << warning;
|
||||||
lg::wml_error << warning;
|
lg::wml_error << warning;
|
||||||
return current_team().remove_recruitment_pattern_entry(usage);
|
return current_team().remove_recruitment_pattern_entry(usage);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user