From 0c45fb95d45bf944cb7fa3e8dffaa93efc542a69 Mon Sep 17 00:00:00 2001 From: DjWarmonger Date: Wed, 31 Jul 2013 17:47:31 +0000 Subject: [PATCH] Fixed crash when aiming with Archangels. --- lib/CBattleCallback.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/CBattleCallback.cpp b/lib/CBattleCallback.cpp index 7302464ce..53dd60e8b 100644 --- a/lib/CBattleCallback.cpp +++ b/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; + } } }