mail[Wesnoth-commits] r43163 - in /trunk/src: gamestatus.cpp team.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by alinktomine on June 03, 2010 - 20:15:
Author: alink
Date: Thu Jun  3 20:15:53 2010
New Revision: 43163

URL: http://svn.gna.org/viewcvs/wesnoth?rev=43163&view=rev
Log:
Log WML error for "colour" in [side] (deprecated in 1.9.2)

Modified:
    trunk/src/gamestatus.cpp
    trunk/src/team.cpp

Modified: trunk/src/gamestatus.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gamestatus.cpp?rev=43163&r1=43162&r2=43163&view=diff
==============================================================================
--- trunk/src/gamestatus.cpp (original)
+++ trunk/src/gamestatus.cpp Thu Jun  3 20:15:53 2010
@@ -230,7 +230,11 @@
                                }
                                (*scenario_side)["name"] = 
carryover_side["name"];
                                (*scenario_side)["current_player"] = 
carryover_side["current_player"];
-                               (*scenario_side)["color"] = 
carryover_side.get_old_attribute("color","colour");
+
+                               //@todo 1.9.2
+                               const std::string colour_error = "Usage of 
'colour' in [side] is deprecated, support will be removed in 1.9.2.\n";
+                               (*scenario_side)["color"] = 
carryover_side.get_old_attribute("color","colour",colour_error);
+
                                //add recallable units
                                foreach (const config &u, 
carryover_side.child_range("unit")) {
                                        scenario_side->add_child("unit", u);

Modified: trunk/src/team.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/team.cpp?rev=43163&r1=43162&r2=43163&view=diff
==============================================================================
--- trunk/src/team.cpp (original)
+++ trunk/src/team.cpp Thu Jun  3 20:15:53 2010
@@ -75,10 +75,17 @@
                no_leader(cfg["no_leader"].to_bool()),
                hidden(cfg["hidden"].to_bool()),
                music(cfg["music"]),
-               color(cfg.has_old_attribute("color","colour") ? 
cfg.get_old_attribute("color","colour") : cfg["side"]),
+               color(),
                side(cfg["side"].to_int(1)),
                persistent(false)
 {
+       //@todo 1.9.2
+       const std::string colour_error = "Usage of 'colour' in [side] is 
deprecated, support will be removed in 1.9.2.\n";
+       if(cfg.has_old_attribute("color","colour",colour_error))
+               color = cfg.get_old_attribute("color","colour").str();
+       else
+               color = cfg["side"].str();
+
        // If arel starting new scenario overide settings from [ai] tags
        if (!user_team_name.translatable())
                user_team_name = t_string::from_serialized(user_team_name);




Related Messages


Powered by MHonArc, Updated Thu Jun 03 20:40:08 2010