Author: sapient
Date: Mon Sep 15 07:58:31 2008
New Revision: 29469
URL: http://svn.gna.org/viewcvs/wesnoth?rev=29469&view=rev
Log:
Fixed a bug where the old unit type's abilities and attacks weren't completely
cleared during level-up
(example, sorceress with +4 heal)
Modified:
trunk/changelog
trunk/src/unit.cpp
Modified: trunk/changelog
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=29469&r1=29468&r2=29469&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Mon Sep 15 07:58:31 2008
@@ -11,6 +11,8 @@
* Fixed the list of the unit's attacks getting cut off in the right panel
(bug #12297).
* Fixed wesnoth not to try to add duplicate ids to unit_map
+ * Fixed a bug where the old unit type's abilities and attacks weren't
+ completely cleared during level-up
Version 1.5.4:
* Editor2:
Modified: trunk/src/unit.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=29469&r1=29468&r2=29469&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Mon Sep 15 07:58:31 2008
@@ -706,10 +706,13 @@
t = &t->get_gender_unit_type(gender_).get_variation(variation_);
reset_modifications();
- // Remove old animations
+ // Remove old type's halo, animations, abilities, and attacks
+ cfg_["halo"] = "";
foreach(const std::string& tag_name, unit_animation::all_tag_names()) {
cfg_.clear_children(tag_name);
}
+ cfg_.clear_children("abilities");
+ cfg_.clear_children("attacks");
if(t->movement_type().get_parent()) {
cfg_.merge_with(t->movement_type().get_parent()->get_cfg());
@@ -723,8 +726,6 @@
}
}
- // we don't want to inherit our previous type's halo
- cfg_["halo"] = "";
cfg_.merge_with(t->cfg_);
if (!specific_profile.empty()) {
cfg_["profile"] = specific_profile;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits