Core/Util: Fixed flag128 and removed flag96 - previously if flag128 and flag96 were used in together the result was always a bool instead of expected flag result due to implicit boolean conversion

This commit is contained in:
Shauren
2015-04-27 00:33:27 +02:00
parent 800d5d8939
commit 675a2fcd3b
14 changed files with 107 additions and 101 deletions

View File

@@ -344,7 +344,7 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader
{
Unit* caster = GetCaster();
if (Unit* unitTarget = GetHitUnit())
if (AuraEffect const* aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x2, 0, 0, caster->GetGUID()))
if (AuraEffect const* aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, flag128(0x2, 0, 0), caster->GetGUID()))
{
Aura* aura = aurEff->GetBase();

View File

@@ -118,7 +118,7 @@ class spell_gen_adaptive_warding : public SpellScriptLoader
return false;
// find Mage Armor
if (!GetTarget()->GetAuraEffect(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT, SPELLFAMILY_MAGE, 0x10000000, 0x0, 0x0))
if (!GetTarget()->GetAuraEffect(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT, SPELLFAMILY_MAGE, flag128(0x10000000, 0x0, 0x0)))
return false;
switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask()))

View File

@@ -748,7 +748,7 @@ class spell_pri_pain_and_suffering_proc : public SpellScriptLoader
Unit* caster = GetCaster();
// Refresh Shadow Word: Pain on target
if (Unit* target = GetHitUnit())
if (AuraEffect* aur = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0, 0, caster->GetGUID()))
if (AuraEffect* aur = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, flag128(0x8000, 0, 0), caster->GetGUID()))
{
uint32 damage = std::max(aur->GetAmount(), 0);
sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage);

View File

@@ -280,7 +280,7 @@ class spell_rog_deadly_poison : public SpellScriptLoader
{
if (Unit* target = GetHitUnit())
// Deadly Poison
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x10000, 0x80000, 0, GetCaster()->GetGUID()))
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, flag128(0x10000, 0x80000, 0), GetCaster()->GetGUID()))
_stackAmount = aurEff->GetBase()->GetStackAmount();
}
@@ -326,7 +326,7 @@ class spell_rog_deadly_poison : public SpellScriptLoader
continue;
// Do not reproc deadly
if (spellInfo->SpellFamilyFlags == flag96(0x10000, 0x80000, 0))
if (spellInfo->SpellFamilyFlags == flag128(0x10000, 0x80000, 0, 0))
continue;
if (spellInfo->IsPositive())

View File

@@ -236,7 +236,7 @@ class spell_sha_chain_heal : public SpellScriptLoader
if (firstHeal)
{
// Check if the target has Riptide
if (AuraEffect* aurEff = GetHitUnit()->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, 0, 0, 0x10, GetCaster()->GetGUID()))
if (AuraEffect* aurEff = GetHitUnit()->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_SHAMAN, flag128(0, 0, 0x10), GetCaster()->GetGUID()))
{
riptide = true;
amount = aurEff->GetSpellInfo()->GetEffect(DIFFICULTY_NONE, EFFECT_2)->CalcValue();
@@ -880,7 +880,7 @@ class spell_sha_lava_lash : public SpellScriptLoader
if (caster->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND))
{
// Damage is increased by 25% if your off-hand weapon is enchanted with Flametongue.
if (caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0x200000, 0, 0))
if (caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, flag128(0x200000, 0, 0)))
AddPct(hitDamage, damage);
SetHitDamage(hitDamage);
}

View File

@@ -154,7 +154,7 @@ class spell_warl_banish : public SpellScriptLoader
/// Check if the target already has Banish, if so, do nothing.
if (Unit* target = GetHitUnit())
{
if (target->GetAuraEffect(SPELL_AURA_SCHOOL_IMMUNITY, SPELLFAMILY_WARLOCK, 0, 0x08000000, 0))
if (target->GetAuraEffect(SPELL_AURA_SCHOOL_IMMUNITY, SPELLFAMILY_WARLOCK, flag128(0, 0x08000000, 0)))
{
// No need to remove old aura since its removed due to not stack by current Banish aura
PreventHitDefaultEffect(EFFECT_0);
@@ -590,7 +590,7 @@ class spell_warl_everlasting_affliction : public SpellScriptLoader
Unit* caster = GetCaster();
if (Unit* target = GetHitUnit())
// Refresh corruption on target
if (AuraEffect* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x2, 0, 0, caster->GetGUID()))
if (AuraEffect* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, flag128(0x2, 0, 0), caster->GetGUID()))
{
uint32 damage = std::max(aurEff->GetAmount(), 0);
sScriptMgr->ModifyPeriodicDamageAurasTick(target, caster, damage);