Author: shadowmaster
Date: Mon Mar 3 16:37:44 2008
New Revision: 24271
URL: http://svn.gna.org/viewcvs/wesnoth?rev=24271&view=rev
Log:
* Fix probably the oldest bug ever; unit advancement may consider female units'
generic profile a custom one due to a flaw (i.e. happens currently with female
Elvish Archer portraits; they are conserved along the entire unit tree).
This reflects commit of r24270 on the 1.4 branch. Note that both also
prevent the same thing to happen with variation-specific portraits.
There is no test case for such situation in mainline yet.
Modified:
trunk/src/unit.cpp
Modified: trunk/src/unit.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=24271&r1=24270&r2=24271&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Mon Mar 3 16:37:44 2008
@@ -496,12 +496,17 @@
if(t->movement_type().get_parent()) {
cfg_.merge_with(t->movement_type().get_parent()->get_cfg());
}
- // If unit has specific profile, remember it and have it after advaces
+ // If unit has specific profile, remember it and keep it after advancing
bool specific_profile = false;
std::string profile;
if (type() != NULL)
{
- specific_profile = (cfg_["profile"] != type()->cfg_["profile"]);
+ // Update 2008-02-23 by Shadowmaster: make the test for
specific profile take
+ // into account advancing unit's gender and variation to avoid
issues like in Elvish Archer+female, which
+ // was considering its profile as "specific" when advancing, as
it isn't the same as the
+ // male profile
+ specific_profile = (cfg_["profile"] !=
type()->get_gender_unit_type(gender_).get_variation(variation_).cfg_["profile"]);
+
if (specific_profile)
{
profile = cfg_["profile"];
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits