mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 19:05:42 +00:00
refactor(Core): NULL -> nullptr (#3275)
* NULL to nullptr * NULL to nullptr * NULL to nullptr * NULL to nullptr * NULL to nullptr Co-authored-by: Francesco Borzì <borzifrancesco@gmail.com> Co-authored-by: Stefano Borzì <stefanoborzi32@gmail.com>
This commit is contained in:
@@ -105,8 +105,8 @@ void SpellDestination::RelocateOffset(Position const& offset)
|
||||
|
||||
SpellCastTargets::SpellCastTargets() : m_elevation(0), m_speed(0), m_strTarget()
|
||||
{
|
||||
m_objectTarget = NULL;
|
||||
m_itemTarget = NULL;
|
||||
m_objectTarget = nullptr;
|
||||
m_itemTarget = nullptr;
|
||||
|
||||
m_objectTargetGUID = 0;
|
||||
m_itemTargetGUID = 0;
|
||||
@@ -230,7 +230,7 @@ Unit* SpellCastTargets::GetUnitTarget() const
|
||||
{
|
||||
if (m_objectTarget)
|
||||
return m_objectTarget->ToUnit();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void SpellCastTargets::SetUnitTarget(Unit* target)
|
||||
@@ -260,7 +260,7 @@ GameObject* SpellCastTargets::GetGOTarget() const
|
||||
{
|
||||
if (m_objectTarget)
|
||||
return m_objectTarget->ToGameObject();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ Corpse* SpellCastTargets::GetCorpseTarget() const
|
||||
{
|
||||
if (m_objectTarget)
|
||||
return m_objectTarget->ToCorpse();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void SpellCastTargets::SetCorpseTarget(Corpse* target)
|
||||
@@ -314,7 +314,7 @@ uint64 SpellCastTargets::GetObjectTargetGUID() const
|
||||
|
||||
void SpellCastTargets::RemoveObjectTarget()
|
||||
{
|
||||
m_objectTarget = NULL;
|
||||
m_objectTarget = nullptr;
|
||||
m_objectTargetGUID = 0LL;
|
||||
m_targetMask &= ~(TARGET_FLAG_UNIT_MASK | TARGET_FLAG_CORPSE_MASK | TARGET_FLAG_GAMEOBJECT_MASK);
|
||||
}
|
||||
@@ -457,7 +457,7 @@ void SpellCastTargets::SetDstChannel(SpellDestination const& spellDest)
|
||||
|
||||
WorldObject* SpellCastTargets::GetObjectTargetChannel(Unit* caster) const
|
||||
{
|
||||
return m_objectTargetGUIDChannel ? ((m_objectTargetGUIDChannel == caster->GetGUID()) ? caster : ObjectAccessor::GetWorldObject(*caster, m_objectTargetGUIDChannel)) : NULL;
|
||||
return m_objectTargetGUIDChannel ? ((m_objectTargetGUIDChannel == caster->GetGUID()) ? caster : ObjectAccessor::GetWorldObject(*caster, m_objectTargetGUIDChannel)) : nullptr;
|
||||
}
|
||||
|
||||
bool SpellCastTargets::HasDstChannel() const
|
||||
@@ -472,9 +472,9 @@ SpellDestination const* SpellCastTargets::GetDstChannel() const
|
||||
|
||||
void SpellCastTargets::Update(Unit* caster)
|
||||
{
|
||||
m_objectTarget = m_objectTargetGUID ? ((m_objectTargetGUID == caster->GetGUID()) ? caster : ObjectAccessor::GetWorldObject(*caster, m_objectTargetGUID)) : NULL;
|
||||
m_objectTarget = m_objectTargetGUID ? ((m_objectTargetGUID == caster->GetGUID()) ? caster : ObjectAccessor::GetWorldObject(*caster, m_objectTargetGUID)) : nullptr;
|
||||
|
||||
m_itemTarget = NULL;
|
||||
m_itemTarget = nullptr;
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Player* player = caster->ToPlayer();
|
||||
@@ -548,7 +548,7 @@ m_caster((info->HasAttribute(SPELL_ATTR6_CAST_BY_CHARMER) && caster->GetCharmerO
|
||||
{
|
||||
m_customError = SPELL_CUSTOM_ERROR_NONE;
|
||||
m_skipCheck = skipCheck;
|
||||
m_selfContainer = NULL;
|
||||
m_selfContainer = nullptr;
|
||||
m_referencedFromCurrentSpell = false;
|
||||
m_executedCurrently = false;
|
||||
m_needComboPoints = m_spellInfo->NeedsComboPoints();
|
||||
@@ -599,7 +599,7 @@ m_caster((info->HasAttribute(SPELL_ATTR6_CAST_BY_CHARMER) && caster->GetCharmerO
|
||||
{
|
||||
m_originalCaster = ObjectAccessor::GetUnit(*m_caster, m_originalCasterGUID);
|
||||
if (m_originalCaster && !m_originalCaster->IsInWorld())
|
||||
m_originalCaster = NULL;
|
||||
m_originalCaster = nullptr;
|
||||
}
|
||||
|
||||
m_spellState = SPELL_STATE_NULL;
|
||||
@@ -607,13 +607,13 @@ m_caster((info->HasAttribute(SPELL_ATTR6_CAST_BY_CHARMER) && caster->GetCharmerO
|
||||
if (info->HasAttribute(SPELL_ATTR4_CAN_CAST_WHILE_CASTING))
|
||||
_triggeredCastFlags = TriggerCastFlags(uint32(_triggeredCastFlags) | TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_CAST_DIRECTLY);
|
||||
|
||||
m_CastItem = NULL;
|
||||
m_CastItem = nullptr;
|
||||
m_castItemGUID = 0;
|
||||
|
||||
unitTarget = NULL;
|
||||
itemTarget = NULL;
|
||||
gameObjTarget = NULL;
|
||||
destTarget = NULL;
|
||||
unitTarget = nullptr;
|
||||
itemTarget = nullptr;
|
||||
gameObjTarget = nullptr;
|
||||
destTarget = nullptr;
|
||||
damage = 0;
|
||||
effectHandleMode = SPELL_EFFECT_HANDLE_LAUNCH;
|
||||
m_diminishLevel = DIMINISHING_LEVEL_1;
|
||||
@@ -623,13 +623,13 @@ m_caster((info->HasAttribute(SPELL_ATTR6_CAST_BY_CHARMER) && caster->GetCharmerO
|
||||
m_procAttacker = 0;
|
||||
m_procVictim = 0;
|
||||
m_procEx = 0;
|
||||
focusObject = NULL;
|
||||
focusObject = nullptr;
|
||||
m_cast_count = 0;
|
||||
m_glyphIndex = 0;
|
||||
m_preCastSpell = 0;
|
||||
m_triggeredByAuraSpell = NULL;
|
||||
m_spellAura = NULL;
|
||||
m_pathFinder = NULL; // pussywizard
|
||||
m_triggeredByAuraSpell = nullptr;
|
||||
m_spellAura = nullptr;
|
||||
m_pathFinder = nullptr; // pussywizard
|
||||
_scriptsLoaded = false;
|
||||
|
||||
//Auto Shot & Shoot (wand)
|
||||
@@ -678,7 +678,7 @@ Spell::~Spell()
|
||||
// Clean the reference to avoid later crash.
|
||||
// If this error is repeating, we may have to add an ASSERT to better track down how we get into this case.
|
||||
sLog->outError("SPELL: deleting spell for spell ID %u. However, spell still referenced.", m_spellInfo->Id);
|
||||
*m_selfContainer = NULL;
|
||||
*m_selfContainer = nullptr;
|
||||
}
|
||||
|
||||
delete m_spellValue;
|
||||
@@ -709,7 +709,7 @@ void Spell::InitExplicitTargets(SpellCastTargets const& targets)
|
||||
// try to select correct unit target if not provided by client or by serverside cast
|
||||
if (neededTargets & (TARGET_FLAG_UNIT_MASK))
|
||||
{
|
||||
Unit* unit = NULL;
|
||||
Unit* unit = nullptr;
|
||||
// try to use player selection as a target
|
||||
if (Player* playerCaster = m_caster->ToPlayer())
|
||||
{
|
||||
@@ -777,7 +777,7 @@ void Spell::SelectExplicitTargets()
|
||||
redirect = m_caster->GetMeleeHitRedirectTarget(target, m_spellInfo);
|
||||
break;
|
||||
default:
|
||||
redirect = NULL;
|
||||
redirect = nullptr;
|
||||
break;
|
||||
}
|
||||
if (redirect && (redirect != target))
|
||||
@@ -1214,7 +1214,7 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge
|
||||
|
||||
void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType, uint32 effMask)
|
||||
{
|
||||
Unit* referer = NULL;
|
||||
Unit* referer = nullptr;
|
||||
switch (targetType.GetReferenceType())
|
||||
{
|
||||
case TARGET_REFERENCE_TYPE_SRC:
|
||||
@@ -1245,7 +1245,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
|
||||
if (!referer)
|
||||
return;
|
||||
|
||||
Position const* center = NULL;
|
||||
Position const* center = nullptr;
|
||||
switch (targetType.GetReferenceType())
|
||||
{
|
||||
case TARGET_REFERENCE_TYPE_SRC:
|
||||
@@ -1698,7 +1698,7 @@ void Spell::SelectImplicitDestDestTargets(SpellEffIndex effIndex, SpellImplicitT
|
||||
|
||||
void Spell::SelectImplicitCasterObjectTargets(SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType)
|
||||
{
|
||||
WorldObject* target = NULL;
|
||||
WorldObject* target = nullptr;
|
||||
bool checkIfValid = true;
|
||||
|
||||
switch (targetType.GetTarget())
|
||||
@@ -1994,7 +1994,7 @@ void Spell::SelectEffectTypeImplicitTargets(uint8 effIndex)
|
||||
if (!targetMask)
|
||||
return;
|
||||
|
||||
WorldObject* target = NULL;
|
||||
WorldObject* target = nullptr;
|
||||
|
||||
switch (m_spellInfo->Effects[effIndex].GetImplicitTargetType())
|
||||
{
|
||||
@@ -2117,10 +2117,10 @@ void Spell::SearchTargets(SEARCHER& searcher, uint32 containerMask, Unit* refere
|
||||
|
||||
WorldObject* Spell::SearchNearbyTarget(float range, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionList* condList)
|
||||
{
|
||||
WorldObject* target = NULL;
|
||||
WorldObject* target = nullptr;
|
||||
uint32 containerTypeMask = GetSearcherTypeMask(objectType, condList);
|
||||
if (!containerTypeMask)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
acore::WorldObjectSpellNearbyTargetCheck check(range, m_caster, m_spellInfo, selectionType, condList);
|
||||
acore::WorldObjectLastSearcher<acore::WorldObjectSpellNearbyTargetCheck> searcher(m_caster, target, check, containerTypeMask);
|
||||
SearchTargets<acore::WorldObjectLastSearcher<acore::WorldObjectSpellNearbyTargetCheck> > (searcher, containerTypeMask, m_caster, m_caster, range);
|
||||
@@ -2577,7 +2577,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
// can't use default call because of threading, do stuff as fast as possible
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (farMask & (1 << i))
|
||||
HandleEffects(effectUnit, NULL, NULL, i, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
HandleEffects(effectUnit, nullptr, nullptr, i, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2608,12 +2608,12 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
m_damage = target->damage;
|
||||
m_healing = -target->damage;
|
||||
|
||||
m_spellAura = NULL; // Set aura to null for every target-make sure that pointer is not used for unit without aura applied
|
||||
m_spellAura = nullptr; // Set aura to null for every target-make sure that pointer is not used for unit without aura applied
|
||||
|
||||
//Spells with this flag cannot trigger if effect is casted on self
|
||||
bool canEffectTrigger = !m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_PROC) && unitTarget->CanProc() && (CanExecuteTriggersOnHit(mask) || missInfo == SPELL_MISS_IMMUNE2);
|
||||
bool reflectedSpell = missInfo == SPELL_MISS_REFLECT;
|
||||
Unit* spellHitTarget = NULL;
|
||||
Unit* spellHitTarget = nullptr;
|
||||
|
||||
if (missInfo == SPELL_MISS_NONE) // In case spell hit target, do all effect on that target
|
||||
spellHitTarget = unitTarget;
|
||||
@@ -2637,7 +2637,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
if (missInfo2 != SPELL_MISS_MISS)
|
||||
m_caster->SendSpellMiss(spellHitTarget, m_spellInfo->Id, missInfo2);
|
||||
m_damage = 0;
|
||||
spellHitTarget = NULL;
|
||||
spellHitTarget = nullptr;
|
||||
|
||||
// Xinef: if missInfo2 is MISS_EVADE, override base missinfo data
|
||||
if (missInfo2 == SPELL_MISS_EVADE)
|
||||
@@ -2717,7 +2717,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
if (crit)
|
||||
{
|
||||
procEx |= PROC_EX_CRITICAL_HIT;
|
||||
addhealth = Unit::SpellCriticalHealingBonus(caster, m_spellInfo, addhealth, NULL);
|
||||
addhealth = Unit::SpellCriticalHealingBonus(caster, m_spellInfo, addhealth, nullptr);
|
||||
}
|
||||
else
|
||||
procEx |= PROC_EX_NORMAL_HIT;
|
||||
@@ -3118,11 +3118,11 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
|
||||
}
|
||||
|
||||
if (effectMask & (1 << effectNumber))
|
||||
HandleEffects(unit, NULL, NULL, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
HandleEffects(unit, nullptr, nullptr, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
}
|
||||
|
||||
if( sanct_effect >= 0 && (effectMask & (1<<sanct_effect)) )
|
||||
HandleEffects(unit, NULL, NULL, sanct_effect, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
HandleEffects(unit, nullptr, nullptr, sanct_effect, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
|
||||
return SPELL_MISS_NONE;
|
||||
}
|
||||
@@ -3221,7 +3221,7 @@ void Spell::DoAllEffectOnTarget(GOTargetInfo* target)
|
||||
|
||||
for (uint32 effectNumber = 0; effectNumber < MAX_SPELL_EFFECTS; ++effectNumber)
|
||||
if (effectMask & (1 << effectNumber))
|
||||
HandleEffects(NULL, NULL, go, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
HandleEffects(nullptr, NULL, go, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
|
||||
// xinef: inform ai about spellhit
|
||||
go->AI()->SpellHit(m_caster, m_spellInfo);
|
||||
@@ -3242,7 +3242,7 @@ void Spell::DoAllEffectOnTarget(ItemTargetInfo* target)
|
||||
|
||||
for (uint32 effectNumber = 0; effectNumber < MAX_SPELL_EFFECTS; ++effectNumber)
|
||||
if (effectMask & (1 << effectNumber))
|
||||
HandleEffects(NULL, target->item, NULL, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
HandleEffects(nullptr, target->item, NULL, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
|
||||
CallScriptOnHitHandlers();
|
||||
|
||||
@@ -3271,7 +3271,7 @@ bool Spell::UpdateChanneledTargetList()
|
||||
for(int i = EFFECT_0; i <= EFFECT_2; ++i)
|
||||
if (channelAuraMask & (1<<i) && m_spellInfo->Effects[i].RadiusEntry)
|
||||
{
|
||||
range = m_spellInfo->Effects[i].CalcRadius(NULL, NULL);
|
||||
range = m_spellInfo->Effects[i].CalcRadius(nullptr, nullptr);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3600,7 +3600,7 @@ void Spell::cancel(bool bySelf)
|
||||
|
||||
SetReferencedFromCurrent(false);
|
||||
if (m_selfContainer && *m_selfContainer == this)
|
||||
*m_selfContainer = NULL;
|
||||
*m_selfContainer = nullptr;
|
||||
|
||||
m_caster->RemoveDynObject(m_spellInfo->Id);
|
||||
if (m_spellInfo->IsChanneled()) // if not channeled then the object for the current cast wasn't summoned yet
|
||||
@@ -3615,7 +3615,7 @@ void Spell::cancel(bool bySelf)
|
||||
void Spell::cast(bool skipCheck)
|
||||
{
|
||||
Player* modOwner = m_caster->GetSpellModOwner();
|
||||
Spell* lastMod = NULL;
|
||||
Spell* lastMod = nullptr;
|
||||
if (modOwner)
|
||||
{
|
||||
lastMod = modOwner->m_spellModTakingSpell;
|
||||
@@ -3995,7 +3995,7 @@ uint64 Spell::handle_delayed(uint64 t_offset)
|
||||
|
||||
void Spell::_handle_immediate_phase()
|
||||
{
|
||||
m_spellAura = NULL;
|
||||
m_spellAura = nullptr;
|
||||
// initialize Diminishing Returns Data
|
||||
m_diminishLevel = DIMINISHING_LEVEL_1;
|
||||
m_diminishGroup = DIMINISHING_NONE;
|
||||
@@ -4013,7 +4013,7 @@ void Spell::_handle_immediate_phase()
|
||||
continue;
|
||||
|
||||
// call effect handlers to handle destination hit
|
||||
HandleEffects(NULL, NULL, NULL, j, SPELL_EFFECT_HANDLE_HIT);
|
||||
HandleEffects(nullptr, nullptr, nullptr, j, SPELL_EFFECT_HANDLE_HIT);
|
||||
}
|
||||
|
||||
// process items
|
||||
@@ -4757,7 +4757,7 @@ void Spell::SendLogExecute()
|
||||
data.append(*m_effectExecuteData[i]);
|
||||
|
||||
delete m_effectExecuteData[i];
|
||||
m_effectExecuteData[i] = NULL;
|
||||
m_effectExecuteData[i] = nullptr;
|
||||
}
|
||||
m_caster->SendMessageToSet(&data, true);
|
||||
}
|
||||
@@ -4963,9 +4963,9 @@ void Spell::TakeCastItem()
|
||||
|
||||
// prevent crash at access to deleted m_targets.GetItemTarget
|
||||
if (m_CastItem == m_targets.GetItemTarget())
|
||||
m_targets.SetItemTarget(NULL);
|
||||
m_targets.SetItemTarget(nullptr);
|
||||
|
||||
m_CastItem = NULL;
|
||||
m_CastItem = nullptr;
|
||||
m_castItemGUID = 0;
|
||||
}
|
||||
}
|
||||
@@ -5184,7 +5184,7 @@ void Spell::TakeReagents()
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
ItemTemplate const* castItemTemplate = m_CastItem ? m_CastItem->GetTemplate() : NULL;
|
||||
ItemTemplate const* castItemTemplate = m_CastItem ? m_CastItem->GetTemplate() : nullptr;
|
||||
|
||||
// do not take reagents for these item casts
|
||||
if (castItemTemplate && castItemTemplate->Flags & ITEM_FLAG_NO_REAGENT_COST)
|
||||
@@ -5216,13 +5216,13 @@ void Spell::TakeReagents()
|
||||
}
|
||||
}
|
||||
|
||||
m_CastItem = NULL;
|
||||
m_CastItem = nullptr;
|
||||
m_castItemGUID = 0;
|
||||
}
|
||||
|
||||
// if GetItemTarget is also spell reagent
|
||||
if (m_targets.GetItemTargetEntry() == itemid)
|
||||
m_targets.SetItemTarget(NULL);
|
||||
m_targets.SetItemTarget(nullptr);
|
||||
|
||||
p_caster->DestroyItemCount(itemid, itemcount, true);
|
||||
}
|
||||
@@ -5292,7 +5292,7 @@ void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOT
|
||||
#endif
|
||||
|
||||
// we do not need DamageMultiplier here.
|
||||
damage = CalculateSpellDamage(i, NULL);
|
||||
damage = CalculateSpellDamage(i, nullptr);
|
||||
|
||||
bool preventDefault = CallScriptEffectHandlers((SpellEffIndex)i, mode);
|
||||
|
||||
@@ -5439,7 +5439,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (instanceScript->IsEncounterInProgress())
|
||||
{
|
||||
if (Group* group = m_caster->ToPlayer()->GetGroup())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
if (Player* member = itr->GetSource())
|
||||
if (member->IsInMap(m_caster))
|
||||
if (Unit* victim = member->GetVictim())
|
||||
@@ -5599,7 +5599,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
m_caster->GetZoneAndAreaId(zone, area);
|
||||
|
||||
SpellCastResult locRes= m_spellInfo->CheckLocation(m_caster->GetMapId(), zone, area,
|
||||
m_caster->GetTypeId() == TYPEID_PLAYER ? m_caster->ToPlayer() : NULL);
|
||||
m_caster->GetTypeId() == TYPEID_PLAYER ? m_caster->ToPlayer() : nullptr);
|
||||
if (locRes != SPELL_CAST_OK)
|
||||
return locRes;
|
||||
}
|
||||
@@ -5926,7 +5926,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
|| (m_spellInfo->Effects[i].TargetA.GetTarget() == TARGET_GAMEOBJECT_TARGET && !m_targets.GetGOTarget()))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
Item* pTempItem = NULL;
|
||||
Item* pTempItem = nullptr;
|
||||
if (m_targets.GetTargetMask() & TARGET_FLAG_TRADE_ITEM)
|
||||
{
|
||||
if (TradeData* pTrade = m_caster->ToPlayer()->GetTradeData())
|
||||
@@ -5946,7 +5946,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
{
|
||||
if (m_targets.GetGOTarget() && m_targets.GetGOTarget()->GetEntry() == 179697)
|
||||
{
|
||||
if (!m_caster->ToPlayer()->CanUseBattlegroundObject(NULL))
|
||||
if (!m_caster->ToPlayer()->CanUseBattlegroundObject(nullptr))
|
||||
return SPELL_FAILED_TRY_AGAIN;
|
||||
}
|
||||
else if (m_caster->ToPlayer()->InBattleground() && // In Battleground players can use only flags and banners, or Gurubashi chest
|
||||
@@ -6036,7 +6036,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->getClass() == CLASS_WARLOCK && strict)
|
||||
if (Pet* pet = m_caster->ToPlayer()->GetPet())
|
||||
pet->CastSpell(pet, 32752, true, NULL, NULL, pet->GetGUID()); //starting cast, trigger pet stun (cast by pet so it doesn't attack player)
|
||||
pet->CastSpell(pet, 32752, true, nullptr, nullptr, pet->GetGUID()); //starting cast, trigger pet stun (cast by pet so it doesn't attack player)
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_SUMMON_PLAYER:
|
||||
@@ -6051,7 +6051,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
// Xinef: Implement summon pending error
|
||||
if (target->GetSummonExpireTimer() > time(NULL))
|
||||
if (target->GetSummonExpireTimer() > time(nullptr))
|
||||
return SPELL_FAILED_SUMMON_PENDING;
|
||||
|
||||
// check if our map is dungeon
|
||||
@@ -6091,7 +6091,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
// Xinef: Implement summon pending error
|
||||
if (target->GetSummonExpireTimer() > time(NULL))
|
||||
if (target->GetSummonExpireTimer() > time(nullptr))
|
||||
return SPELL_FAILED_SUMMON_PENDING;
|
||||
|
||||
break;
|
||||
@@ -6887,7 +6887,7 @@ SpellCastResult Spell::CheckItems()
|
||||
// TODO: Needs review
|
||||
if (pProto && !(pProto->ItemLimitCategory))
|
||||
{
|
||||
p_caster->SendEquipError(msg, NULL, NULL, m_spellInfo->Effects[i].ItemType);
|
||||
p_caster->SendEquipError(msg, nullptr, nullptr, m_spellInfo->Effects[i].ItemType);
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
}
|
||||
else
|
||||
@@ -6896,7 +6896,7 @@ SpellCastResult Spell::CheckItems()
|
||||
return SPELL_FAILED_TOO_MANY_OF_ITEM;
|
||||
else if (!(target->ToPlayer()->HasItemCount(m_spellInfo->Effects[i].ItemType)))
|
||||
{
|
||||
p_caster->SendEquipError(msg, NULL, NULL, m_spellInfo->Effects[i].ItemType);
|
||||
p_caster->SendEquipError(msg, nullptr, nullptr, m_spellInfo->Effects[i].ItemType);
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
}
|
||||
else
|
||||
@@ -6921,7 +6921,7 @@ SpellCastResult Spell::CheckItems()
|
||||
InventoryResult msg = p_caster->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, m_spellInfo->Effects[i].ItemType, 1);
|
||||
if (msg != EQUIP_ERR_OK)
|
||||
{
|
||||
p_caster->SendEquipError(msg, NULL, NULL, m_spellInfo->Effects[i].ItemType);
|
||||
p_caster->SendEquipError(msg, nullptr, nullptr, m_spellInfo->Effects[i].ItemType);
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
}
|
||||
}
|
||||
@@ -7225,7 +7225,7 @@ SpellCastResult Spell::CheckSpellFocus()
|
||||
CellCoord p(acore::ComputeCellCoord(m_caster->GetPositionX(), m_caster->GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
||||
GameObject* ok = NULL;
|
||||
GameObject* ok = nullptr;
|
||||
acore::GameObjectFocusCheck go_check(m_caster, m_spellInfo->RequiresSpellFocus);
|
||||
acore::GameObjectSearcher<acore::GameObjectFocusCheck> checker(m_caster, ok, go_check);
|
||||
|
||||
@@ -7338,7 +7338,7 @@ bool Spell::UpdatePointers()
|
||||
{
|
||||
m_originalCaster = ObjectAccessor::GetUnit(*m_caster, m_originalCasterGUID);
|
||||
if (m_originalCaster && !m_originalCaster->IsInWorld())
|
||||
m_originalCaster = NULL;
|
||||
m_originalCaster = nullptr;
|
||||
}
|
||||
|
||||
if (m_castItemGUID && m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -7349,7 +7349,7 @@ bool Spell::UpdatePointers()
|
||||
return false;
|
||||
}
|
||||
else
|
||||
m_CastItem = NULL;
|
||||
m_CastItem = nullptr;
|
||||
|
||||
m_targets.Update(m_caster);
|
||||
|
||||
@@ -7358,7 +7358,7 @@ bool Spell::UpdatePointers()
|
||||
return true;
|
||||
|
||||
// cache last transport
|
||||
WorldObject* transport = NULL;
|
||||
WorldObject* transport = nullptr;
|
||||
|
||||
// update effect destinations (in case of moved transport dest target)
|
||||
for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex)
|
||||
@@ -7502,7 +7502,7 @@ bool Spell::CheckEffectTarget(Unit const* target, uint32 eff) const
|
||||
|
||||
default: // normal case
|
||||
// Get GO cast coordinates if original caster -> GO
|
||||
WorldObject* caster = NULL;
|
||||
WorldObject* caster = nullptr;
|
||||
if (IS_GAMEOBJECT_GUID(m_originalCasterGUID))
|
||||
caster = m_caster->GetMap()->GetGameObject(m_originalCasterGUID);
|
||||
if (!caster)
|
||||
@@ -7681,7 +7681,7 @@ void Spell::HandleLaunchPhase()
|
||||
if (!m_spellInfo->Effects[i].IsEffect())
|
||||
continue;
|
||||
|
||||
HandleEffects(NULL, NULL, NULL, i, SPELL_EFFECT_HANDLE_LAUNCH);
|
||||
HandleEffects(nullptr, nullptr, nullptr, i, SPELL_EFFECT_HANDLE_LAUNCH);
|
||||
}
|
||||
|
||||
float multiplier[MAX_SPELL_EFFECTS];
|
||||
@@ -7738,7 +7738,7 @@ void Spell::HandleLaunchPhase()
|
||||
|
||||
void Spell::DoAllEffectOnLaunchTarget(TargetInfo& targetInfo, float* multiplier, bool firstTarget)
|
||||
{
|
||||
Unit* unit = NULL;
|
||||
Unit* unit = nullptr;
|
||||
// In case spell hit target, do all effect on that target
|
||||
if (targetInfo.missCondition == SPELL_MISS_NONE)
|
||||
unit = m_caster->GetGUID() == targetInfo.targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, targetInfo.targetGUID);
|
||||
@@ -7756,7 +7756,7 @@ void Spell::DoAllEffectOnLaunchTarget(TargetInfo& targetInfo, float* multiplier,
|
||||
m_damage = 0;
|
||||
m_healing = 0;
|
||||
|
||||
HandleEffects(unit, NULL, NULL, i, SPELL_EFFECT_HANDLE_LAUNCH_TARGET);
|
||||
HandleEffects(unit, nullptr, nullptr, i, SPELL_EFFECT_HANDLE_LAUNCH_TARGET);
|
||||
|
||||
if (m_damage > 0)
|
||||
{
|
||||
@@ -7822,11 +7822,11 @@ void Spell::DoAllEffectOnLaunchTarget(TargetInfo& targetInfo, float* multiplier,
|
||||
int32 basepoints = 0;
|
||||
m_damage = 0;
|
||||
|
||||
HandleEffects(target, NULL, NULL, ssEffect, SPELL_EFFECT_HANDLE_LAUNCH_TARGET);
|
||||
HandleEffects(target, nullptr, nullptr, ssEffect, SPELL_EFFECT_HANDLE_LAUNCH_TARGET);
|
||||
|
||||
basepoints = (targetInfo.crit ? Unit::SpellCriticalDamageBonus(m_caster, m_spellInfo, m_damage, target) : m_damage);
|
||||
m_damage = mdmg;
|
||||
m_caster->CastCustomSpell(target, 26654, &basepoints, NULL, NULL, true);
|
||||
m_caster->CastCustomSpell(target, 26654, &basepoints, nullptr, nullptr, true);
|
||||
|
||||
if (m_spellInfo->Id != 44949)
|
||||
aur->DropCharge();
|
||||
@@ -8273,7 +8273,7 @@ void Spell::PrepareTriggersExecutedOnHit()
|
||||
// this possibly needs fixing
|
||||
int32 auraBaseAmount = (*i)->GetBaseAmount();
|
||||
// proc chance is stored in effect amount
|
||||
int32 chance = m_caster->CalculateSpellDamage(NULL, auraSpellInfo, auraSpellIdx, &auraBaseAmount);
|
||||
int32 chance = m_caster->CalculateSpellDamage(nullptr, auraSpellInfo, auraSpellIdx, &auraBaseAmount);
|
||||
// build trigger and add to the list
|
||||
HitTriggerSpell spellTriggerInfo;
|
||||
spellTriggerInfo.triggeredSpell = spellInfo;
|
||||
@@ -8389,9 +8389,9 @@ WorldObjectSpellTargetCheck::WorldObjectSpellTargetCheck(Unit* caster, Unit* ref
|
||||
_targetSelectionType(selectionType), _condList(condList)
|
||||
{
|
||||
if (condList)
|
||||
_condSrcInfo = new ConditionSourceInfo(NULL, caster);
|
||||
_condSrcInfo = new ConditionSourceInfo(nullptr, caster);
|
||||
else
|
||||
_condSrcInfo = NULL;
|
||||
_condSrcInfo = nullptr;
|
||||
}
|
||||
|
||||
WorldObjectSpellTargetCheck::~WorldObjectSpellTargetCheck()
|
||||
|
||||
Reference in New Issue
Block a user