IsSpellBlocked converted to use xyz_location

This commit is contained in:
Arthur Ice
2014-12-01 16:00:48 -08:00
parent b06647b763
commit f5a94ed07b
4 changed files with 6 additions and 10 deletions
+2 -6
View File
@@ -1869,7 +1869,7 @@ void Zone::ClearBlockedSpells()
}
}
bool Zone::IsSpellBlocked(uint32 spell_id, float nx, float ny, float nz)
bool Zone::IsSpellBlocked(uint32 spell_id, const xyz_location& location)
{
if (blocked_spells)
{
@@ -1919,12 +1919,8 @@ bool Zone::IsSpellBlocked(uint32 spell_id, float nx, float ny, float nz)
}
case 2:
{
if ((( nx >= (blocked_spells[x].m_Location.m_X-blocked_spells[x].m_Difference.m_X)) && (nx <= (blocked_spells[x].m_Location.m_X+blocked_spells[x].m_Difference.m_X))) &&
(( ny >= (blocked_spells[x].m_Location.m_Y-blocked_spells[x].m_Difference.m_Y)) && (ny <= (blocked_spells[x].m_Location.m_Y+blocked_spells[x].m_Difference.m_Y))) &&
(( nz >= (blocked_spells[x].m_Location.m_Z-blocked_spells[x].m_Difference.m_Z)) && (nz <= (blocked_spells[x].m_Location.m_Z+blocked_spells[x].m_Difference.m_Z))))
{
if (!IsWithinAxisAlignedBox(location, blocked_spells[x].m_Location - blocked_spells[x].m_Difference, blocked_spells[x].m_Location + blocked_spells[x].m_Difference))
return true;
}
break;
}
default: