Author: sapient
Date: Sun Jun 29 07:21:37 2008
New Revision: 27577

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27577&view=rev
Log:
correction to r27544 - apply traits and modifications to attacks in unit::read()

note: this code needs an overhaul! The "real" max hitpoints, etc should be 
stored in unit::write and WML changes to these should be allowed to override 
the calculated values in unit::read. Also the _b_ variables in unit.cpp/hpp 
should be removed and reference the unit_type directly when a "base" value is 
needed. 

Modified:
    trunk/src/unit.cpp

Modified: trunk/src/unit.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=27577&r1=27576&r2=27577&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Sun Jun 29 07:21:37 2008
@@ -1300,10 +1300,11 @@
        //dont use the unit_type's attacks if this config has its own defined
        config::const_child_itors attack_cfg_range = cfg.child_range("attack");
        if(attack_cfg_range.first != attack_cfg_range.second) {
-               attacks_.clear();
+               attacks_b_.clear();
                do {
-                       
attacks_.push_back(attack_type(**attack_cfg_range.first));
+                       
attacks_b_.push_back(attack_type(**attack_cfg_range.first));
                } while(++attack_cfg_range.first != attack_cfg_range.second);
+               apply_modifications();
        }
        cfg_.clear_children("attack");
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to