- small bugfix for attack-boost check

This commit is contained in:
Mark Vejvoda 2011-06-25 09:01:31 +00:00
parent c252402e71
commit b0f8675a65

View File

@ -1559,13 +1559,13 @@ void Unit::applyAttackBoost(const AttackBoost *boost, const Unit *source) {
throw runtime_error(szBuf); throw runtime_error(szBuf);
} }
if(boost->isAffected(source, this)) { //if(boost->isAffected(source, this)) {
totalUpgrade.apply(&boost->boostUpgrade); totalUpgrade.apply(&boost->boostUpgrade);
checkItemInVault(&this->hp,this->hp); checkItemInVault(&this->hp,this->hp);
hp += boost->boostUpgrade.getMaxHp(); hp += boost->boostUpgrade.getMaxHp();
addItemToVault(&this->hp,this->hp); addItemToVault(&this->hp,this->hp);
} //}
} }
void Unit::deapplyAttackBoost(const AttackBoost *boost, const Unit *source) { void Unit::deapplyAttackBoost(const AttackBoost *boost, const Unit *source) {
@ -1575,13 +1575,13 @@ void Unit::deapplyAttackBoost(const AttackBoost *boost, const Unit *source) {
throw runtime_error(szBuf); throw runtime_error(szBuf);
} }
if(boost->isAffected(source, this)) { //if(boost->isAffected(source, this)) {
totalUpgrade.deapply(&boost->boostUpgrade); totalUpgrade.deapply(&boost->boostUpgrade);
checkItemInVault(&this->hp,this->hp); checkItemInVault(&this->hp,this->hp);
hp -= boost->boostUpgrade.getMaxHp(); hp -= boost->boostUpgrade.getMaxHp();
addItemToVault(&this->hp,this->hp); addItemToVault(&this->hp,this->hp);
} //}
} }
void Unit::applyUpgrade(const UpgradeType *upgradeType){ void Unit::applyUpgrade(const UpgradeType *upgradeType){