mirror of
https://github.com/glest/glest-source.git
synced 2025-08-21 07:31:21 +02:00
- 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:
@@ -2636,6 +2636,10 @@ void Unit::incKills(int team) {
|
||||
++enemyKills;
|
||||
}
|
||||
|
||||
checkUnitLevel();
|
||||
}
|
||||
|
||||
void Unit::checkUnitLevel() {
|
||||
const Level *nextLevel= getNextLevel();
|
||||
if(nextLevel != NULL && enemyKills >= nextLevel->getKills()) {
|
||||
level= nextLevel;
|
||||
@@ -2680,13 +2684,16 @@ bool Unit::morph(const MorphCommandType *mct){
|
||||
checkModelStateInfoForNewHpValue();
|
||||
|
||||
type= morphUnitType;
|
||||
level= NULL;
|
||||
currField=morphUnitField;
|
||||
computeTotalUpgrade();
|
||||
map->putUnitCells(this, pos);
|
||||
faction->applyDiscount(morphUnitType, mct->getDiscount());
|
||||
faction->addStore(type);
|
||||
faction->applyStaticProduction(morphUnitType);
|
||||
|
||||
level= NULL;
|
||||
checkUnitLevel();
|
||||
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
|
@@ -659,6 +659,7 @@ private:
|
||||
int getFrameCount() const;
|
||||
void checkCustomizedParticleTriggers(bool force);
|
||||
bool checkModelStateInfoForNewHpValue();
|
||||
void checkUnitLevel();
|
||||
};
|
||||
|
||||
}}// end namespace
|
||||
|
Reference in New Issue
Block a user