From 634de56f4aa5c997424cf8c5aa25da39a2879b8d Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 27 Oct 2008 18:13:35 +0000 Subject: [PATCH] Make an error message slightly more useful. --- src/ai.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ai.cpp b/src/ai.cpp index c8e9e92a69a..001402cda18 100644 --- a/src/ai.cpp +++ b/src/ai.cpp @@ -378,11 +378,16 @@ bool ai::recruit_usage(const std::string& usage) if (found) { LOG_AI << "No available units to recruit that come under the price.\n"; } else if (usage != "") { - const std::string warning = "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 recruitment_pattern " - "entry and continuing...\n"; + //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 " + " recruitment_pattern entry and continuing...\n"; WRN_AI << warning; lg::wml_error << warning; return current_team().remove_recruitment_pattern_entry(usage);