[9035] Attempt make more fast and less hackish spell target checks

* Enable server side recheck clear negative to friend or positive to enemy casts that already checks at client side
* Use more fast way check in similar cases for non-players, and fall back to old way in unclear (for while at least)

Please report if some spell stop propertly casted at friends/enemies.
This commit is contained in:
VladimirMangos 2009-12-20 03:26:39 +03:00
parent 27e7190301
commit 9e18fc5745
4 changed files with 58 additions and 7 deletions

View file

@ -426,6 +426,40 @@ bool IsPositiveTarget(uint32 targetA, uint32 targetB)
return true;
}
bool IsExplicitPositiveTarget(uint32 targetA)
{
// positive targets
switch(targetA)
{
case TARGET_SELF:
case TARGET_SINGLE_FRIEND:
case TARGET_SINGLE_PARTY:
case TARGET_CHAIN_HEAL:
case TARGET_SINGLE_FRIEND_2:
case TARGET_AREAEFFECT_PARTY_AND_CLASS:
case TARGET_SELF2:
return true;
default:
break;
}
return false;
}
bool IsExplicitNegativeTarget(uint32 targetA)
{
// non-positive targets
switch(targetA)
{
case TARGET_CHAIN_DAMAGE:
case TARGET_CURRENT_ENEMY_COORDINATES:
case TARGET_SINGLE_ENEMY:
return true;
default:
break;
}
return false;
}
bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
{
SpellEntry const *spellproto = sSpellStore.LookupEntry(spellId);