remove useless code in unit::advance_to

the line above does exactly the same as the line inside that if(){..} so it has no effect.

Also, what the comment says is wrong. We do not want to keep the old recall cost if it is different from the original recall cost because  doing that would break removing objects that change recall cost.
This commit is contained in:
gfgtdf 2018-05-26 14:28:35 +02:00 committed by GitHub
parent e7b2068a44
commit 67d2ee7db0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -955,14 +955,6 @@ void unit::advance_to(const unit_type& u_type, bool use_traits)
max_experience_ = new_type.experience_needed(false);
level_ = new_type.level();
recall_cost_ = new_type.recall_cost();
/* Need to add a check to see if the unit's old cost is equal
to the unit's old unit_type cost first. If it is change the cost
otherwise keep the old cost. */
if(old_type.recall_cost() == recall_cost_) {
recall_cost_ = new_type.recall_cost();
}
alignment_ = new_type.alignment();
max_hit_points_ = new_type.hitpoints();
hp_bar_scaling_ = new_type.hp_bar_scaling();