1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fix arrow tower destruction mechanics

This commit is contained in:
Dydzio 2018-03-02 15:23:07 +01:00
parent b55d506e22
commit e68a2e7ef5
2 changed files with 7 additions and 3 deletions

View File

@ -2905,9 +2905,13 @@ std::string CBattleInterface::SiegeHelper::getSiegeName(ui16 what, int state) co
switch (state)
{
case EWallState::INTACT : return 1;
case EWallState::DAMAGED : return 2;
case EWallState::DAMAGED :
if(what == 2 || what == 3 || what == 8) // towers don't have separate image here - INTACT and DAMAGED is 1, DESTROYED is 2
return 1;
else
return 2;
case EWallState::DESTROYED :
if (what == 2 || what == 3 || what == 8) // towers don't have separate image here
if (what == 2 || what == 3 || what == 8)
return 2;
else
return 3;

View File

@ -4362,7 +4362,7 @@ bool CGameHandler::makeBattleAction(BattleAction &ba)
logGlobal->trace("Catapult attacks %d dealing %d damage", (int)attack.attackedPart, (int)attack.damageDealt);
//removing creatures in turrets / keep if one is destroyed
if (attack.damageDealt > 0 && (attackedPart == EWallPart::KEEP ||
if (currentHP.at(attackedPart) - attack.damageDealt <= 0 && (attackedPart == EWallPart::KEEP ||
attackedPart == EWallPart::BOTTOM_TOWER || attackedPart == EWallPart::UPPER_TOWER))
{
int posRemove = -1;