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

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

OnionKnight пре 16 година
родитељ
комит
866d39727e
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      client/CPlayerInterface.cpp

+ 5 - 1
client/CPlayerInterface.cpp

@@ -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);