Make an error message more informative.
This commit is contained in:
parent
2c4d41d2a4
commit
560e677293
1 changed files with 11 additions and 9 deletions
20
src/ai.cpp
20
src/ai.cpp
|
@ -371,16 +371,18 @@ bool ai::recruit_usage(const std::string& usage)
|
|||
} else if (usage != "") {
|
||||
//FIXME: This message should be suppressed when WML author
|
||||
//chooses the default recruitment pattern.
|
||||
const std::string warning = "At difficulty level " +
|
||||
state_.sog().difficulty + ", trying to recruit a: " +
|
||||
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 "
|
||||
const std::string warning1 = "At difficulty level " +
|
||||
state_.sog().difficulty + ", trying to recruit a:" +
|
||||
usage + " but no unit of that type (usage=) is"
|
||||
" available. Check the recruit and [ai]"
|
||||
" recruitment_pattern keys for team '" +
|
||||
current_team().name() + "' (";
|
||||
const std::string warning2 = ")"
|
||||
" against the usage key of the"
|
||||
" units in question! Removing invalid"
|
||||
" recruitment_pattern entry and continuing...\n";
|
||||
WRN_AI << warning;
|
||||
lg::wml_error << warning;
|
||||
WRN_AI << warning1 << info_.team_num << warning2;
|
||||
lg::wml_error << warning1 << info_.team_num << warning2;
|
||||
return current_team().remove_recruitment_pattern_entry(usage);
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue