mail[Wesnoth-commits] r33576 - in /trunk: changelog src/unit_types.cpp


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

Header


Content

Posted by joerg . hinrichs on March 12, 2009 - 22:38:
Author: jhinrichs
Date: Thu Mar 12 22:38:29 2009
New Revision: 33576

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33576&view=rev
Log:
Fixes bug #13176 (advancefrom tag ignores experience requirement) and removes 
some no longer needed debug messages.

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

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=33576&r1=33575&r2=33576&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Thu Mar 12 22:38:29 2009
@@ -1,4 +1,4 @@
-Version 1.5.13+svn:
+Version 1.5.13+svn:
  * Graphics:
    * New portrait for the female Assassin, Gryphon Rider, longbowman.
  * Language and i18n:
@@ -11,6 +11,7 @@
    * Fixed bug #13161: Inactive weapon special name and description not used
  * Miscellaneous and bug fixes:
    * Fix another campaign replay bug (#13139)
+   * Fix WML [advancefrom] bug (#13176)
 
 Version 1.5.13:
  * Graphics:

Modified: trunk/src/unit_types.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_types.cpp?rev=33576&r1=33575&r2=33576&view=diff
==============================================================================
--- trunk/src/unit_types.cpp (original)
+++ trunk/src/unit_types.cpp Thu Mar 12 22:38:29 2009
@@ -574,7 +574,6 @@
        build_status_(NOT_BUILT),
        portraits_()
 {
-    DBG_UT << "unit_type default constructor\n";
        gender_types_[0] = NULL;
        gender_types_[1] = NULL;
 }
@@ -615,7 +614,6 @@
     build_status_(o.build_status_),
        portraits_(o.portraits_)
 {
-    DBG_UT << "unit_type copy-constructor\n";
        gender_types_[0] = o.gender_types_[0] != NULL ? new 
unit_type(*o.gender_types_[0]) : NULL;
        gender_types_[1] = o.gender_types_[1] != NULL ? new 
unit_type(*o.gender_types_[1]) : NULL;
 
@@ -663,13 +661,11 @@
        build_status_(NOT_BUILT),
        portraits_()
 {
-    DBG_UT << "unit_type constructor cfg, mv_types, races, traits\n";
        build_full(cfg, mv_types, races, traits);
 }
 
 unit_type::~unit_type()
 {
-    DBG_UT << "unit_type destructor\n";
     if (gender_types_[unit_race::MALE] != NULL)
         delete gender_types_[unit_race::MALE];
     if (gender_types_[unit_race::FEMALE] != NULL)
@@ -775,8 +771,6 @@
        else{
            DBG_UT << "no parent found for movement_type " << move_type << 
"\n";
        }
-
-       experience_needed_=lexical_cast_default<int>(cfg["experience"],500);
 
        flag_rgb_ = cfg["flag_rgb"];
        game_config::add_color_info(cfg);
@@ -920,7 +914,9 @@
         advances_to_ = utils::split(advances_to_val);
     DBG_UT << "unit_type '" << id_ << "' advances to : " << advances_to_val 
<< "\n";
 
-    build_status_ = CREATED;
+       experience_needed_=lexical_cast_default<int>(cfg["experience"],500);
+       
+       build_status_ = CREATED;
 }
 
 const unit_type& unit_type::get_gender_unit_type(unit_race::GENDER gender) 
const
@@ -1103,7 +1099,10 @@
                return;
        }
 
-       if(xp>0 && experience_needed_>xp) experience_needed_=xp;
+       if( xp > 0 && experience_needed_ > xp){
+        DBG_UT << "Lowering experience_needed from " << experience_needed_ 
<< " to " << xp << " due to [advancefrom] of " << to_id << "\n";
+               experience_needed_ = xp;
+       }
 
        // Add advancements to gendered subtypes, if supported by to_unit
        for(int gender=0; gender<=1; ++gender) {




Related Messages


Powered by MHonArc, Updated Thu Mar 12 23:00:15 2009