1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

fixed manual control for arrow towers

This commit is contained in:
Henning Koehler 2017-09-05 00:30:43 +12:00
parent bbc087b723
commit 31ca4db8bd
2 changed files with 9 additions and 2 deletions

View File

@ -579,6 +579,12 @@
"type" : "MANUAL_CONTROL",
"val" : 100,
"valueType" : "BASE_NUMBER"
},
"ctrl2" : {
"subtype" : "creature.arrowTower",
"type" : "MANUAL_CONTROL",
"val" : 100,
"valueType" : "BASE_NUMBER"
}
}
},

View File

@ -5797,9 +5797,10 @@ void CGameHandler::runBattle()
}
const CGHeroInstance * curOwner = battleGetOwnerHero(next);
const int stackCreatureId = next->getCreature()->idNumber;
if ((next->position < 0 || next->getCreature()->idNumber == CreatureID::BALLISTA) //arrow turret or ballista
&& (!curOwner || getRandomGenerator().nextInt(99) >= curOwner->valOfBonuses(Bonus::MANUAL_CONTROL, CreatureID::BALLISTA)))
if ((stackCreatureId == CreatureID::ARROW_TOWERS || stackCreatureId == CreatureID::BALLISTA)
&& (!curOwner || getRandomGenerator().nextInt(99) >= curOwner->valOfBonuses(Bonus::MANUAL_CONTROL, stackCreatureId)))
{
BattleAction attack;
attack.actionType = Battle::SHOOT;