From c4468a7add9692d894bd3d9071a7cdcaa1dfaa8f Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Mon, 5 Apr 2010 05:59:32 +0000 Subject: [PATCH] Removed usage of config::get_children_deprecated. --- src/unit.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/unit.cpp b/src/unit.cpp index 00daa159233..dbcb1821ff1 100644 --- a/src/unit.cpp +++ b/src/unit.cpp @@ -1066,14 +1066,14 @@ void unit::remove_temporary_modifications() for(unsigned int i = 0; i != NumModificationTypes; ++i) { const std::string& mod_name = ModificationTypes[i]; - const config::child_list& mods = modifications_.get_children_deprecated(mod_name); - for(size_t j = 0; j != mods.size(); ++j) { - const config& mod = *mods[j]; - if(mod["duration"] != "forever" && mod["duration"] != "") { + for (int j = modifications_.child_count(mod_name) - 1; j >= 0; ++j) + { + const config &mod = modifications_.child(mod_name, j); + if (mod["duration"] != "forever" && !mod["duration"].empty()) { if(mod.has_attribute("prev_type")) { type_ = mod["prev_type"]; } - modifications_.remove_child(mod_name, j--); + modifications_.remove_child(mod_name, j); rebuild_from_type = true; } }