Core/Auras: Replaced false with NULL since we are dealing with pointers

This commit is contained in:
Shauren
2011-05-29 14:01:20 +02:00
parent 854438fb8a
commit 27246db7d5
2 changed files with 7 additions and 7 deletions
+6 -6
View File
@@ -3143,7 +3143,7 @@ void Unit::DeMorph()
SetDisplayId(GetNativeDisplayId()); SetDisplayId(GetNativeDisplayId());
} }
Aura * Unit::_TryStackingOrRefreshingExistingAura(SpellEntry const * newAura, uint8 effMask, int32 *baseAmount, Item * castItem, uint64 casterGUID) Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellEntry const* newAura, uint8 effMask, int32* baseAmount /*= NULL*/, Item* castItem /*= NULL*/, uint64 casterGUID /*= 0*/)
{ {
ASSERT(casterGUID); ASSERT(casterGUID);
// passive and Incanter's Absorption and auras with different type can stack with themselves any number of times // passive and Incanter's Absorption and auras with different type can stack with themselves any number of times
@@ -3155,13 +3155,13 @@ Aura * Unit::_TryStackingOrRefreshingExistingAura(SpellEntry const * newAura, ui
castItemGUID = castItem->GetGUID(); castItemGUID = castItem->GetGUID();
// find current aura from spell and change it's stackamount, or refresh it's duration // find current aura from spell and change it's stackamount, or refresh it's duration
if (Aura * foundAura = GetOwnedAura(newAura->Id, casterGUID, (sSpellMgr->GetSpellCustomAttr(newAura->Id) & SPELL_ATTR0_CU_ENCHANT_PROC) ? castItemGUID : 0, 0)) if (Aura* foundAura = GetOwnedAura(newAura->Id, casterGUID, (sSpellMgr->GetSpellCustomAttr(newAura->Id) & SPELL_ATTR0_CU_ENCHANT_PROC) ? castItemGUID : 0, 0))
{ {
// effect masks do not match // effect masks do not match
// extremely rare case // extremely rare case
// let's just recreate aura // let's just recreate aura
if (effMask != foundAura->GetEffectMask()) if (effMask != foundAura->GetEffectMask())
return false; return NULL;
// update basepoints with new values - effect amount will be recalculated in ModStackAmount // update basepoints with new values - effect amount will be recalculated in ModStackAmount
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
@@ -3174,23 +3174,23 @@ Aura * Unit::_TryStackingOrRefreshingExistingAura(SpellEntry const * newAura, ui
else else
bp = foundAura->GetSpellProto()->EffectBasePoints[i]; bp = foundAura->GetSpellProto()->EffectBasePoints[i];
int32 *oldBP = const_cast<int32 *>(&(foundAura->m_effects[i]->m_baseAmount)); int32* oldBP = const_cast<int32*>(&(foundAura->m_effects[i]->m_baseAmount));
*oldBP = bp; *oldBP = bp;
} }
// correct cast item guid if needed // correct cast item guid if needed
if (castItemGUID != foundAura->GetCastItemGUID()) if (castItemGUID != foundAura->GetCastItemGUID())
{ {
uint64 *oldGUID = const_cast<uint64 *>(&foundAura->m_castItemGuid); uint64* oldGUID = const_cast<uint64 *>(&foundAura->m_castItemGuid);
*oldGUID = castItemGUID; *oldGUID = castItemGUID;
} }
// try to increase stack amount // try to increase stack amount
foundAura->ModStackAmount(1); foundAura->ModStackAmount(1);
return foundAura; return foundAura;
} }
} }
return NULL; return NULL;
} }
+1 -1
View File
@@ -1616,7 +1616,7 @@ class Unit : public WorldObject
bool InitTamedPet(Pet * pet, uint8 level, uint32 spell_id); bool InitTamedPet(Pet * pet, uint8 level, uint32 spell_id);
// aura apply/remove helpers - you should better not use these // aura apply/remove helpers - you should better not use these
Aura * _TryStackingOrRefreshingExistingAura(SpellEntry const* newAura, uint8 effMask, int32 *baseAmount = NULL, Item * castItem = NULL, uint64 casterGUID = 0); Aura* _TryStackingOrRefreshingExistingAura(SpellEntry const* newAura, uint8 effMask, int32* baseAmount = NULL, Item* castItem = NULL, uint64 casterGUID = 0);
void _AddAura(UnitAura * aura, Unit * caster); void _AddAura(UnitAura * aura, Unit * caster);
AuraApplication * _CreateAuraApplication(Aura * aura, uint8 effMask); AuraApplication * _CreateAuraApplication(Aura * aura, uint8 effMask);
void _ApplyAuraEffect(Aura * aura, uint8 effIndex); void _ApplyAuraEffect(Aura * aura, uint8 effIndex);