Skip to content

Commit

Permalink
experience modifer no longer applies to [effect]
Browse files Browse the repository at this point in the history
now experience_modifer only changes the unit types xp, it no
longer has an effect on [effect]s that change xp, in particular
it fixes #1796 where a apply_to,increase=max_experience,2 [effect]
added one or two max_experience to a unit dependend on how much
max_experience it had before. This was in particular a problem
because this effect would only behave like this during unit
construction, not when an object is added ([object]).
  • Loading branch information
gfgtdf committed Oct 27, 2018
1 parent 7111887 commit 6c696cd
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/units/unit.cpp
Expand Up @@ -932,7 +932,7 @@ void unit::advance_to(const unit_type& u_type, bool use_traits)
type_name_ = new_type.type_name();
description_ = new_type.unit_description();
undead_variation_ = new_type.undead_variation();
max_experience_ = new_type.experience_needed(false);
max_experience_ = new_type.experience_needed(true);
level_ = new_type.level();
recall_cost_ = new_type.recall_cost();
alignment_ = new_type.alignment();
Expand Down Expand Up @@ -2300,10 +2300,6 @@ void unit::apply_modifications()
add_modification(mod, m, true);
}
}

// Apply the experience acceleration last
int exp_accel = unit_experience_accelerator::get_acceleration();
max_experience_ = std::max<int>(1, (max_experience_ * exp_accel + 50)/100);
}

bool unit::invisible(const map_location& loc, bool see_all) const
Expand Down

0 comments on commit 6c696cd

Please sign in to comment.