1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-25 21:38:59 +02:00

Made a small fix for the problem with crash on killing with a spell.

This commit is contained in:
OnionKnight 2009-08-31 08:13:10 +00:00
parent 4672070e8c
commit 866d39727e

View File

@ -1148,7 +1148,11 @@ void CPlayerInterface::battleStacksAttacked(std::set<BattleStackAttacked> & bsa)
{
if(i->isEffect() && i->effect != 12) //and not armageddon
{
battleInt->displayEffect(i->effect, cb->battleGetStackByID(i->stackAttacked)->position);
const CStack *stack = cb->battleGetStackByID(i->stackAttacked);
// FIXME: Perhaps position should be kept for dead stacks?
if (stack != NULL)
battleInt->displayEffect(i->effect, stack->position);
}
CBattleInterface::SStackAttackedInfo to_put = {i->stackAttacked, i->damageAmount, i->killedAmount, LOCPLINT->curAction->stackNumber, LOCPLINT->curAction->actionType==7, i->killed()};
arg.push_back(to_put);