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 commit is contained in:
Ignacio R. Morelle 2008-03-03 14:53:54 +00:00
parent f346d61cd4
commit ef8faeacf4

View file

@ -501,7 +501,12 @@ void unit::advance_to(const unit_type* t, bool use_traits, game_state* state)
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"];