- bugfix when morphing, do a level check to see if the morphed unit should have its level updated based on current kills
This commit is contained in:
parent
d356e5f5de
commit
98351fedba
|
@ -2636,6 +2636,10 @@ void Unit::incKills(int team) {
|
||||||
++enemyKills;
|
++enemyKills;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkUnitLevel();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Unit::checkUnitLevel() {
|
||||||
const Level *nextLevel= getNextLevel();
|
const Level *nextLevel= getNextLevel();
|
||||||
if(nextLevel != NULL && enemyKills >= nextLevel->getKills()) {
|
if(nextLevel != NULL && enemyKills >= nextLevel->getKills()) {
|
||||||
level= nextLevel;
|
level= nextLevel;
|
||||||
|
@ -2680,13 +2684,16 @@ bool Unit::morph(const MorphCommandType *mct){
|
||||||
checkModelStateInfoForNewHpValue();
|
checkModelStateInfoForNewHpValue();
|
||||||
|
|
||||||
type= morphUnitType;
|
type= morphUnitType;
|
||||||
level= NULL;
|
|
||||||
currField=morphUnitField;
|
currField=morphUnitField;
|
||||||
computeTotalUpgrade();
|
computeTotalUpgrade();
|
||||||
map->putUnitCells(this, pos);
|
map->putUnitCells(this, pos);
|
||||||
faction->applyDiscount(morphUnitType, mct->getDiscount());
|
faction->applyDiscount(morphUnitType, mct->getDiscount());
|
||||||
faction->addStore(type);
|
faction->addStore(type);
|
||||||
faction->applyStaticProduction(morphUnitType);
|
faction->applyStaticProduction(morphUnitType);
|
||||||
|
|
||||||
|
level= NULL;
|
||||||
|
checkUnitLevel();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
|
@ -659,6 +659,7 @@ private:
|
||||||
int getFrameCount() const;
|
int getFrameCount() const;
|
||||||
void checkCustomizedParticleTriggers(bool force);
|
void checkCustomizedParticleTriggers(bool force);
|
||||||
bool checkModelStateInfoForNewHpValue();
|
bool checkModelStateInfoForNewHpValue();
|
||||||
|
void checkUnitLevel();
|
||||||
};
|
};
|
||||||
|
|
||||||
}}// end namespace
|
}}// end namespace
|
||||||
|
|
Loading…
Reference in New Issue