wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src help.cpp


From: Kristoffer Erlandsson
Subject: [Wesnoth-cvs-commits] wesnoth/src help.cpp
Date: Mon, 30 Aug 2004 13:52:24 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Kristoffer Erlandsson <address@hidden>  04/08/30 17:46:28

Modified files:
        src            : help.cpp 

Log message:
        Fixed the problem with parse errors occuring in the units descriptions. 
Fixed
        empty terrain names occuring in the help system.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/help.cpp.diff?tr1=1.30&tr2=1.31&r1=text&r2=text

Patches:
Index: wesnoth/src/help.cpp
diff -u wesnoth/src/help.cpp:1.30 wesnoth/src/help.cpp:1.31
--- wesnoth/src/help.cpp:1.30   Sun Aug 29 20:33:01 2004
+++ wesnoth/src/help.cpp        Mon Aug 30 17:46:28 2004
@@ -785,7 +785,7 @@
                                        const terrain_type& info = 
map->get_terrain_info(terrain);
                                        if (!info.is_alias()) {
                                                
std::vector<std::pair<std::string, unsigned> > 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 << "<ref>text='" << 
escape(name) << "' dst='"
@@ -853,8 +853,8 @@
                                                                          
(char)gamemap::FOGGED), show_info_about.end());
        for (std::vector<gamemap::TERRAIN>::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 << "<img>src='terrain/" << info.default_image() << 
".png'</img>\n\n";
                if (info.is_alias()) {
@@ -863,7 +863,7 @@
                        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 << "<ref>text='" << escape(alias_name) 
<< "' dst='"
                                                 << 
escape(std::string("terrain_") + t) << "'</ref>";
                                if (it + 2 == aliased_terrains.end()) {
@@ -1357,9 +1357,9 @@
        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);
        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]