Преглед изворни кода

Fix case when defender creature is killed with pre-attack spell like liches death ripple

Andrii Danylchenko пре 3 година
родитељ
комит
b269d7fed6
1 измењених фајлова са 6 додато и 2 уклоњено
  1. 6 2
      client/CPlayerInterface.cpp

+ 6 - 2
client/CPlayerInterface.cpp

@@ -1071,8 +1071,12 @@ void CPlayerInterface::battleAttack(const BattleAttack * ba)
 			else
 				shift = -1;
 		}
-		const CStack * attacked = cb->battleGetStackByID(ba->bsa.begin()->stackAttacked);
-		battleInt->stackAttacking(attacker, ba->counter() ? BattleHex(attackTarget + shift) : attackTarget, attacked, false);
+
+		if(!ba->bsa.empty())
+		{
+			const CStack * attacked = cb->battleGetStackByID(ba->bsa.begin()->stackAttacked);
+			battleInt->stackAttacking(attacker, ba->counter() ? BattleHex(attackTarget + shift) : attackTarget, attacked, false);
+		}
 	}
 
 	//battleInt->waitForAnims(); //FIXME: freeze