mail[Wesnoth-commits] r24329 - in /branches/1.4/src: game.cpp gamestatus.cpp multiplayer_wait.cpp


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

Header


Content

Posted by shadowm2006 on March 05, 2008 - 18:22:
Author: shadowmaster
Date: Wed Mar  5 18:22:35 2008
New Revision: 24329

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24329&view=rev
Log:
- Reflects changes of r24327 (backport to 1.4). This is supposed to fix
  issues with canrecruit="yes". Currently the engine checked in most
locations only for canrecruit == "0" or "1", and skipped the standard
WML boolean syntax (which is achieved with utils::string_bool()).

- Code which already did assignments of the canrecruit attribute to 0 or
  1 have been left untouched; they should still work

Modified:
    branches/1.4/src/game.cpp
    branches/1.4/src/gamestatus.cpp
    branches/1.4/src/multiplayer_wait.cpp

Modified: branches/1.4/src/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.4/src/game.cpp?rev=24329&r1=24328&r2=24329&view=diff
==============================================================================
--- branches/1.4/src/game.cpp (original)
+++ branches/1.4/src/game.cpp Wed Mar  5 18:22:35 2008
@@ -55,6 +55,7 @@
 #include "serialization/binary_wml.hpp"
 #include "serialization/parser.hpp"
 #include "serialization/preprocessor.hpp"
+#include "serialization/string_utils.hpp"
 #include "sha1.hpp"
 
 #ifdef HAVE_PYTHON

Modified: branches/1.4/src/gamestatus.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.4/src/gamestatus.cpp?rev=24329&r1=24328&r2=24329&view=diff
==============================================================================
--- branches/1.4/src/gamestatus.cpp (original)
+++ branches/1.4/src/gamestatus.cpp Wed Mar  5 18:22:35 2008
@@ -964,7 +964,7 @@
 
                        const config::child_list& units = 
(**s).get_children("unit");
                        for(config::child_list::const_iterator u = 
units.begin(); u != units.end(); ++u) {
-                               if((**u)["canrecruit"] == "1") {
+                               if(utils::string_bool( (**u)["canrecruit"], 
false) == true) {
                                        leader = (**u)["id"];
                                        break;
                                }
@@ -1022,7 +1022,7 @@
        const config::child_list& players = cfg_save.get_children("player");
 
        for(config::child_list::const_iterator i = players.begin(); i != 
players.end(); ++i) {
-               if ((**i)["canrecruit"] == "1"){
+               if (utils::string_bool( (**i)["canrecruit"], false) == true){
                        leader = (**i)["save_id"];
                }
        }
@@ -1045,7 +1045,7 @@
 
                                const config::child_list& units = 
(**s).get_children("unit");
                                for(config::child_list::const_iterator u = 
units.begin(); u != units.end(); ++u) {
-                                       if((**u)["canrecruit"] == "1") {
+                                       if(utils::string_bool( 
(**u)["canrecruit"], false) == true) {
                                                leader = (**u)["id"];
                                                break;
                                        }

Modified: branches/1.4/src/multiplayer_wait.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.4/src/multiplayer_wait.cpp?rev=24329&r1=24328&r2=24329&view=diff
==============================================================================
--- branches/1.4/src/multiplayer_wait.cpp (original)
+++ branches/1.4/src/multiplayer_wait.cpp Wed Mar  5 18:22:35 2008
@@ -455,7 +455,7 @@
                // saves.
                config::const_child_itors side_units = sd.child_range("unit");
                for(;side_units.first != side_units.second; 
++side_units.first) {
-                       if((**side_units.first)["canrecruit"] == "1") {
+                       
if(utils::string_bool((**side_units.first)["canrecruit"], false)) {
                                leader_type = (**side_units.first)["type"];
                                break;
                        }




Related Messages


Powered by MHonArc, Updated Wed Mar 05 18:41:03 2008