Make an error message slightly more useful.

This commit is contained in:
Eric S. Raymond 2008-10-27 18:13:35 +00:00
parent fce50aa29f
commit 634de56f4a

View File

@ -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);