From fd939cee76c47207db73f71a8194a3d2611f7252 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Tue, 23 Feb 2016 10:05:08 -0500 Subject: [PATCH] Unit filters: move name warning to constructor and suggest alternatives --- src/unit_filter.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/unit_filter.cpp b/src/unit_filter.cpp index 07779c297683..77924f644378 100644 --- a/src/unit_filter.cpp +++ b/src/unit_filter.cpp @@ -116,6 +116,12 @@ class basic_unit_filter_impl : public unit_filter_abstract_impl { , cond_children_() , cond_child_types_() { + // We don't support name= becasue it causes OOS since it depends on the translations + // It is for example possible that 2 units have the same name in one lanugage but not in another + // Also note that translations are currently broken in mp (see this http://gna.org/bugs/?22918 and related bugreports) + if (!vcfg["name"].empty()) { + ERR_CF << "'name' is not supported in standard unit filters - use 'id' or 'role' instead.\n"; + } // Handle [and], [or], and [not] with in-order precedence vconfig::all_children_iterator cond = vcfg.ordered_begin(); vconfig::all_children_iterator cond_end = vcfg.ordered_end(); @@ -231,12 +237,6 @@ bool basic_unit_filter_impl::matches(const unit & u, const map_location& loc, co bool basic_unit_filter_impl::internal_matches_filter(const unit & u, const map_location& loc) const { - //We don't support name= becasue it casues oos since it depends on the translations - //It is for example possible that 2 units have the same name in one lanugage but not in aother - //Also note that translations are currently broken in mp (see this http://gna.org/bugs/?22918 and related bugreports) - if (!vcfg["name"].empty()) { - ERR_CF << "'name' is not supported in standart unit filters\n"; - } if (!vcfg["id"].empty()) { std::vector id_list = utils::split(vcfg["id"]); if (std::find(id_list.begin(), id_list.end(), u.id()) == id_list.end()) {