mail[Wesnoth-commits] r24307 - in /trunk: changelog src/unit.cpp


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

Header


Content

Posted by esr on March 04, 2008 - 21:18:
Author: esr
Date: Tue Mar  4 21:18:29 2008
New Revision: 24307

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24307&view=rev
Log:
Address bug #11197 ([unit] spawning of Elvish Druid et al doesn't set genders 
properly).  
This fix should be backported to 1.4.

Modified:
    trunk/changelog
    trunk/src/unit.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=24307&r1=24306&r2=24307&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Tue Mar  4 21:18:29 2008
@@ -9,10 +9,11 @@
      movetypes.  Note!  This will create compatibility issues with UMC
      that relies on a grassland= in a movetype or [defense] tag to also
      set stats for roads.
- * miscellaneous and bug fixes:
    * remove an ancient wml update program which has been obsoleted by wmllint
    * added the boost regex dependency
    * added the sdl-ttf dependency
+   * default gender selection now works correctly for units with
+     only a female variant.  Fixes bug #11197.
 
 Version 1.4:
  * language and i18n:

Modified: trunk/src/unit.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=24307&r1=24306&r2=24307&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Tue Mar  4 21:18:29 2008
@@ -1174,7 +1174,7 @@
        max_experience_ = lexical_cast_default<int>(cfg["max_experience"]);
        /* */
 
-       if(utils::string_bool(cfg_["random_gender"], false)) {
+       if(cfg["gender"].empty()) {
                const game_data::unit_type_map::const_iterator ut = 
gamedata_->unit_types.find(cfg["type"]);
                //! @todo FIXME shadowmaster: in my opinion, the following 
condition check
                //! should be done earlier in this function as it is repated 
later for other
@@ -1184,7 +1184,7 @@
                //! the config obj. Not sure if that would be wanted; can the 
engine handle units
                //! that don't have an equivalent unit_type obj associated?
                if (ut != gamedata_->unit_types.end())
-                       gender_ = generate_gender(ut->second, true, state);
+                       gender_ = generate_gender(ut->second, 
utils::string_bool(cfg_["random_gender"], false), state);
                else
                        ERR_UT << "no valid unit_type found for unit WML id 
\"" << cfg["type"] << "\"!\n";
        } else {




Related Messages


Powered by MHonArc, Updated Tue Mar 04 21:40:48 2008