Reset should reset all upgrades :)

This commit is contained in:
titiger 2021-03-27 20:51:28 +01:00
parent ef313616c8
commit 8cdca11c4f
2 changed files with 8 additions and 1 deletions

View File

@ -3709,7 +3709,7 @@ bool Unit::morph(const MorphCommandType *mct, int frameIndex) {
this->setType(morphUnitType);
Field original_field = this->currField;
this->currField=morphUnitField;
//computeTotalUpgrade(); don't do this here! Its already done in another place
computeTotalUpgrade();
map->putUnitCells(this, this->pos, false, frameIndex < 0);
this->faction->applyDiscount(morphUnitType, mct->getDiscount());

View File

@ -1153,6 +1153,13 @@ void TotalUpgrade::reset() {
boostUpgradeBase = NULL;
boostUpgradeSourceUnit = -1;
boostUpgradeDestUnit = -1;
attackStrengthMultiplierValueList.clear();
moveSpeedIsMultiplierValueList.clear();
prodSpeedProduceIsMultiplierValueList.clear();
prodSpeedUpgradeIsMultiplierValueList.clear();
prodSpeedMorphIsMultiplierValueList.clear();
attackSpeedIsMultiplierValueList.clear();
}
void TotalUpgrade::sum(const UpgradeTypeBase *ut, const Unit *unit, bool boostMode) {