|
|
@@ -875,8 +875,7 @@ void CGameHandler::applyBattleEffects(BattleAttack &bat, const CStack *att, cons
|
|
|
bsa.flags |= BattleStackAttacked::SECONDARY; //all other targets do not suffer from spells & spell-like abilities
|
|
|
bsa.attackerID = att->ID;
|
|
|
bsa.stackAttacked = def->ID;
|
|
|
- bsa.damageAmount = gs->curB->calculateDmg(att, def, gs->curB->battleGetOwner(att), gs->curB->battleGetOwner(def),
|
|
|
- bat.shot(), distance, bat.lucky(), bat.unlucky(), bat.deathBlow(), bat.ballistaDoubleDmg(), getRandomGenerator());
|
|
|
+ bsa.damageAmount = gs->curB->calculateDmg(att, def, bat.shot(), distance, bat.lucky(), bat.unlucky(), bat.deathBlow(), bat.ballistaDoubleDmg(), getRandomGenerator());
|
|
|
def->prepareAttacked(bsa, getRandomGenerator()); //calculate casualties
|
|
|
|
|
|
//life drain handling
|
|
|
@@ -4537,7 +4536,7 @@ void CGameHandler::stackTurnTrigger(const CStack * st)
|
|
|
}
|
|
|
if (st->hasBonusOfType(Bonus::MANA_DRAIN) && !vstd::contains(st->state, EBattleStackState::DRAINED_MANA))
|
|
|
{
|
|
|
- const PlayerColor opponent = gs->curB->theOtherPlayer(st->owner);
|
|
|
+ const PlayerColor opponent = gs->curB->theOtherPlayer(gs->curB->battleGetOwner(st));
|
|
|
const CGHeroInstance * opponentHero = gs->curB->getHero(opponent);
|
|
|
if (opponentHero)
|
|
|
{
|
|
|
@@ -5727,7 +5726,7 @@ void CGameHandler::runBattle()
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- const CGHeroInstance * curOwner = gs->curB->battleGetOwner(next);
|
|
|
+ const CGHeroInstance * curOwner = gs->curB->battleGetOwnerHero(next);
|
|
|
|
|
|
if( (next->position < 0 || next->getCreature()->idNumber == CreatureID::BALLISTA) //arrow turret or ballista
|
|
|
&& (!curOwner || curOwner->getSecSkillLevel(SecondarySkill::ARTILLERY) == 0)) //hero has no artillery
|