Explorar o código

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

Andrii Danylchenko %!s(int64=3) %!d(string=hai) anos
pai
achega
b269d7fed6
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  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