Explorar o código

Fixed crash when aiming with Archangels.

DjWarmonger %!s(int64=12) %!d(string=hai) anos
pai
achega
0c45fb95d4
Modificáronse 1 ficheiros con 6 adicións e 3 borrados
  1. 6 3
      lib/CBattleCallback.cpp

+ 6 - 3
lib/CBattleCallback.cpp

@@ -1562,9 +1562,12 @@ ESpellCastProblem::ESpellCastProblem CBattleInfoCallback::battleIsImmune(const C
 
 		if (spell->isRisingSpell())
 		{
-			auto maxHealth = calculateHealedHP (caster, spell, subject);
-			if (subject->count >= subject->baseAmount || maxHealth < subject->MaxHealth()) //must be able to rise at least one full creature
-				return ESpellCastProblem::STACK_IMMUNE_TO_SPELL;
+			if (caster) //TODO: what with Archangels?
+			{
+				auto maxHealth = calculateHealedHP (caster, spell, subject);
+				if (subject->count >= subject->baseAmount || maxHealth < subject->MaxHealth()) //must be able to rise at least one full creature
+					return ESpellCastProblem::STACK_IMMUNE_TO_SPELL;
+			}
 		}
 
 	}