From 87c04f51831d9373dec03d17c6fb763b8fd9cb16 Mon Sep 17 00:00:00 2001 From: Kristoffer Erlandsson Date: Mon, 30 Aug 2004 17:46:28 +0000 Subject: [PATCH] Fixed the problem with parse errors occuring in the units descriptions. Fixed empty terrain names occuring in the help system. --- src/help.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/help.cpp b/src/help.cpp index 43802735abc..ed181d792c7 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -785,7 +785,7 @@ std::vector generate_unit_topics() { const terrain_type& info = map->get_terrain_info(terrain); if (!info.is_alias()) { std::vector > row; - const std::string& name = string_table[map->terrain_name(terrain)]; + const std::string &name = info.name(); const int moves = movement_type.movement_cost(*map,terrain); std::stringstream str; str << "text='" << escape(name) << "' dst='" @@ -853,8 +853,8 @@ std::vector generate_terrains_topics() { (char)gamemap::FOGGED), show_info_about.end()); for (std::vector::const_iterator terrain_it = show_info_about.begin(); terrain_it != show_info_about.end(); terrain_it++) { - const std::string& name = string_table[map->terrain_name(*terrain_it)]; const terrain_type& info = map->get_terrain_info(*terrain_it); + const std::string &name = info.name(); std::stringstream ss; ss << "src='terrain/" << info.default_image() << ".png'\n\n"; if (info.is_alias()) { @@ -863,7 +863,7 @@ std::vector generate_terrains_topics() { for (std::string::const_iterator it = aliased_terrains.begin(); it != aliased_terrains.end(); it++) { const gamemap::TERRAIN t = *it; - const std::string alias_name = string_table[map->terrain_name(t)]; + const std::string alias_name = map->get_terrain_info(t).name(); alias_ss << "text='" << escape(alias_name) << "' dst='" << escape(std::string("terrain_") + t) << "'"; if (it + 2 == aliased_terrains.end()) { @@ -1357,9 +1357,9 @@ void help_text_area::handle_ref_cfg(const config &cfg) { if (find_topic(toplevel_, dst) == NULL && !force) { show_ref = false; } - if (dst == "" || text == "") { + if (dst == "") { std::string msg = - "Ref markup must have both dst and text attributes. Please submit a bug report if you have not modified the game files yourself. Errornous config: "; + "Ref markup must have dst attribute. Please submit a bug report if you have not modified the game files yourself. Errornous config: "; msg += cfg.write(); throw parse_error(msg); }