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:
Chris Miles 2019-09-01 16:31:16 -05:00 committed by GitHub
commit 206b769731
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1951,24 +1951,16 @@ bool Zone::IsSpellBlocked(uint32 spell_id, const glm::vec3& location)
} }
} }
for (int x = 0; x < totalBS; x++) // If all spells are blocked and this is an exception, it is not blocked
{ if (block_all && exception)
// If spellid is 0, block all spells in the zone
if (block_all)
{
// If the same zone has entries other than spellid 0, they act as exceptions and are allowed
if (exception)
{ {
return false; return false;
} }
else
for (int x = 0; x < totalBS; x++)
{ {
return true; // Spellid of 0 matches all spells
} if (0 != blocked_spells[x].spellid && spell_id != blocked_spells[x].spellid)
}
else
{
if (spell_id != blocked_spells[x].spellid)
{ {
continue; continue;
} }
@ -1994,7 +1986,6 @@ bool Zone::IsSpellBlocked(uint32 spell_id, const glm::vec3& location)
} }
} }
} }
}
return false; return false;
} }