diff --git a/client/battle/BattleAnimationClasses.cpp b/client/battle/BattleAnimationClasses.cpp index 66677b959..fbfbf7bd0 100644 --- a/client/battle/BattleAnimationClasses.cpp +++ b/client/battle/BattleAnimationClasses.cpp @@ -810,14 +810,19 @@ void CatapultAnimation::createProjectile(const Point & from, const Point & dest) owner.projectilesController->createCatapultProjectile(attackingStack, from, dest); } -CastAnimation::CastAnimation(BattleInterface & owner_, const CStack * attacker, BattleHex dest_, const CStack * defender, const CSpell * spell) - : RangedAttackAnimation(owner_, attacker, dest_, defender), +CastAnimation::CastAnimation(BattleInterface & owner_, const CStack * attacker, BattleHex dest, const CStack * defender, const CSpell * spell) + : RangedAttackAnimation(owner_, attacker, dest, defender), spell(spell) { - assert(dest.isValid());// FIXME: when? + if(!dest.isValid()) + { + assert(spell->animationInfo.projectile.empty()); - if(!dest_.isValid() && defender) - dest = defender->getPosition(); + if (defender) + dest = defender->getPosition(); + else + dest = attacker->getPosition(); + } } ECreatureAnimType CastAnimation::getUpwardsGroup() const diff --git a/lib/spells/CSpellHandler.cpp b/lib/spells/CSpellHandler.cpp index 9548dafc5..7e20dbb92 100644 --- a/lib/spells/CSpellHandler.cpp +++ b/lib/spells/CSpellHandler.cpp @@ -572,11 +572,6 @@ CSpell::TargetInfo::TargetInfo(const CSpell * spell, const int level, spells::Mo massive = levelInfo.range == "X"; clearAffected = levelInfo.clearAffected; clearTarget = levelInfo.clearTarget; - - if(mode == spells::Mode::CREATURE_ACTIVE) - { - massive = false;//FIXME: find better solution for Commander spells - } } bool DLL_LINKAGE isInScreenRange(const int3 & center, const int3 & pos)