mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
Merge pull request #866 from eqft/pr/block_all_spells_region
Support for blocked_spells entries for all spells in a region
This commit is contained in:
commit
206b769731
@ -1951,46 +1951,37 @@ bool Zone::IsSpellBlocked(uint32 spell_id, const glm::vec3& location)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If all spells are blocked and this is an exception, it is not blocked
|
||||||
|
if (block_all && exception)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
for (int x = 0; x < totalBS; x++)
|
for (int x = 0; x < totalBS; x++)
|
||||||
{
|
{
|
||||||
// If spellid is 0, block all spells in the zone
|
// Spellid of 0 matches all spells
|
||||||
if (block_all)
|
if (0 != blocked_spells[x].spellid && spell_id != blocked_spells[x].spellid)
|
||||||
{
|
{
|
||||||
// If the same zone has entries other than spellid 0, they act as exceptions and are allowed
|
continue;
|
||||||
if (exception)
|
}
|
||||||
{
|
|
||||||
return false;
|
switch (blocked_spells[x].type)
|
||||||
}
|
{
|
||||||
else
|
case 1:
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
case 2:
|
||||||
else
|
{
|
||||||
{
|
if (IsWithinAxisAlignedBox(location, blocked_spells[x].m_Location - blocked_spells[x].m_Difference, blocked_spells[x].m_Location + blocked_spells[x].m_Difference))
|
||||||
if (spell_id != blocked_spells[x].spellid)
|
return true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
break;
|
||||||
|
|
||||||
switch (blocked_spells[x].type)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 2:
|
|
||||||
{
|
|
||||||
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:
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user