Hi.
Melee spell cast to in front target and laterally.
Constant M_PI_F not fit, rather, its value is not correct.
Ближние спелы кастуются перед целью и сбоку. А, у нас стоя спиной к цели, можно бить ее любым ближним спелам.
Константа M_PI_F не подходит, скорее ее значение не верно.
Код:
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 9d72290..89763ae 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -5048,6 +5048,14 @@ SpellCastResult Spell::CheckCast(bool strict)
// check if target is in combat
if (non_caster_target && m_spellInfo->HasAttribute(SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET) && target->isInCombat())
return SPELL_FAILED_TARGET_AFFECTING_COMBAT;
+
+ // check that the target was in front caster
+ if (m_caster->IsNonMeleeSpellCasted(false))
+ {
+ float orientationCaster = 3.3f;
+ if (!m_caster->HasInArc(orientationCaster, target))
+ return SPELL_FAILED_UNIT_NOT_INFRONT;
+ }
}
// zone check
uint32 zone, area;