瀏覽代碼

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
 			else
 				shift = -1;
 				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
 	//battleInt->waitForAnims(); //FIXME: freeze