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:
parent
38903b5dfb
commit
1f89282b22
325 changed files with 2348 additions and 2348 deletions
|
|
@ -65,6 +65,6 @@ namespace AuthHelper
|
|||
if (PreBcAcceptedClientBuilds[i].Build == build)
|
||||
return &PreBcAcceptedClientBuilds[i];
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ Patcher PatchesCache;
|
|||
|
||||
// Constructor - set the N and g values for SRP6
|
||||
AuthSocket::AuthSocket(RealmSocket& socket) :
|
||||
pPatch(NULL), socket_(socket), _status(STATUS_CHALLENGE), _build(0),
|
||||
pPatch(nullptr), socket_(socket), _status(STATUS_CHALLENGE), _build(0),
|
||||
_expversion(0), _accountSecurityLevel(SEC_PLAYER)
|
||||
{
|
||||
N.SetHexStr("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7");
|
||||
|
|
@ -331,7 +331,7 @@ bool AuthSocket::_HandleLogonChallenge()
|
|||
{
|
||||
ACORE_GUARD(ACE_Thread_Mutex, LastLoginAttemptMutex);
|
||||
std::string ipaddr = socket().getRemoteAddress();
|
||||
uint32 currTime = time(NULL);
|
||||
uint32 currTime = time(nullptr);
|
||||
std::map<std::string, uint32>::iterator itr = LastLoginAttemptTimeForIP.find(ipaddr);
|
||||
if (itr != LastLoginAttemptTimeForIP.end() && itr->second >= currTime)
|
||||
{
|
||||
|
|
@ -635,7 +635,7 @@ bool AuthSocket::_HandleLogonProof()
|
|||
}
|
||||
|
||||
SHA1Hash sha;
|
||||
sha.UpdateBigNumbers(&A, &B, NULL);
|
||||
sha.UpdateBigNumbers(&A, &B, nullptr);
|
||||
sha.Finalize();
|
||||
BigNumber u;
|
||||
u.SetBinary(sha.GetDigest(), 20);
|
||||
|
|
@ -671,11 +671,11 @@ bool AuthSocket::_HandleLogonProof()
|
|||
uint8 hash[20];
|
||||
|
||||
sha.Initialize();
|
||||
sha.UpdateBigNumbers(&N, NULL);
|
||||
sha.UpdateBigNumbers(&N, nullptr);
|
||||
sha.Finalize();
|
||||
memcpy(hash, sha.GetDigest(), 20);
|
||||
sha.Initialize();
|
||||
sha.UpdateBigNumbers(&g, NULL);
|
||||
sha.UpdateBigNumbers(&g, nullptr);
|
||||
sha.Finalize();
|
||||
|
||||
for (int i = 0; i < 20; ++i)
|
||||
|
|
@ -691,9 +691,9 @@ bool AuthSocket::_HandleLogonProof()
|
|||
memcpy(t4, sha.GetDigest(), SHA_DIGEST_LENGTH);
|
||||
|
||||
sha.Initialize();
|
||||
sha.UpdateBigNumbers(&t3, NULL);
|
||||
sha.UpdateBigNumbers(&t3, nullptr);
|
||||
sha.UpdateData(t4, SHA_DIGEST_LENGTH);
|
||||
sha.UpdateBigNumbers(&s, &A, &B, &K, NULL);
|
||||
sha.UpdateBigNumbers(&s, &A, &B, &K, nullptr);
|
||||
sha.Finalize();
|
||||
BigNumber M;
|
||||
M.SetBinary(sha.GetDigest(), 20);
|
||||
|
|
@ -721,7 +721,7 @@ bool AuthSocket::_HandleLogonProof()
|
|||
|
||||
// Finish SRP6 and send the final result to the client
|
||||
sha.Initialize();
|
||||
sha.UpdateBigNumbers(&A, &M, &K, NULL);
|
||||
sha.UpdateBigNumbers(&A, &M, &K, nullptr);
|
||||
sha.Finalize();
|
||||
|
||||
// Check auth token
|
||||
|
|
@ -947,7 +947,7 @@ bool AuthSocket::_HandleReconnectProof()
|
|||
SHA1Hash sha;
|
||||
sha.Initialize();
|
||||
sha.UpdateData(_login);
|
||||
sha.UpdateBigNumbers(&t1, &_reconnectProof, &K, NULL);
|
||||
sha.UpdateBigNumbers(&t1, &_reconnectProof, &K, nullptr);
|
||||
sha.Finalize();
|
||||
|
||||
if (!memcmp(sha.GetDigest(), lp.R2, SHA_DIGEST_LENGTH))
|
||||
|
|
@ -1209,7 +1209,7 @@ void Patcher::LoadPatchesInfo()
|
|||
while (dirp)
|
||||
{
|
||||
errno = 0;
|
||||
if ((dp = readdir(dirp)) != NULL)
|
||||
if ((dp = readdir(dirp)) != nullptr)
|
||||
{
|
||||
int l = strlen(dp->d_name);
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ namespace TOTP
|
|||
memset(encoded, 0, bufsize);
|
||||
unsigned int hmacResSize = HMAC_RES_SIZE;
|
||||
unsigned char hmacRes[HMAC_RES_SIZE];
|
||||
unsigned long timestamp = time(NULL)/30;
|
||||
unsigned long timestamp = time(nullptr)/30;
|
||||
unsigned char challenge[8];
|
||||
for (int i = 8; i--;timestamp >>= 8)
|
||||
challenge[i] = timestamp;
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ void PetAI::UpdateAI(uint32 diff)
|
|||
void PetAI::UpdateAllies()
|
||||
{
|
||||
Unit* owner = me->GetCharmerOrOwner();
|
||||
Group* group = NULL;
|
||||
Group* group = nullptr;
|
||||
|
||||
m_updateAlliesTimer = 10*IN_MILLISECONDS; //update friendly targets every 10 seconds, lesser checks increase performance
|
||||
|
||||
|
|
@ -367,7 +367,7 @@ void PetAI::UpdateAllies()
|
|||
m_AllySet.insert(me->GetGUID());
|
||||
if (group) //add group
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* Target = itr->GetSource();
|
||||
if (!Target || !Target->IsInMap(owner) || !group->SameSubGroup(owner->ToPlayer(), Target))
|
||||
|
|
@ -470,7 +470,7 @@ Unit* PetAI::SelectNextTarget(bool allowAutoSelect) const
|
|||
|
||||
// Passive pets don't do next target selection
|
||||
if (me->HasReactState(REACT_PASSIVE))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
// Check pet attackers first so we don't drag a bunch of targets to the owner
|
||||
if (Unit* myAttacker = me->getAttackerForHelper())
|
||||
|
|
@ -491,7 +491,7 @@ Unit* PetAI::SelectNextTarget(bool allowAutoSelect) const
|
|||
// Not sure why we wouldn't have an owner but just in case...
|
||||
Unit* owner = me->GetCharmerOrOwner();
|
||||
if (!owner)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
// Check owner attackers
|
||||
if (Unit* ownerAttacker = owner->getAttackerForHelper())
|
||||
|
|
@ -513,7 +513,7 @@ Unit* PetAI::SelectNextTarget(bool allowAutoSelect) const
|
|||
return nearTarget;
|
||||
|
||||
// Default - no valid targets
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void PetAI::HandleReturnMovement()
|
||||
|
|
@ -703,7 +703,7 @@ bool PetAI::CanAttack(Unit* target, const SpellInfo* spellInfo)
|
|||
if (me->GetVictim() && me->GetVictim() != target)
|
||||
{
|
||||
// Check if our owner selected this target and clicked "attack"
|
||||
Unit* ownerTarget = NULL;
|
||||
Unit* ownerTarget = nullptr;
|
||||
if (Player* owner = me->GetCharmerOrOwner()->ToPlayer())
|
||||
ownerTarget = owner->GetSelectedUnit();
|
||||
else
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class PetAI : public CreatureAI
|
|||
Unit* SelectNextTarget(bool allowAutoSelect) const;
|
||||
void HandleReturnMovement();
|
||||
void DoAttack(Unit* target, bool chase);
|
||||
bool CanAttack(Unit* target, const SpellInfo* spellInfo = NULL);
|
||||
bool CanAttack(Unit* target, const SpellInfo* spellInfo = nullptr);
|
||||
void ClearCharmInfoFlags();
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -64,14 +64,14 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
|
|||
// SPELLMOD_RANGE not applied in this place just because not existence range mods for attacking totems
|
||||
|
||||
// pointer to appropriate target if found any
|
||||
Unit* victim = i_victimGuid ? ObjectAccessor::GetUnit(*me, i_victimGuid) : NULL;
|
||||
Unit* victim = i_victimGuid ? ObjectAccessor::GetUnit(*me, i_victimGuid) : nullptr;
|
||||
|
||||
// Search victim if no, not attackable, or out of range, or friendly (possible in case duel end)
|
||||
if (!victim ||
|
||||
!victim->isTargetableForAttack(true, me) || !me->IsWithinDistInMap(victim, max_range) ||
|
||||
me->IsFriendlyTo(victim) || !me->CanSeeOrDetect(victim))
|
||||
{
|
||||
victim = NULL;
|
||||
victim = nullptr;
|
||||
acore::NearestAttackableUnitInObjectRangeCheck u_check(me, me, max_range);
|
||||
acore::UnitLastSearcher<acore::NearestAttackableUnitInObjectRangeCheck> checker(me, victim, u_check);
|
||||
me->VisitNearbyObject(max_range, checker);
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ void UnitAI::DoCastToAllHostilePlayers(uint32 spellid, bool triggered)
|
|||
|
||||
void UnitAI::DoCast(uint32 spellId)
|
||||
{
|
||||
Unit* target = NULL;
|
||||
Unit* target = nullptr;
|
||||
//sLog->outError("aggre %u %u", spellId, (uint32)AISpellInfo[spellId].target);
|
||||
switch (AISpellInfo[spellId].target)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ class UnitAI
|
|||
{
|
||||
ThreatContainer::StorageType const& threatlist = me->getThreatManager().getThreatList();
|
||||
if (position >= threatlist.size())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
std::list<Unit*> targetList;
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
|
|
@ -204,7 +204,7 @@ class UnitAI
|
|||
targetList.push_back((*itr)->getTarget());
|
||||
|
||||
if (position >= targetList.size())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
if (targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST)
|
||||
targetList.sort(acore::ObjectDistanceOrderPred(me));
|
||||
|
|
@ -235,7 +235,7 @@ class UnitAI
|
|||
break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void SelectTargetList(std::list<Unit*>& targetList, uint32 num, SelectAggroTarget targetType, float dist = 0.0f, bool playerOnly = false, int32 aura = 0);
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ bool CreatureAI::_EnterEvadeMode()
|
|||
me->DeleteThreatList();
|
||||
me->CombatStop(true);
|
||||
me->LoadCreaturesAddon(true);
|
||||
me->SetLootRecipient(NULL);
|
||||
me->SetLootRecipient(nullptr);
|
||||
me->ResetPlayerDamageReq();
|
||||
me->SetLastDamagedTime(0);
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class CreatureAI : public UnitAI
|
|||
Creature* DoSummonFlyer(uint32 entry, WorldObject* obj, float flightZ, float radius = 5.0f, uint32 despawnTime = 30000, TempSummonType summonType = TEMPSUMMON_CORPSE_TIMED_DESPAWN);
|
||||
|
||||
public:
|
||||
void Talk(uint8 id, WorldObject const* whisperTarget = NULL);
|
||||
void Talk(uint8 id, WorldObject const* whisperTarget = nullptr);
|
||||
explicit CreatureAI(Creature* creature) : UnitAI(creature), me(creature), m_MoveInLineOfSight_locked(false) {}
|
||||
|
||||
virtual ~CreatureAI() {}
|
||||
|
|
@ -85,7 +85,7 @@ class CreatureAI : public UnitAI
|
|||
// Called for reaction at stopping attack at no attackers or targets
|
||||
virtual void EnterEvadeMode();
|
||||
|
||||
// Called for reaction at enter to combat if not in combat yet (enemy can be NULL)
|
||||
// Called for reaction at enter to combat if not in combat yet (enemy can be nullptr)
|
||||
virtual void EnterCombat(Unit* /*victim*/) {}
|
||||
|
||||
// Called when the creature is killed
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace FactorySelector
|
|||
{
|
||||
CreatureAI* selectAI(Creature* creature)
|
||||
{
|
||||
const CreatureAICreator* ai_factory = NULL;
|
||||
const CreatureAICreator* ai_factory = nullptr;
|
||||
CreatureAIRegistry& ai_registry(*CreatureAIRegistry::instance());
|
||||
|
||||
// xinef: if we have controlable guardian, define petai for players as they can steer him, otherwise db / normal ai
|
||||
|
|
@ -84,7 +84,7 @@ namespace FactorySelector
|
|||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
// select NullCreatureAI if not another cases
|
||||
ainame = (ai_factory == NULL) ? "NullCreatureAI" : ai_factory->key();
|
||||
ainame = (ai_factory == nullptr) ? "NullCreatureAI" : ai_factory->key();
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "Creature %u used AI is %s.", creature->GetGUIDLow(), ainame.c_str());
|
||||
#endif
|
||||
return (ai_factory == NULL ? new NullCreatureAI(creature) : ai_factory->Create(creature));
|
||||
|
|
@ -96,7 +96,7 @@ namespace FactorySelector
|
|||
ASSERT(creature->GetCreatureTemplate());
|
||||
const MovementGeneratorCreator* mv_factory = mv_registry.GetRegistryItem(creature->GetDefaultMovementType());
|
||||
|
||||
/* if (mv_factory == NULL)
|
||||
/* if (mv_factory == nullptr)
|
||||
{
|
||||
int best_val = -1;
|
||||
StringVector l;
|
||||
|
|
@ -105,7 +105,7 @@ namespace FactorySelector
|
|||
{
|
||||
const MovementGeneratorCreator *factory = mv_registry.GetRegistryItem((*iter).c_str());
|
||||
const SelectableMovement *p = dynamic_cast<const SelectableMovement *>(factory);
|
||||
ASSERT(p != NULL);
|
||||
ASSERT(p != nullptr);
|
||||
int val = p->Permit(creature);
|
||||
if (val > best_val)
|
||||
{
|
||||
|
|
@ -121,7 +121,7 @@ namespace FactorySelector
|
|||
|
||||
GameObjectAI* SelectGameObjectAI(GameObject* go)
|
||||
{
|
||||
const GameObjectAICreator* ai_factory = NULL;
|
||||
const GameObjectAICreator* ai_factory = nullptr;
|
||||
GameObjectAIRegistry& ai_registry(*GameObjectAIRegistry::instance());
|
||||
|
||||
if (GameObjectAI* scriptedAI = sScriptMgr->GetGameObjectAI(go))
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ Creature* SummonList::GetCreatureWithEntry(uint32 entry) const
|
|||
return summon;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ScriptedAI::ScriptedAI(Creature* creature) : CreatureAI(creature),
|
||||
|
|
@ -207,7 +207,7 @@ void ScriptedAI::DoPlaySoundToSet(WorldObject* source, uint32 soundId)
|
|||
|
||||
void ScriptedAI::DoPlayMusic(uint32 soundId, bool zone)
|
||||
{
|
||||
ObjectList* targets = NULL;
|
||||
ObjectList* targets = nullptr;
|
||||
|
||||
if (me && me->FindMap())
|
||||
{
|
||||
|
|
@ -253,11 +253,11 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec
|
|||
{
|
||||
//No target so we can't cast
|
||||
if (!target)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
//Silenced so we can't cast
|
||||
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
//Using the extended script system we first create a list of viable spells
|
||||
SpellInfo const* apSpell[CREATURE_MAX_SPELLS];
|
||||
|
|
@ -265,7 +265,7 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec
|
|||
|
||||
uint32 spellCount = 0;
|
||||
|
||||
SpellInfo const* tempSpell = NULL;
|
||||
SpellInfo const* tempSpell = nullptr;
|
||||
|
||||
//Check if each spell is viable(set it to null if not)
|
||||
for (uint32 i = 0; i < CREATURE_MAX_SPELLS; i++)
|
||||
|
|
@ -321,7 +321,7 @@ SpellInfo const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mec
|
|||
|
||||
//We got our usable spells so now lets randomly pick one
|
||||
if (!spellCount)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return apSpell[urand(0, spellCount - 1)];
|
||||
}
|
||||
|
|
@ -377,7 +377,7 @@ void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
|
|||
|
||||
Unit* ScriptedAI::DoSelectLowestHpFriendly(float range, uint32 minHPDiff)
|
||||
{
|
||||
Unit* unit = NULL;
|
||||
Unit* unit = nullptr;
|
||||
acore::MostHPMissingInRange u_check(me, range, minHPDiff);
|
||||
acore::UnitLastSearcher<acore::MostHPMissingInRange> searcher(me, unit, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
|
|
@ -405,7 +405,7 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 u
|
|||
|
||||
Player* ScriptedAI::GetPlayerAtMinimumRange(float minimumRange)
|
||||
{
|
||||
Player* player = NULL;
|
||||
Player* player = nullptr;
|
||||
|
||||
CellCoord pair(acore::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
|
||||
Cell cell(pair);
|
||||
|
|
@ -456,9 +456,9 @@ bool ScriptedAI::EnterEvadeIfOutOfCombatArea()
|
|||
if (me->IsInEvadeMode() || !me->IsInCombat())
|
||||
return false;
|
||||
|
||||
if (_evadeCheckCooldown == time(NULL))
|
||||
if (_evadeCheckCooldown == time(nullptr))
|
||||
return false;
|
||||
_evadeCheckCooldown = time(NULL);
|
||||
_evadeCheckCooldown = time(nullptr);
|
||||
|
||||
if (!CheckEvadeIfOutOfCombatArea())
|
||||
return false;
|
||||
|
|
@ -484,7 +484,7 @@ Player* ScriptedAI::SelectTargetFromPlayerList(float maxdist, uint32 excludeAura
|
|||
if (!tList.empty())
|
||||
return tList[urand(0,tList.size()-1)];
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// BossAI - for instanced bosses
|
||||
|
|
@ -492,7 +492,7 @@ Player* ScriptedAI::SelectTargetFromPlayerList(float maxdist, uint32 excludeAura
|
|||
BossAI::BossAI(Creature* creature, uint32 bossId) : ScriptedAI(creature),
|
||||
instance(creature->GetInstanceScript()),
|
||||
summons(creature),
|
||||
_boundary(instance ? instance->GetBossBoundary(bossId) : NULL),
|
||||
_boundary(instance ? instance->GetBossBoundary(bossId) : nullptr),
|
||||
_bossId(bossId)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ npc_escortAI::npc_escortAI(Creature* creature) : ScriptedAI(creature),
|
|||
m_uiPlayerCheckTimer(0),
|
||||
m_uiEscortState(STATE_ESCORT_NONE),
|
||||
MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE),
|
||||
m_pQuestForEscort(NULL),
|
||||
m_pQuestForEscort(nullptr),
|
||||
m_bIsActiveAttacker(true),
|
||||
m_bIsRunning(false),
|
||||
m_bCanInstantRespawn(false),
|
||||
|
|
@ -116,7 +116,7 @@ void npc_escortAI::JustDied(Unit* /*killer*/)
|
|||
{
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
|
||||
if (Player* member = groupRef->GetSource())
|
||||
if (member->IsInMap(player) && member->GetQuestStatus(m_pQuestForEscort->GetQuestId()) == QUEST_STATUS_INCOMPLETE)
|
||||
member->FailQuest(m_pQuestForEscort->GetQuestId());
|
||||
|
|
@ -158,7 +158,7 @@ void npc_escortAI::EnterEvadeMode()
|
|||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->CombatStop(true);
|
||||
me->SetLootRecipient(NULL);
|
||||
me->SetLootRecipient(nullptr);
|
||||
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
{
|
||||
|
|
@ -183,7 +183,7 @@ bool npc_escortAI::IsPlayerOrGroupInRange()
|
|||
{
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
|
||||
if (Player* member = groupRef->GetSource())
|
||||
if (me->IsWithinDistInMap(member, GetMaxPlayerDistance()))
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ FollowerAI::FollowerAI(Creature* creature) : ScriptedAI(creature),
|
|||
m_uiLeaderGUID(0),
|
||||
m_uiUpdateFollowTimer(2500),
|
||||
m_uiFollowState(STATE_FOLLOW_NONE),
|
||||
m_pQuestForFollow(NULL)
|
||||
m_pQuestForFollow(nullptr)
|
||||
{}
|
||||
|
||||
void FollowerAI::AttackStart(Unit* who)
|
||||
|
|
@ -109,7 +109,7 @@ void FollowerAI::JustDied(Unit* /*pKiller*/)
|
|||
{
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
|
||||
{
|
||||
if (Player* member = groupRef->GetSource())
|
||||
{
|
||||
|
|
@ -144,7 +144,7 @@ void FollowerAI::EnterEvadeMode()
|
|||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->CombatStop(true);
|
||||
me->SetLootRecipient(NULL);
|
||||
me->SetLootRecipient(nullptr);
|
||||
|
||||
if (HasFollowState(STATE_FOLLOW_INPROGRESS))
|
||||
{
|
||||
|
|
@ -200,7 +200,7 @@ void FollowerAI::UpdateAI(uint32 uiDiff)
|
|||
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
|
||||
{
|
||||
Player* member = groupRef->GetSource();
|
||||
|
||||
|
|
@ -315,7 +315,7 @@ Player* FollowerAI::GetLeaderForFollower()
|
|||
{
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
|
||||
{
|
||||
Player* member = groupRef->GetSource();
|
||||
|
||||
|
|
@ -335,7 +335,7 @@ Player* FollowerAI::GetLeaderForFollower()
|
|||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI GetLeader can not find suitable leader.");
|
||||
#endif
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void FollowerAI::SetFollowComplete(bool bWithEndEvent)
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class FollowerAI : public ScriptedAI
|
|||
void UpdateAI(uint32); //the "internal" update, calls UpdateFollowerAI()
|
||||
virtual void UpdateFollowerAI(uint32); //used when it's needed to add code in update (abilities, scripted events, etc)
|
||||
|
||||
void StartFollow(Player* player, uint32 factionForFollower = 0, const Quest* quest = NULL);
|
||||
void StartFollow(Player* player, uint32 factionForFollower = 0, const Quest* quest = nullptr);
|
||||
|
||||
void SetFollowPaused(bool bPaused); //if special event require follow mode to hold/resume during the follow
|
||||
void SetFollowComplete(bool bWithEndEvent = false);
|
||||
|
|
|
|||
|
|
@ -24,13 +24,13 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
|
|||
{
|
||||
// copy script to local (protection for table reload)
|
||||
|
||||
mWayPoints = NULL;
|
||||
mWayPoints = nullptr;
|
||||
mEscortState = SMART_ESCORT_NONE;
|
||||
mCurrentWPID = 0;//first wp id is 1 !!
|
||||
mWPReached = false;
|
||||
mOOCReached = false;
|
||||
mWPPauseTimer = 0;
|
||||
mLastWP = NULL;
|
||||
mLastWP = nullptr;
|
||||
mEscortNPCFlags = 0;
|
||||
|
||||
mCanRepeatPath = false;
|
||||
|
|
@ -91,7 +91,7 @@ void SmartAI::UpdateDespawn(const uint32 diff)
|
|||
WayPoint* SmartAI::GetNextWayPoint()
|
||||
{
|
||||
if (!mWayPoints || mWayPoints->empty())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
mCurrentWPID++;
|
||||
WPPath::const_iterator itr = mWayPoints->find(mCurrentWPID);
|
||||
|
|
@ -103,7 +103,7 @@ WayPoint* SmartAI::GetNextWayPoint()
|
|||
|
||||
return (*itr).second;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void SmartAI::GenerateWayPointArray(Movement::PointsArray* points)
|
||||
|
|
@ -273,8 +273,8 @@ void SmartAI::StopPath(uint32 DespawnTime, uint32 quest, bool fail)
|
|||
void SmartAI::EndPath(bool fail)
|
||||
{
|
||||
RemoveEscortState(SMART_ESCORT_ESCORTING | SMART_ESCORT_PAUSED | SMART_ESCORT_RETURNING);
|
||||
mWayPoints = NULL;
|
||||
mLastWP = NULL;
|
||||
mWayPoints = nullptr;
|
||||
mLastWP = nullptr;
|
||||
mWPPauseTimer = 0;
|
||||
|
||||
if (mEscortNPCFlags)
|
||||
|
|
@ -291,7 +291,7 @@ void SmartAI::EndPath(bool fail)
|
|||
Player* player = (*targets->begin())->ToPlayer();
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
|
||||
{
|
||||
Player* groupGuy = groupRef->GetSource();
|
||||
if (!groupGuy || !player->IsInMap(groupGuy))
|
||||
|
|
@ -525,7 +525,7 @@ bool SmartAI::IsEscortInvokerInRange()
|
|||
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
|
||||
{
|
||||
Player* groupGuy = groupRef->GetSource();
|
||||
|
||||
|
|
@ -629,7 +629,7 @@ void SmartAI::EnterEvadeMode()
|
|||
me->DeleteThreatList();
|
||||
me->CombatStop(true);
|
||||
me->LoadCreaturesAddon(true);
|
||||
me->SetLootRecipient(NULL);
|
||||
me->SetLootRecipient(nullptr);
|
||||
me->ResetPlayerDamageReq();
|
||||
me->SetLastDamagedTime(0);
|
||||
|
||||
|
|
@ -1190,7 +1190,7 @@ class SmartTrigger : public AreaTriggerScript
|
|||
sLog->outDebug(LOG_FILTER_DATABASE_AI, "AreaTrigger %u is using SmartTrigger script", trigger->entry);
|
||||
#endif
|
||||
SmartScript script;
|
||||
script.OnInitialize(NULL, trigger);
|
||||
script.OnInitialize(nullptr, trigger);
|
||||
script.ProcessEventsFor(SMART_EVENT_AREATRIGGER_ONTRIGGER, player, trigger->entry);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class SmartAI : public CreatureAI
|
|||
explicit SmartAI(Creature* c);
|
||||
|
||||
// Start moving to the desired MovePoint
|
||||
void StartPath(bool run = false, uint32 path = 0, bool repeat = false, Unit* invoker = NULL);
|
||||
void StartPath(bool run = false, uint32 path = 0, bool repeat = false, Unit* invoker = nullptr);
|
||||
bool LoadPath(uint32 entry);
|
||||
void PausePath(uint32 delay, bool forced = false);
|
||||
void StopPath(uint32 DespawnTime = 0, uint32 quest = 0, bool fail = false);
|
||||
|
|
@ -66,7 +66,7 @@ class SmartAI : public CreatureAI
|
|||
// Called at reaching home after evade, InitializeAI(), EnterEvadeMode() for resetting variables
|
||||
void JustReachedHome();
|
||||
|
||||
// Called for reaction at enter to combat if not in combat yet (enemy can be NULL)
|
||||
// Called for reaction at enter to combat if not in combat yet (enemy can be nullptr)
|
||||
void EnterCombat(Unit* enemy);
|
||||
|
||||
// Called for reaction at stopping attack at no attackers or targets
|
||||
|
|
|
|||
|
|
@ -50,9 +50,9 @@ public:
|
|||
|
||||
SmartScript::SmartScript()
|
||||
{
|
||||
go = NULL;
|
||||
me = NULL;
|
||||
trigger = NULL;
|
||||
go = nullptr;
|
||||
me = nullptr;
|
||||
trigger = nullptr;
|
||||
mEventPhase = 0;
|
||||
mPathId = 0;
|
||||
mTargetStorage = new ObjectListMap();
|
||||
|
|
@ -122,7 +122,7 @@ void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint3
|
|||
if (eventType == e/* && (!(*i).event.event_phase_mask || IsInPhase((*i).event.event_phase_mask)) && !((*i).event.event_flags & SMART_EVENT_FLAG_NOT_REPEATABLE && (*i).runOnce)*/)
|
||||
{
|
||||
ConditionList conds = sConditionMgr->GetConditionsForSmartEvent((*i).entryOrGuid, (*i).event_id, (*i).source_type);
|
||||
ConditionSourceInfo info = ConditionSourceInfo(unit, GetBaseObject(), me ? me->GetVictim() : NULL);
|
||||
ConditionSourceInfo info = ConditionSourceInfo(unit, GetBaseObject(), me ? me->GetVictim() : nullptr);
|
||||
|
||||
if (sConditionMgr->IsObjectMeetToConditions(info, conds))
|
||||
ProcessEvent(*i, unit, var0, var1, bvar, spell, gob);
|
||||
|
|
@ -154,8 +154,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
case SMART_ACTION_TALK:
|
||||
{
|
||||
ObjectList* targets = GetTargets(e, unit);
|
||||
Creature* talker = e.target.type == 0 ? me : NULL; // xinef: tc retardness fix
|
||||
Unit* talkTarget = NULL;
|
||||
Creature* talker = e.target.type == 0 ? me : nullptr; // xinef: tc retardness fix
|
||||
Unit* talkTarget = nullptr;
|
||||
if (targets)
|
||||
{
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
|
|
@ -316,7 +316,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
}
|
||||
case SMART_ACTION_MUSIC:
|
||||
{
|
||||
ObjectList* targets = NULL;
|
||||
ObjectList* targets = nullptr;
|
||||
|
||||
if (e.action.music.type > 0)
|
||||
{
|
||||
|
|
@ -367,7 +367,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
}
|
||||
case SMART_ACTION_RANDOM_MUSIC:
|
||||
{
|
||||
ObjectList* targets = NULL;
|
||||
ObjectList* targets = nullptr;
|
||||
|
||||
if (e.action.randomMusic.type > 0)
|
||||
{
|
||||
|
|
@ -1045,7 +1045,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
me->DoFleeToGetAssistance();
|
||||
if (e.action.flee.withEmote)
|
||||
{
|
||||
AcoreStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_FLEE, LANG_UNIVERSAL, NULL);
|
||||
AcoreStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_FLEE, LANG_UNIVERSAL, nullptr);
|
||||
sCreatureTextMgr->SendChatPacket(me, builder, CHAT_MSG_MONSTER_EMOTE);
|
||||
}
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
|
|
@ -1358,7 +1358,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
(*itr)->ToCreature()->CallForHelp((float)e.action.callHelp.range);
|
||||
if (e.action.callHelp.withEmote)
|
||||
{
|
||||
AcoreStringTextBuilder builder(*itr, CHAT_MSG_MONSTER_EMOTE, LANG_CALL_FOR_HELP, LANG_UNIVERSAL, NULL);
|
||||
AcoreStringTextBuilder builder(*itr, CHAT_MSG_MONSTER_EMOTE, LANG_CALL_FOR_HELP, LANG_UNIVERSAL, nullptr);
|
||||
sCreatureTextMgr->SendChatPacket(*itr, builder, CHAT_MSG_MONSTER_EMOTE);
|
||||
}
|
||||
}
|
||||
|
|
@ -1916,7 +1916,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
if (!IsSmart())
|
||||
break;
|
||||
|
||||
WorldObject* target = NULL;
|
||||
WorldObject* target = nullptr;
|
||||
|
||||
if (e.GetTargetType() == SMART_TARGET_RANDOM_POINT)
|
||||
{
|
||||
|
|
@ -2125,7 +2125,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
meOrigGUID = me ? me->GetGUID() : 0;
|
||||
if (!goOrigGUID)
|
||||
goOrigGUID = go ? go->GetGUID() : 0;
|
||||
go = NULL;
|
||||
go = nullptr;
|
||||
me = (*itr)->ToCreature();
|
||||
break;
|
||||
}
|
||||
|
|
@ -2136,7 +2136,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
if (!goOrigGUID)
|
||||
goOrigGUID = go ? go->GetGUID() : 0;
|
||||
go = (*itr)->ToGameObject();
|
||||
me = NULL;
|
||||
me = nullptr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -2817,7 +2817,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
|||
waypoints[4] = e.action.closestWaypointFromList.wp5;
|
||||
waypoints[5] = e.action.closestWaypointFromList.wp6;
|
||||
float distanceToClosest = std::numeric_limits<float>::max();
|
||||
WayPoint* closestWp = NULL;
|
||||
WayPoint* closestWp = nullptr;
|
||||
|
||||
ObjectList* targets = GetTargets(e, unit);
|
||||
if (targets)
|
||||
|
|
@ -3304,7 +3304,7 @@ void SmartScript::ProcessTimedAction(SmartScriptHolder& e, uint32 const& min, ui
|
|||
{
|
||||
// xinef: extended by selfs victim
|
||||
ConditionList const conds = sConditionMgr->GetConditionsForSmartEvent(e.entryOrGuid, e.event_id, e.source_type);
|
||||
ConditionSourceInfo info = ConditionSourceInfo(unit, GetBaseObject(), me ? me->GetVictim() : NULL);
|
||||
ConditionSourceInfo info = ConditionSourceInfo(unit, GetBaseObject(), me ? me->GetVictim() : nullptr);
|
||||
|
||||
if (sConditionMgr->IsObjectMeetToConditions(info, conds))
|
||||
{
|
||||
|
|
@ -3428,7 +3428,7 @@ SmartScriptHolder SmartScript::CreateSmartEvent(SMART_EVENT e, uint32 event_flag
|
|||
|
||||
ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*= NULL*/)
|
||||
{
|
||||
Unit* scriptTrigger = NULL;
|
||||
Unit* scriptTrigger = nullptr;
|
||||
if (invoker)
|
||||
scriptTrigger = invoker;
|
||||
else if (Unit* tempLastInvoker = GetLastInvoker())
|
||||
|
|
@ -3517,7 +3517,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
|||
{
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
|
||||
for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
|
||||
if (Player* member = groupRef->GetSource())
|
||||
if (member->IsInMap(player))
|
||||
l->push_back(member);
|
||||
|
|
@ -3626,7 +3626,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
|||
}
|
||||
case SMART_TARGET_CREATURE_GUID:
|
||||
{
|
||||
Creature* target = NULL;
|
||||
Creature* target = nullptr;
|
||||
if (!scriptTrigger && !baseObject)
|
||||
{
|
||||
sLog->outError("SMART_TARGET_CREATURE_GUID can not be used without invoker");
|
||||
|
|
@ -3649,7 +3649,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
|||
}
|
||||
case SMART_TARGET_GAMEOBJECT_GUID:
|
||||
{
|
||||
GameObject* target = NULL;
|
||||
GameObject* target = nullptr;
|
||||
if (!scriptTrigger && !GetBaseObject())
|
||||
{
|
||||
sLog->outError("SMART_TARGET_GAMEOBJECT_GUID can not be used without invoker");
|
||||
|
|
@ -3863,7 +3863,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
|||
if (l->empty())
|
||||
{
|
||||
delete l;
|
||||
l = NULL;
|
||||
l = nullptr;
|
||||
}
|
||||
|
||||
return l;
|
||||
|
|
@ -4325,7 +4325,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
|||
if (!me || !me->IsInCombat())
|
||||
return;
|
||||
|
||||
ObjectList* _targets = NULL;
|
||||
ObjectList* _targets = nullptr;
|
||||
|
||||
switch (e.GetTargetType())
|
||||
{
|
||||
|
|
@ -4345,7 +4345,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
|||
if (!_targets)
|
||||
return;
|
||||
|
||||
Unit* target = NULL;
|
||||
Unit* target = nullptr;
|
||||
|
||||
for (ObjectList::const_iterator itr = _targets->begin(); itr != _targets->end(); ++itr)
|
||||
{
|
||||
|
|
@ -4374,7 +4374,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
|||
if (!me)
|
||||
return;
|
||||
|
||||
WorldObject* creature = NULL;
|
||||
WorldObject* creature = nullptr;
|
||||
|
||||
if (e.event.distance.guid != 0)
|
||||
{
|
||||
|
|
@ -4405,7 +4405,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
|||
if (!me)
|
||||
return;
|
||||
|
||||
WorldObject* gameobject = NULL;
|
||||
WorldObject* gameobject = nullptr;
|
||||
|
||||
if (e.event.distance.guid != 0)
|
||||
{
|
||||
|
|
@ -4704,14 +4704,14 @@ void SmartScript::GetScript()
|
|||
e = sSmartScriptMgr->GetScript(-((int32)me->GetDBTableGUIDLow()), mScriptType);
|
||||
if (e.empty())
|
||||
e = sSmartScriptMgr->GetScript((int32)me->GetEntry(), mScriptType);
|
||||
FillScript(e, me, NULL);
|
||||
FillScript(e, me, nullptr);
|
||||
}
|
||||
else if (go)
|
||||
{
|
||||
e = sSmartScriptMgr->GetScript(-((int32)go->GetDBTableGUIDLow()), mScriptType);
|
||||
if (e.empty())
|
||||
e = sSmartScriptMgr->GetScript((int32)go->GetEntry(), mScriptType);
|
||||
FillScript(e, go, NULL);
|
||||
FillScript(e, go, nullptr);
|
||||
}
|
||||
else if (trigger)
|
||||
{
|
||||
|
|
@ -4854,9 +4854,9 @@ return 0;
|
|||
Unit* SmartScript::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff)
|
||||
{
|
||||
if (!me)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
Unit* unit = NULL;
|
||||
Unit* unit = nullptr;
|
||||
|
||||
acore::MostHPMissingInRange u_check(me, range, MinHPDiff);
|
||||
acore::UnitLastSearcher<acore::MostHPMissingInRange> searcher(me, unit, u_check);
|
||||
|
|
@ -4887,9 +4887,9 @@ void SmartScript::DoFindFriendlyMissingBuff(std::list<Creature*>& list, float ra
|
|||
Unit* SmartScript::DoFindClosestFriendlyInRange(float range, bool playerOnly)
|
||||
{
|
||||
if (!me)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
Unit* unit = NULL;
|
||||
Unit* unit = nullptr;
|
||||
acore::AnyFriendlyNotSelfUnitInObjectRangeCheck u_check(me, me, range, playerOnly);
|
||||
acore::UnitLastSearcher<acore::AnyFriendlyNotSelfUnitInObjectRangeCheck> searcher(me, unit, u_check);
|
||||
me->VisitNearbyObject(range, searcher);
|
||||
|
|
@ -4933,5 +4933,5 @@ Unit* SmartScript::GetLastInvoker(Unit* invoker)
|
|||
// xinef: used for area triggers invoker cast
|
||||
else if (invoker)
|
||||
return ObjectAccessor::GetUnit(*invoker, mLastInvoker);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,19 +23,19 @@ class SmartScript
|
|||
SmartScript();
|
||||
~SmartScript();
|
||||
|
||||
void OnInitialize(WorldObject* obj, AreaTrigger const* at = NULL);
|
||||
void OnInitialize(WorldObject* obj, AreaTrigger const* at = nullptr);
|
||||
void GetScript();
|
||||
void FillScript(SmartAIEventList e, WorldObject* obj, AreaTrigger const* at);
|
||||
|
||||
void ProcessEventsFor(SMART_EVENT e, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = NULL, GameObject* gob = NULL);
|
||||
void ProcessEvent(SmartScriptHolder& e, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = NULL, GameObject* gob = NULL);
|
||||
void ProcessEventsFor(SMART_EVENT e, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = NULL, GameObject* gob = nullptr);
|
||||
void ProcessEvent(SmartScriptHolder& e, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = NULL, GameObject* gob = nullptr);
|
||||
bool CheckTimer(SmartScriptHolder const& e) const;
|
||||
void RecalcTimer(SmartScriptHolder& e, uint32 min, uint32 max);
|
||||
void UpdateTimer(SmartScriptHolder& e, uint32 const diff);
|
||||
void InitTimer(SmartScriptHolder& e);
|
||||
void ProcessAction(SmartScriptHolder& e, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = NULL, GameObject* gob = NULL);
|
||||
void ProcessTimedAction(SmartScriptHolder& e, uint32 const& min, uint32 const& max, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = NULL, GameObject* gob = NULL);
|
||||
ObjectList* GetTargets(SmartScriptHolder const& e, Unit* invoker = NULL);
|
||||
void ProcessAction(SmartScriptHolder& e, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = NULL, GameObject* gob = nullptr);
|
||||
void ProcessTimedAction(SmartScriptHolder& e, uint32 const& min, uint32 const& max, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = NULL, GameObject* gob = nullptr);
|
||||
ObjectList* GetTargets(SmartScriptHolder const& e, Unit* invoker = nullptr);
|
||||
ObjectList* GetWorldObjectsInDist(float dist);
|
||||
void InstallTemplate(SmartScriptHolder const& e);
|
||||
SmartScriptHolder CreateSmartEvent(SMART_EVENT e, uint32 event_flags, uint32 event_param1, uint32 event_param2, uint32 event_param3, uint32 event_param4, uint32 event_param5, SMART_ACTION action, uint32 action_param1, uint32 action_param2, uint32 action_param3, uint32 action_param4, uint32 action_param5, uint32 action_param6, SMARTAI_TARGETS t, uint32 target_param1, uint32 target_param2, uint32 target_param3, uint32 target_param4, uint32 phaseMask);
|
||||
|
|
@ -44,7 +44,7 @@ class SmartScript
|
|||
uint32 GetPathId() const { return mPathId; }
|
||||
WorldObject* GetBaseObject()
|
||||
{
|
||||
WorldObject* obj = NULL;
|
||||
WorldObject* obj = nullptr;
|
||||
if (me)
|
||||
obj = me;
|
||||
else if (go)
|
||||
|
|
@ -97,7 +97,7 @@ class SmartScript
|
|||
(*mTargetStorage)[id] = new ObjectGuidList(targets, GetBaseObject());
|
||||
}
|
||||
|
||||
bool IsSmart(Creature* c = NULL)
|
||||
bool IsSmart(Creature* c = nullptr)
|
||||
{
|
||||
bool smart = true;
|
||||
if (c && c->GetAIName() != "SmartAI")
|
||||
|
|
@ -112,7 +112,7 @@ class SmartScript
|
|||
return smart;
|
||||
}
|
||||
|
||||
bool IsSmartGO(GameObject* g = NULL)
|
||||
bool IsSmartGO(GameObject* g = nullptr)
|
||||
{
|
||||
bool smart = true;
|
||||
if (g && g->GetAIName() != "SmartGameObjectAI")
|
||||
|
|
@ -131,7 +131,7 @@ class SmartScript
|
|||
ObjectListMap::iterator itr = mTargetStorage->find(id);
|
||||
if (itr != mTargetStorage->end())
|
||||
return (*itr).second->GetObjectList();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void StoreCounter(uint32 id, uint32 value, uint32 reset)
|
||||
|
|
@ -160,7 +160,7 @@ class SmartScript
|
|||
|
||||
GameObject* FindGameObjectNear(WorldObject* searchObject, uint32 guid) const
|
||||
{
|
||||
GameObject* gameObject = NULL;
|
||||
GameObject* gameObject = nullptr;
|
||||
|
||||
CellCoord p(acore::ComputeCellCoord(searchObject->GetPositionX(), searchObject->GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
|
@ -176,7 +176,7 @@ class SmartScript
|
|||
|
||||
Creature* FindCreatureNear(WorldObject* searchObject, uint32 guid) const
|
||||
{
|
||||
Creature* creature = NULL;
|
||||
Creature* creature = nullptr;
|
||||
CellCoord p(acore::ComputeCellCoord(searchObject->GetPositionX(), searchObject->GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
||||
|
|
@ -199,14 +199,14 @@ class SmartScript
|
|||
if (Creature* m = HashMapHolder<Creature>::Find(meOrigGUID))
|
||||
{
|
||||
me = m;
|
||||
go = NULL;
|
||||
go = nullptr;
|
||||
}
|
||||
}
|
||||
if (goOrigGUID)
|
||||
{
|
||||
if (GameObject* o = HashMapHolder<GameObject>::Find(goOrigGUID))
|
||||
{
|
||||
me = NULL;
|
||||
me = nullptr;
|
||||
go = o;
|
||||
}
|
||||
}
|
||||
|
|
@ -216,7 +216,7 @@ class SmartScript
|
|||
|
||||
//TIMED_ACTIONLIST (script type 9 aka script9)
|
||||
void SetScript9(SmartScriptHolder& e, uint32 entry);
|
||||
Unit* GetLastInvoker(Unit* invoker = NULL);
|
||||
Unit* GetLastInvoker(Unit* invoker = nullptr);
|
||||
uint64 mLastInvoker;
|
||||
typedef std::unordered_map<uint32, uint32> CounterMap;
|
||||
CounterMap mCounterList;
|
||||
|
|
|
|||
|
|
@ -1711,7 +1711,7 @@ class ObjectGuidList
|
|||
public:
|
||||
ObjectGuidList(ObjectList* objectList, WorldObject* baseObject)
|
||||
{
|
||||
ASSERT(objectList != NULL);
|
||||
ASSERT(objectList != nullptr);
|
||||
m_objectList = objectList;
|
||||
m_baseObject = baseObject;
|
||||
m_guidList = new GuidList();
|
||||
|
|
|
|||
|
|
@ -642,7 +642,7 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQ
|
|||
continue;
|
||||
}
|
||||
|
||||
if (criteria->timeLimit && time_t(date + criteria->timeLimit) < time(NULL))
|
||||
if (criteria->timeLimit && time_t(date + criteria->timeLimit) < time(nullptr))
|
||||
continue;
|
||||
|
||||
CriteriaProgress& progress = m_criteriaProgress[id];
|
||||
|
|
@ -701,7 +701,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
|
|||
WorldPacket data(SMSG_ACHIEVEMENT_EARNED, 8+4+8);
|
||||
data.append(GetPlayer()->GetPackGUID());
|
||||
data << uint32(achievement->ID);
|
||||
data.AppendPackedTime(time(NULL));
|
||||
data.AppendPackedTime(time(nullptr));
|
||||
data << uint32(0);
|
||||
GetPlayer()->SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), true);
|
||||
}
|
||||
|
|
@ -767,7 +767,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::UpdateAchievementCriteria(%u, %u, %u)", type, miscValue1, miscValue2);
|
||||
#endif
|
||||
|
||||
AchievementCriteriaEntryList const* achievementCriteriaList = NULL;
|
||||
AchievementCriteriaEntryList const* achievementCriteriaList = nullptr;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
|
|
@ -891,7 +891,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
if (achievement->categoryId == CATEGORY_CHILDRENS_WEEK)
|
||||
{
|
||||
AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(), NULL))
|
||||
if (!data || !data->Meets(GetPlayer(), nullptr))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -1274,7 +1274,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
{
|
||||
// Xinef: skip progress only if data exists and is not meet
|
||||
AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria);
|
||||
if (data && !data->Meets(GetPlayer(), NULL))
|
||||
if (data && !data->Meets(GetPlayer(), nullptr))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -1684,7 +1684,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
|||
{
|
||||
// those requirements couldn't be found in the dbc
|
||||
AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria);
|
||||
if (!data || !data->Meets(GetPlayer(), NULL))
|
||||
if (!data || !data->Meets(GetPlayer(), nullptr))
|
||||
continue;
|
||||
|
||||
// Check map id requirement
|
||||
|
|
@ -1987,7 +1987,7 @@ CriteriaProgress* AchievementMgr::GetCriteriaProgress(AchievementCriteriaEntry c
|
|||
CriteriaProgressMap::iterator iter = m_criteriaProgress.find(entry->ID);
|
||||
|
||||
if (iter == m_criteriaProgress.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return &(iter->second);
|
||||
}
|
||||
|
|
@ -2043,7 +2043,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry,
|
|||
}
|
||||
|
||||
progress->changed = true;
|
||||
progress->date = time(NULL); // set the date to the latest update.
|
||||
progress->date = time(nullptr); // set the date to the latest update.
|
||||
|
||||
uint32 timeElapsed = 0;
|
||||
bool timedCompleted = false;
|
||||
|
|
@ -2163,7 +2163,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
|
|||
|
||||
SendAchievementEarned(achievement);
|
||||
CompletedAchievementData& ca = m_completedAchievements[achievement->ID];
|
||||
ca.date = time(NULL);
|
||||
ca.date = time(nullptr);
|
||||
ca.changed = true;
|
||||
|
||||
sScriptMgr->OnAchievementComplete(GetPlayer(), achievement);
|
||||
|
|
@ -2238,7 +2238,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
|
|||
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
|
||||
Item* item = reward->itemId ? Item::CreateItem(reward->itemId, 1, GetPlayer()) : NULL;
|
||||
Item* item = reward->itemId ? Item::CreateItem(reward->itemId, 1, GetPlayer()) : nullptr;
|
||||
if (item)
|
||||
{
|
||||
// save new item before send
|
||||
|
|
@ -2275,7 +2275,7 @@ void AchievementMgr::BuildAllDataPacket(WorldPacket* data, bool inspect) const
|
|||
{
|
||||
if (!m_completedAchievements.empty())
|
||||
{
|
||||
AchievementEntry const* achievement = NULL;
|
||||
AchievementEntry const* achievement = nullptr;
|
||||
for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter)
|
||||
{
|
||||
// Skip hidden achievements
|
||||
|
|
@ -2311,7 +2311,7 @@ bool AchievementMgr::HasAchieved(uint32 achievementId) const
|
|||
|
||||
bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement)
|
||||
{
|
||||
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, criteria->ID, NULL))
|
||||
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, criteria->ID, nullptr))
|
||||
return false;
|
||||
|
||||
if (achievement->mapID != -1 && GetPlayer()->GetMapId() != uint32(achievement->mapID))
|
||||
|
|
@ -2716,7 +2716,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData()
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!GetCriteriaDataSet(criteria) && !DisableMgr::IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, entryId, NULL))
|
||||
if (!GetCriteriaDataSet(criteria) && !DisableMgr::IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, entryId, nullptr))
|
||||
sLog->outErrorDb("Table `achievement_criteria_data` does not have expected data for criteria (Entry: %u Type: %u) for achievement %u.", criteria->ID, criteria->requiredType, criteria->referredAchievement);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ class AchievementMgr
|
|||
void LoadFromDB(PreparedQueryResult achievementResult, PreparedQueryResult criteriaResult);
|
||||
void SaveToDB(SQLTransaction& trans);
|
||||
void ResetAchievementCriteria(AchievementCriteriaCondition condition, uint32 value, bool evenIfCriteriaComplete = false);
|
||||
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit* unit = NULL);
|
||||
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit* unit = nullptr);
|
||||
void CompletedAchievement(AchievementEntry const* entry);
|
||||
void CheckAllAchievementCriteria();
|
||||
void SendAllAchievementData() const;
|
||||
|
|
@ -312,14 +312,14 @@ class AchievementGlobalMgr
|
|||
{
|
||||
if (m_SpecialList[type].find(val) != m_SpecialList[type].end())
|
||||
return &m_SpecialList[type][val];
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AchievementCriteriaEntryList const* GetAchievementCriteriaByCondition(AchievementCriteriaCondition condition, uint32 val)
|
||||
{
|
||||
if (m_AchievementCriteriasByCondition[condition].find(val) != m_AchievementCriteriasByCondition[condition].end())
|
||||
return &m_AchievementCriteriasByCondition[condition][val];
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AchievementCriteriaEntryList const& GetTimedAchievementCriteriaByType(AchievementCriteriaTimedTypes type) const
|
||||
|
|
@ -330,31 +330,31 @@ class AchievementGlobalMgr
|
|||
AchievementCriteriaEntryList const* GetAchievementCriteriaByAchievement(uint32 id) const
|
||||
{
|
||||
AchievementCriteriaListByAchievement::const_iterator itr = m_AchievementCriteriaListByAchievement.find(id);
|
||||
return itr != m_AchievementCriteriaListByAchievement.end() ? &itr->second : NULL;
|
||||
return itr != m_AchievementCriteriaListByAchievement.end() ? &itr->second : nullptr;
|
||||
}
|
||||
|
||||
AchievementEntryList const* GetAchievementByReferencedId(uint32 id) const
|
||||
{
|
||||
AchievementListByReferencedId::const_iterator itr = m_AchievementListByReferencedId.find(id);
|
||||
return itr != m_AchievementListByReferencedId.end() ? &itr->second : NULL;
|
||||
return itr != m_AchievementListByReferencedId.end() ? &itr->second : nullptr;
|
||||
}
|
||||
|
||||
AchievementReward const* GetAchievementReward(AchievementEntry const* achievement) const
|
||||
{
|
||||
AchievementRewards::const_iterator iter = m_achievementRewards.find(achievement->ID);
|
||||
return iter != m_achievementRewards.end() ? &iter->second : NULL;
|
||||
return iter != m_achievementRewards.end() ? &iter->second : nullptr;
|
||||
}
|
||||
|
||||
AchievementRewardLocale const* GetAchievementRewardLocale(AchievementEntry const* achievement) const
|
||||
{
|
||||
AchievementRewardLocales::const_iterator iter = m_achievementRewardLocales.find(achievement->ID);
|
||||
return iter != m_achievementRewardLocales.end() ? &iter->second : NULL;
|
||||
return iter != m_achievementRewardLocales.end() ? &iter->second : nullptr;
|
||||
}
|
||||
|
||||
AchievementCriteriaDataSet const* GetCriteriaDataSet(AchievementCriteriaEntry const* achievementCriteria) const
|
||||
{
|
||||
AchievementCriteriaDataMap::const_iterator iter = m_criteriaDataMap.find(achievementCriteria->ID);
|
||||
return iter != m_criteriaDataMap.end() ? &iter->second : NULL;
|
||||
return iter != m_criteriaDataMap.end() ? &iter->second : nullptr;
|
||||
}
|
||||
|
||||
bool IsRealmCompleted(AchievementEntry const* achievement) const;
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ SavedAddon const* GetAddonInfo(const std::string& name)
|
|||
return &addon;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
BannedAddonList const* GetBannedAddons()
|
||||
|
|
|
|||
|
|
@ -449,7 +449,7 @@ bool AuctionHouseObject::RemoveAuction(AuctionEntry* auction)
|
|||
|
||||
// we need to delete the entry, it is not referenced any more
|
||||
delete auction;
|
||||
auction = NULL;
|
||||
auction = nullptr;
|
||||
|
||||
return wasInMap;
|
||||
}
|
||||
|
|
@ -630,7 +630,7 @@ bool AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
|
|||
// These are found in ItemRandomSuffix.dbc and ItemRandomProperties.dbc
|
||||
// even though the DBC name seems misleading
|
||||
|
||||
char* const* suffix = NULL;
|
||||
char* const* suffix = nullptr;
|
||||
|
||||
if (propRefID < 0)
|
||||
{
|
||||
|
|
@ -701,7 +701,7 @@ bool AuctionEntry::BuildAuctionInfo(WorldPacket& data) const
|
|||
data << uint32(bid ? GetAuctionOutBid() : 0);
|
||||
// Minimal outbid
|
||||
data << uint32(buyout); // Auction->buyout
|
||||
data << uint32((expire_time - time(NULL)) * IN_MILLISECONDS); // time left
|
||||
data << uint32((expire_time - time(nullptr)) * IN_MILLISECONDS); // time left
|
||||
data << uint64(bidder); // auction->bidder current
|
||||
data << uint32(bid); // current bid
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class AuctionHouseObject
|
|||
AuctionEntry* GetAuction(uint32 id) const
|
||||
{
|
||||
AuctionEntryMap::const_iterator itr = AuctionsMap.find(id);
|
||||
return itr != AuctionsMap.end() ? itr->second : NULL;
|
||||
return itr != AuctionsMap.end() ? itr->second : nullptr;
|
||||
}
|
||||
|
||||
void AddAuction(AuctionEntry* auction);
|
||||
|
|
@ -148,7 +148,7 @@ class AuctionHouseMgr
|
|||
if (itr != mAitems.end())
|
||||
return itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//auction messages
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ void Battlefield::HandlePlayerEnterZone(Player* player, uint32 /*zone*/)
|
|||
else // No more vacant places
|
||||
{
|
||||
// TODO: Send a packet to announce it to player
|
||||
m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = time(NULL) + (player->IsGameMaster() ? 30*MINUTE : 10);
|
||||
m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = time(nullptr) + (player->IsGameMaster() ? 30*MINUTE : 10);
|
||||
InvitePlayerToQueue(player);
|
||||
}
|
||||
}
|
||||
|
|
@ -167,7 +167,7 @@ bool Battlefield::Update(uint32 diff)
|
|||
// Kick players who chose not to accept invitation to the battle
|
||||
if (m_uiKickDontAcceptTimer <= diff)
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
time_t now = time(nullptr);
|
||||
for (int team = 0; team < 2; team++)
|
||||
for (PlayerTimerMap::iterator itr = m_InvitedPlayers[team].begin(); itr != m_InvitedPlayers[team].end(); ++itr)
|
||||
if (itr->second <= now)
|
||||
|
|
@ -253,7 +253,7 @@ void Battlefield::InvitePlayersInZoneToWar()
|
|||
if (m_PlayersInWar[player->GetTeamId()].size() + m_InvitedPlayers[player->GetTeamId()].size() < m_MaxPlayer)
|
||||
InvitePlayerToWar(player);
|
||||
else if (m_PlayersWillBeKick[player->GetTeamId()].count(player->GetGUID()) == 0)// Battlefield is full of players
|
||||
m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = time(NULL) + 10;
|
||||
m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = time(nullptr) + 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -277,7 +277,7 @@ void Battlefield::InvitePlayerToWar(Player* player)
|
|||
if (player->getLevel() < m_MinLevel)
|
||||
{
|
||||
if (m_PlayersWillBeKick[player->GetTeamId()].count(player->GetGUID()) == 0)
|
||||
m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = time(NULL) + 10;
|
||||
m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = time(nullptr) + 10;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -286,7 +286,7 @@ void Battlefield::InvitePlayerToWar(Player* player)
|
|||
return;
|
||||
|
||||
m_PlayersWillBeKick[player->GetTeamId()].erase(player->GetGUID());
|
||||
m_InvitedPlayers[player->GetTeamId()][player->GetGUID()] = time(NULL) + m_TimeForAcceptInvite;
|
||||
m_InvitedPlayers[player->GetTeamId()][player->GetGUID()] = time(nullptr) + m_TimeForAcceptInvite;
|
||||
player->GetSession()->SendBfInvitePlayerToWar(m_BattleId, m_ZoneId, m_TimeForAcceptInvite);
|
||||
}
|
||||
|
||||
|
|
@ -523,7 +523,7 @@ Group* Battlefield::GetFreeBfRaid(TeamId TeamId)
|
|||
if (!group->IsFull())
|
||||
return group;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Group* Battlefield::GetGroupPlayer(uint64 guid, TeamId TeamId)
|
||||
|
|
@ -533,7 +533,7 @@ Group* Battlefield::GetGroupPlayer(uint64 guid, TeamId TeamId)
|
|||
if (group->IsMember(guid))
|
||||
return group;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool Battlefield::AddOrSetPlayerToCorrectBfGroup(Player* player)
|
||||
|
|
@ -588,12 +588,12 @@ BfGraveyard* Battlefield::GetGraveyardById(uint32 id) const
|
|||
else
|
||||
sLog->outError("Battlefield::GetGraveyardById Id:%u cant be found", id);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GraveyardStruct const * Battlefield::GetClosestGraveyard(Player* player)
|
||||
{
|
||||
BfGraveyard* closestGY = NULL;
|
||||
BfGraveyard* closestGY = nullptr;
|
||||
float maxdist = -1;
|
||||
for (uint8 i = 0; i < m_GraveyardList.size(); i++)
|
||||
{
|
||||
|
|
@ -614,7 +614,7 @@ GraveyardStruct const * Battlefield::GetClosestGraveyard(Player* player)
|
|||
if (closestGY)
|
||||
return sGraveyard->GetGraveyard(closestGY->GetGraveyardId());
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Battlefield::AddPlayerToResurrectQueue(uint64 npcGuid, uint64 playerGuid)
|
||||
|
|
@ -752,7 +752,7 @@ void BfGraveyard::GiveControlTo(TeamId team)
|
|||
|
||||
void BfGraveyard::RelocateDeadPlayers()
|
||||
{
|
||||
GraveyardStruct const* closestGrave = NULL;
|
||||
GraveyardStruct const* closestGrave = nullptr;
|
||||
for (GuidSet::const_iterator itr = m_ResurrectQueue.begin(); itr != m_ResurrectQueue.end(); ++itr)
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(*itr);
|
||||
|
|
@ -796,7 +796,7 @@ Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, fl
|
|||
{
|
||||
sLog->outError("Battlefield::SpawnCreature: Can't create creature entry: %u", entry);
|
||||
delete creature;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
creature->setFaction(BattlefieldFactions[teamId]);
|
||||
|
|
@ -806,7 +806,7 @@ Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, fl
|
|||
if (!cinfo)
|
||||
{
|
||||
sLog->outErrorDb("Battlefield::SpawnCreature: entry %u does not exist.", entry);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
// force using DB speeds -- do we really need this?
|
||||
creature->SetSpeed(MOVE_WALK, cinfo->speed_walk);
|
||||
|
|
@ -833,7 +833,7 @@ GameObject* Battlefield::SpawnGameObject(uint32 entry, float x, float y, float z
|
|||
sLog->outErrorDb("Battlefield::SpawnGameObject: Gameobject template %u not found in database! Battlefield not created!", entry);
|
||||
sLog->outError("Battlefield::SpawnGameObject: Cannot create gameobject template %u! Battlefield not created!", entry);
|
||||
delete go;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Add to world
|
||||
|
|
|
|||
|
|
@ -416,7 +416,7 @@ class Battlefield : public ZoneScript
|
|||
Battlefield::BfCapturePointMap::const_iterator itr = m_capturePoints.find(lowguid);
|
||||
if (itr != m_capturePoints.end())
|
||||
return itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void RegisterZone(uint32 zoneid);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ void WorldSession::SendBfInvitePlayerToWar(uint32 BattleId, uint32 ZoneId, uint3
|
|||
WorldPacket data(SMSG_BATTLEFIELD_MGR_ENTRY_INVITE, 12);
|
||||
data << uint32(BattleId);
|
||||
data << uint32(ZoneId);
|
||||
data << uint32((time(NULL) + p_time));
|
||||
data << uint32((time(nullptr) + p_time));
|
||||
|
||||
//Sending the packet to player
|
||||
SendPacket(&data);
|
||||
|
|
|
|||
|
|
@ -105,10 +105,10 @@ Battlefield *BattlefieldMgr::GetBattlefieldToZoneId(uint32 zoneid)
|
|||
if (itr == m_BattlefieldMap.end())
|
||||
{
|
||||
// no handle for this zone, return
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (!itr->second->IsEnabled())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return itr->second;
|
||||
}
|
||||
|
||||
|
|
@ -119,7 +119,7 @@ Battlefield *BattlefieldMgr::GetBattlefieldByBattleId(uint32 battleid)
|
|||
if ((*itr)->GetBattleId() == battleid)
|
||||
return (*itr);
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void BattlefieldMgr::Update(uint32 diff)
|
||||
|
|
@ -140,5 +140,5 @@ ZoneScript *BattlefieldMgr::GetZoneScript(uint32 zoneId)
|
|||
if (itr != m_BattlefieldMap.end())
|
||||
return itr->second;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -888,7 +888,7 @@ void BattlefieldWG::FillInitialWorldStates(WorldPacket& data)
|
|||
data << uint32(BATTLEFIELD_WG_WORLD_STATE_SHOW_WORLDSTATE) << uint32(IsWarTime() ? 1 : 0);
|
||||
|
||||
for (uint32 i = 0; i < 2; ++i)
|
||||
data << ClockWorldState[i] << uint32(time(NULL) + (m_Timer / 1000));
|
||||
data << ClockWorldState[i] << uint32(time(nullptr) + (m_Timer / 1000));
|
||||
|
||||
data << uint32(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_H) << uint32(GetData(BATTLEFIELD_WG_DATA_VEHICLE_H));
|
||||
data << uint32(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_H) << GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H);
|
||||
|
|
@ -1140,7 +1140,7 @@ WintergraspCapturePoint::WintergraspCapturePoint(BattlefieldWG* battlefield, Tea
|
|||
{
|
||||
m_Bf = battlefield;
|
||||
m_team = teamInControl;
|
||||
m_Workshop = NULL;
|
||||
m_Workshop = nullptr;
|
||||
}
|
||||
|
||||
void WintergraspCapturePoint::ChangeTeam(TeamId /*oldTeam*/)
|
||||
|
|
|
|||
|
|
@ -391,7 +391,7 @@ void ArenaTeam::Disband()
|
|||
|
||||
void ArenaTeam::Roster(WorldSession* session)
|
||||
{
|
||||
Player* player = NULL;
|
||||
Player* player = nullptr;
|
||||
|
||||
uint8 unk308 = 0;
|
||||
std::string tempName;
|
||||
|
|
@ -950,5 +950,5 @@ ArenaTeamMember* ArenaTeam::GetMember(uint64 guid)
|
|||
if (itr->Guid == guid)
|
||||
return &(*itr);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ ArenaTeam* ArenaTeamMgr::GetArenaTeamById(uint32 arenaTeamId) const
|
|||
if (itr != ArenaTeamStore.end())
|
||||
return itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ArenaTeam* ArenaTeamMgr::GetArenaTeamByName(const std::string& arenaTeamName) const
|
||||
|
|
@ -53,7 +53,7 @@ ArenaTeam* ArenaTeamMgr::GetArenaTeamByName(const std::string& arenaTeamName) co
|
|||
if (search == teamName)
|
||||
return itr->second;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ArenaTeam* ArenaTeamMgr::GetArenaTeamByCaptain(uint64 guid) const
|
||||
|
|
@ -62,7 +62,7 @@ ArenaTeam* ArenaTeamMgr::GetArenaTeamByCaptain(uint64 guid) const
|
|||
if (itr->second->GetCaptain() == guid)
|
||||
return itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ArenaTeamMgr::AddArenaTeam(ArenaTeam* arenaTeam)
|
||||
|
|
@ -119,7 +119,7 @@ void ArenaTeamMgr::LoadArenaTeams()
|
|||
|
||||
if (!newArenaTeam->LoadArenaTeamFromDB(result) || !newArenaTeam->LoadMembersFromDB(result2))
|
||||
{
|
||||
newArenaTeam->Disband(NULL);
|
||||
newArenaTeam->Disband(nullptr);
|
||||
delete newArenaTeam;
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace acore
|
|||
class BattlegroundChatBuilder
|
||||
{
|
||||
public:
|
||||
BattlegroundChatBuilder(ChatMsg msgtype, uint32 textId, Player const* source, va_list* args = NULL)
|
||||
BattlegroundChatBuilder(ChatMsg msgtype, uint32 textId, Player const* source, va_list* args = nullptr)
|
||||
: _msgtype(msgtype), _textId(textId), _source(source), _args(args) { }
|
||||
|
||||
void operator()(WorldPacket& data, LocaleConstant loc_idx)
|
||||
|
|
@ -138,7 +138,7 @@ Battleground::Battleground()
|
|||
m_MinPlayersPerTeam = 0;
|
||||
|
||||
m_MapId = 0;
|
||||
m_Map = NULL;
|
||||
m_Map = nullptr;
|
||||
m_StartMaxDist = 0.0f;
|
||||
ScriptId = 0;
|
||||
|
||||
|
|
@ -163,8 +163,8 @@ Battleground::Battleground()
|
|||
m_ArenaTeamMMR[TEAM_ALLIANCE] = 0;
|
||||
m_ArenaTeamMMR[TEAM_HORDE] = 0;
|
||||
|
||||
m_BgRaids[TEAM_ALLIANCE] = NULL;
|
||||
m_BgRaids[TEAM_HORDE] = NULL;
|
||||
m_BgRaids[TEAM_ALLIANCE] = nullptr;
|
||||
m_BgRaids[TEAM_HORDE] = nullptr;
|
||||
|
||||
m_PlayersCount[TEAM_ALLIANCE] = 0;
|
||||
m_PlayersCount[TEAM_HORDE] = 0;
|
||||
|
|
@ -216,8 +216,8 @@ Battleground::~Battleground()
|
|||
{
|
||||
m_Map->SetUnload();
|
||||
//unlink to prevent crash, always unlink all pointer reference before destruction
|
||||
m_Map->SetBG(NULL);
|
||||
m_Map = NULL;
|
||||
m_Map->SetBG(nullptr);
|
||||
m_Map = nullptr;
|
||||
}
|
||||
|
||||
for (BattlegroundScoreMap::const_iterator itr = PlayerScores.begin(); itr != PlayerScores.end(); ++itr)
|
||||
|
|
@ -329,7 +329,7 @@ inline void Battleground::_ProcessResurrect(uint32 diff)
|
|||
{
|
||||
for (std::map<uint64, std::vector<uint64> >::iterator itr = m_ReviveQueue.begin(); itr != m_ReviveQueue.end(); ++itr)
|
||||
{
|
||||
Creature* sh = NULL;
|
||||
Creature* sh = nullptr;
|
||||
for (std::vector<uint64>::const_iterator itr2 = (itr->second).begin(); itr2 != (itr->second).end(); ++itr2)
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(*itr2);
|
||||
|
|
@ -741,8 +741,8 @@ void Battleground::EndBattleground(TeamId winnerTeamId)
|
|||
bool bValidArena = isArena() && isRated() && GetStatus() == STATUS_IN_PROGRESS && GetStartTime() >= startDelay+15000; // pussywizard: only if arena lasted at least 15 secs
|
||||
SetStatus(STATUS_WAIT_LEAVE);
|
||||
|
||||
ArenaTeam* winnerArenaTeam = NULL;
|
||||
ArenaTeam* loserArenaTeam = NULL;
|
||||
ArenaTeam* winnerArenaTeam = nullptr;
|
||||
ArenaTeam* loserArenaTeam = nullptr;
|
||||
|
||||
uint32 loserTeamRating = 0;
|
||||
uint32 loserMatchmakerRating = 0;
|
||||
|
|
@ -770,7 +770,7 @@ void Battleground::EndBattleground(TeamId winnerTeamId)
|
|||
else
|
||||
SetWinner(TEAM_NEUTRAL);
|
||||
|
||||
PreparedStatement* stmt = NULL;
|
||||
PreparedStatement* stmt = nullptr;
|
||||
uint64 battlegroundId = 1;
|
||||
if (isBattleground() && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE))
|
||||
{
|
||||
|
|
@ -1133,7 +1133,7 @@ void Battleground::RemovePlayerAtLeave(Player* player)
|
|||
if (Group* group = GetBgRaid(teamId))
|
||||
if (group->IsMember(player->GetGUID()))
|
||||
if (!group->RemoveMember(player->GetGUID())) // group was disbanded
|
||||
SetBgRaid(teamId, NULL);
|
||||
SetBgRaid(teamId, nullptr);
|
||||
|
||||
// let others know
|
||||
sBattlegroundMgr->BuildPlayerLeftBattlegroundPacket(&data, player->GetGUID());
|
||||
|
|
@ -1422,7 +1422,7 @@ void Battleground::UpdatePlayerScore(Player* player, uint32 type, uint32 value,
|
|||
{
|
||||
// reward honor instantly
|
||||
if (doAddHonor)
|
||||
player->RewardHonor(NULL, 1, value); // RewardHonor calls UpdatePlayerScore with doAddHonor = false
|
||||
player->RewardHonor(nullptr, 1, value); // RewardHonor calls UpdatePlayerScore with doAddHonor = false
|
||||
else
|
||||
itr->second->BonusHonor += value;
|
||||
}
|
||||
|
|
@ -1482,7 +1482,7 @@ void Battleground::RelocateDeadPlayers(uint64 queueIndex)
|
|||
std::vector<uint64>& ghostList = m_ReviveQueue[queueIndex];
|
||||
if (!ghostList.empty())
|
||||
{
|
||||
GraveyardStruct const* closestGrave = NULL;
|
||||
GraveyardStruct const* closestGrave = nullptr;
|
||||
for (std::vector<uint64>::const_iterator itr = ghostList.begin(); itr != ghostList.end(); ++itr)
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(*itr);
|
||||
|
|
@ -1624,7 +1624,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, float x, float y,
|
|||
|
||||
Map* map = FindBgMap();
|
||||
if (!map)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
if (transport)
|
||||
{
|
||||
|
|
@ -1636,7 +1636,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, float x, float y,
|
|||
return creature;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Creature* creature = new Creature();
|
||||
|
|
@ -1645,7 +1645,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, float x, float y,
|
|||
sLog->outError("Battleground::AddCreature: cannot create creature (entry: %u) for BG (map: %u, instance id: %u)!",
|
||||
entry, m_MapId, m_InstanceID);
|
||||
delete creature;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
creature->SetHomePosition(x, y, z, o);
|
||||
|
|
@ -1656,7 +1656,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, float x, float y,
|
|||
sLog->outError("Battleground::AddCreature: creature template (entry: %u) does not exist for BG (map: %u, instance id: %u)!",
|
||||
entry, m_MapId, m_InstanceID);
|
||||
delete creature;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
// Force using DB speeds
|
||||
creature->SetSpeed(MOVE_WALK, cinfo->speed_walk);
|
||||
|
|
@ -1665,7 +1665,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, float x, float y,
|
|||
if (!map->AddToMap(creature))
|
||||
{
|
||||
delete creature;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
BgCreatures[type] = creature->GetGUID();
|
||||
|
|
@ -1783,7 +1783,7 @@ void Battleground::SendWarningToAll(uint32 entry, ...)
|
|||
vsnprintf(str, 1024, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
ChatHandler::BuildChatPacket(localizedPackets[itr->second->GetSession()->GetSessionDbLocaleIndex()], CHAT_MSG_RAID_BOSS_EMOTE, LANG_UNIVERSAL, NULL, NULL, str);
|
||||
ChatHandler::BuildChatPacket(localizedPackets[itr->second->GetSession()->GetSessionDbLocaleIndex()], CHAT_MSG_RAID_BOSS_EMOTE, LANG_UNIVERSAL, nullptr, nullptr, str);
|
||||
}
|
||||
|
||||
itr->second->SendDirectMessage(&localizedPackets[itr->second->GetSession()->GetSessionDbLocaleIndex()]);
|
||||
|
|
@ -1956,7 +1956,7 @@ void Battleground::SetBgRaid(TeamId teamId, Group* bg_raid)
|
|||
{
|
||||
Group*& old_raid = m_BgRaids[teamId];
|
||||
if (old_raid)
|
||||
old_raid->SetBattlegroundGroup(NULL);
|
||||
old_raid->SetBattlegroundGroup(nullptr);
|
||||
if (bg_raid)
|
||||
bg_raid->SetBattlegroundGroup(this);
|
||||
old_raid = bg_raid;
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ enum BattlegroundTeams
|
|||
|
||||
struct BattlegroundObjectInfo
|
||||
{
|
||||
BattlegroundObjectInfo() : object(NULL), timer(0), spellid(0) {}
|
||||
BattlegroundObjectInfo() : object(nullptr), timer(0), spellid(0) {}
|
||||
|
||||
GameObject *object;
|
||||
int32 timer;
|
||||
|
|
@ -484,7 +484,7 @@ class Battleground
|
|||
void BlockMovement(Player* player);
|
||||
|
||||
void SendWarningToAll(uint32 entry, ...);
|
||||
void SendMessageToAll(uint32 entry, ChatMsg type, Player const* source = NULL);
|
||||
void SendMessageToAll(uint32 entry, ChatMsg type, Player const* source = nullptr);
|
||||
void PSendMessageToAll(uint32 entry, ChatMsg type, Player const* source, ...);
|
||||
|
||||
// specialized version with 2 string id args
|
||||
|
|
@ -555,7 +555,7 @@ class Battleground
|
|||
BGCreatures BgCreatures;
|
||||
void SpawnBGObject(uint32 type, uint32 respawntime);
|
||||
bool AddObject(uint32 type, uint32 entry, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime = 0, GOState goState = GO_STATE_READY);
|
||||
Creature* AddCreature(uint32 entry, uint32 type, float x, float y, float z, float o, uint32 respawntime = 0, MotionTransport* transport = NULL);
|
||||
Creature* AddCreature(uint32 entry, uint32 type, float x, float y, float z, float o, uint32 respawntime = 0, MotionTransport* transport = nullptr);
|
||||
bool DelCreature(uint32 type);
|
||||
bool DelObject(uint32 type);
|
||||
bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, TeamId teamId);
|
||||
|
|
@ -586,38 +586,38 @@ class Battleground
|
|||
// because BattleGrounds with different types and same level range has different m_BracketId
|
||||
uint8 GetUniqueBracketId() const;
|
||||
|
||||
BattlegroundAV* ToBattlegroundAV() { if (GetBgTypeID(true) == BATTLEGROUND_AV) return reinterpret_cast<BattlegroundAV*>(this); else return NULL; }
|
||||
BattlegroundAV const* ToBattlegroundAV() const { if (GetBgTypeID(true) == BATTLEGROUND_AV) return reinterpret_cast<const BattlegroundAV*>(this); else return NULL; }
|
||||
BattlegroundAV* ToBattlegroundAV() { if (GetBgTypeID(true) == BATTLEGROUND_AV) return reinterpret_cast<BattlegroundAV*>(this); else return nullptr; }
|
||||
BattlegroundAV const* ToBattlegroundAV() const { if (GetBgTypeID(true) == BATTLEGROUND_AV) return reinterpret_cast<const BattlegroundAV*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundWS* ToBattlegroundWS() { if (GetBgTypeID(true) == BATTLEGROUND_WS) return reinterpret_cast<BattlegroundWS*>(this); else return NULL; }
|
||||
BattlegroundWS const* ToBattlegroundWS() const { if (GetBgTypeID(true) == BATTLEGROUND_WS) return reinterpret_cast<const BattlegroundWS*>(this); else return NULL; }
|
||||
BattlegroundWS* ToBattlegroundWS() { if (GetBgTypeID(true) == BATTLEGROUND_WS) return reinterpret_cast<BattlegroundWS*>(this); else return nullptr; }
|
||||
BattlegroundWS const* ToBattlegroundWS() const { if (GetBgTypeID(true) == BATTLEGROUND_WS) return reinterpret_cast<const BattlegroundWS*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundAB* ToBattlegroundAB() { if (GetBgTypeID(true) == BATTLEGROUND_AB) return reinterpret_cast<BattlegroundAB*>(this); else return NULL; }
|
||||
BattlegroundAB const* ToBattlegroundAB() const { if (GetBgTypeID(true) == BATTLEGROUND_AB) return reinterpret_cast<const BattlegroundAB*>(this); else return NULL; }
|
||||
BattlegroundAB* ToBattlegroundAB() { if (GetBgTypeID(true) == BATTLEGROUND_AB) return reinterpret_cast<BattlegroundAB*>(this); else return nullptr; }
|
||||
BattlegroundAB const* ToBattlegroundAB() const { if (GetBgTypeID(true) == BATTLEGROUND_AB) return reinterpret_cast<const BattlegroundAB*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundNA* ToBattlegroundNA() { if (GetBgTypeID(true) == BATTLEGROUND_NA) return reinterpret_cast<BattlegroundNA*>(this); else return NULL; }
|
||||
BattlegroundNA const* ToBattlegroundNA() const { if (GetBgTypeID(true) == BATTLEGROUND_NA) return reinterpret_cast<const BattlegroundNA*>(this); else return NULL; }
|
||||
BattlegroundNA* ToBattlegroundNA() { if (GetBgTypeID(true) == BATTLEGROUND_NA) return reinterpret_cast<BattlegroundNA*>(this); else return nullptr; }
|
||||
BattlegroundNA const* ToBattlegroundNA() const { if (GetBgTypeID(true) == BATTLEGROUND_NA) return reinterpret_cast<const BattlegroundNA*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundBE* ToBattlegroundBE() { if (GetBgTypeID(true) == BATTLEGROUND_BE) return reinterpret_cast<BattlegroundBE*>(this); else return NULL; }
|
||||
BattlegroundBE const* ToBattlegroundBE() const { if (GetBgTypeID(true) == BATTLEGROUND_BE) return reinterpret_cast<const BattlegroundBE*>(this); else return NULL; }
|
||||
BattlegroundBE* ToBattlegroundBE() { if (GetBgTypeID(true) == BATTLEGROUND_BE) return reinterpret_cast<BattlegroundBE*>(this); else return nullptr; }
|
||||
BattlegroundBE const* ToBattlegroundBE() const { if (GetBgTypeID(true) == BATTLEGROUND_BE) return reinterpret_cast<const BattlegroundBE*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundEY* ToBattlegroundEY() { if (GetBgTypeID(true) == BATTLEGROUND_EY) return reinterpret_cast<BattlegroundEY*>(this); else return NULL; }
|
||||
BattlegroundEY const* ToBattlegroundEY() const { if (GetBgTypeID(true) == BATTLEGROUND_EY) return reinterpret_cast<const BattlegroundEY*>(this); else return NULL; }
|
||||
BattlegroundEY* ToBattlegroundEY() { if (GetBgTypeID(true) == BATTLEGROUND_EY) return reinterpret_cast<BattlegroundEY*>(this); else return nullptr; }
|
||||
BattlegroundEY const* ToBattlegroundEY() const { if (GetBgTypeID(true) == BATTLEGROUND_EY) return reinterpret_cast<const BattlegroundEY*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundRL* ToBattlegroundRL() { if (GetBgTypeID(true) == BATTLEGROUND_RL) return reinterpret_cast<BattlegroundRL*>(this); else return NULL; }
|
||||
BattlegroundRL const* ToBattlegroundRL() const { if (GetBgTypeID(true) == BATTLEGROUND_RL) return reinterpret_cast<const BattlegroundRL*>(this); else return NULL; }
|
||||
BattlegroundRL* ToBattlegroundRL() { if (GetBgTypeID(true) == BATTLEGROUND_RL) return reinterpret_cast<BattlegroundRL*>(this); else return nullptr; }
|
||||
BattlegroundRL const* ToBattlegroundRL() const { if (GetBgTypeID(true) == BATTLEGROUND_RL) return reinterpret_cast<const BattlegroundRL*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundSA* ToBattlegroundSA() { if (GetBgTypeID(true) == BATTLEGROUND_SA) return reinterpret_cast<BattlegroundSA*>(this); else return NULL; }
|
||||
BattlegroundSA const* ToBattlegroundSA() const { if (GetBgTypeID(true) == BATTLEGROUND_SA) return reinterpret_cast<const BattlegroundSA*>(this); else return NULL; }
|
||||
BattlegroundSA* ToBattlegroundSA() { if (GetBgTypeID(true) == BATTLEGROUND_SA) return reinterpret_cast<BattlegroundSA*>(this); else return nullptr; }
|
||||
BattlegroundSA const* ToBattlegroundSA() const { if (GetBgTypeID(true) == BATTLEGROUND_SA) return reinterpret_cast<const BattlegroundSA*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundDS* ToBattlegroundDS() { if (GetBgTypeID(true) == BATTLEGROUND_DS) return reinterpret_cast<BattlegroundDS*>(this); else return NULL; }
|
||||
BattlegroundDS const* ToBattlegroundDS() const { if (GetBgTypeID(true) == BATTLEGROUND_DS) return reinterpret_cast<const BattlegroundDS*>(this); else return NULL; }
|
||||
BattlegroundDS* ToBattlegroundDS() { if (GetBgTypeID(true) == BATTLEGROUND_DS) return reinterpret_cast<BattlegroundDS*>(this); else return nullptr; }
|
||||
BattlegroundDS const* ToBattlegroundDS() const { if (GetBgTypeID(true) == BATTLEGROUND_DS) return reinterpret_cast<const BattlegroundDS*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundRV* ToBattlegroundRV() { if (GetBgTypeID(true) == BATTLEGROUND_RV) return reinterpret_cast<BattlegroundRV*>(this); else return NULL; }
|
||||
BattlegroundRV const* ToBattlegroundRV() const { if (GetBgTypeID(true) == BATTLEGROUND_RV) return reinterpret_cast<const BattlegroundRV*>(this); else return NULL; }
|
||||
BattlegroundRV* ToBattlegroundRV() { if (GetBgTypeID(true) == BATTLEGROUND_RV) return reinterpret_cast<BattlegroundRV*>(this); else return nullptr; }
|
||||
BattlegroundRV const* ToBattlegroundRV() const { if (GetBgTypeID(true) == BATTLEGROUND_RV) return reinterpret_cast<const BattlegroundRV*>(this); else return nullptr; }
|
||||
|
||||
BattlegroundIC* ToBattlegroundIC() { if (GetBgTypeID(true) == BATTLEGROUND_IC) return reinterpret_cast<BattlegroundIC*>(this); else return NULL; }
|
||||
BattlegroundIC const* ToBattlegroundIC() const { if (GetBgTypeID(true) == BATTLEGROUND_IC) return reinterpret_cast<const BattlegroundIC*>(this); else return NULL; }
|
||||
BattlegroundIC* ToBattlegroundIC() { if (GetBgTypeID(true) == BATTLEGROUND_IC) return reinterpret_cast<BattlegroundIC*>(this); else return nullptr; }
|
||||
BattlegroundIC const* ToBattlegroundIC() const { if (GetBgTypeID(true) == BATTLEGROUND_IC) return reinterpret_cast<const BattlegroundIC*>(this); else return nullptr; }
|
||||
|
||||
protected:
|
||||
// this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends Battleground
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ void BattlegroundMgr::Update(uint32 diff)
|
|||
bg->Update(diff);
|
||||
if (bg->ToBeDeleted())
|
||||
{
|
||||
itrDelete->second = NULL;
|
||||
itrDelete->second = nullptr;
|
||||
m_Battlegrounds.erase(itrDelete);
|
||||
delete bg;
|
||||
}
|
||||
|
|
@ -134,7 +134,7 @@ void BattlegroundMgr::Update(uint32 diff)
|
|||
{
|
||||
if (m_AutoDistributionTimeChecker < diff)
|
||||
{
|
||||
if (time(NULL) > m_NextAutoDistributionTime)
|
||||
if (time(nullptr) > m_NextAutoDistributionTime)
|
||||
{
|
||||
sArenaTeamMgr->DistributeArenaPoints();
|
||||
m_NextAutoDistributionTime = m_NextAutoDistributionTime + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld->getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS);
|
||||
|
|
@ -407,13 +407,13 @@ void BattlegroundMgr::BuildPlayerJoinedBattlegroundPacket(WorldPacket* data, Pla
|
|||
Battleground* BattlegroundMgr::GetBattleground(uint32 instanceId)
|
||||
{
|
||||
if (!instanceId)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
BattlegroundContainer::const_iterator itr = m_Battlegrounds.find(instanceId);
|
||||
if (itr != m_Battlegrounds.end())
|
||||
return itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Battleground* BattlegroundMgr::GetBattlegroundTemplate(BattlegroundTypeId bgTypeId)
|
||||
|
|
@ -422,7 +422,7 @@ Battleground* BattlegroundMgr::GetBattlegroundTemplate(BattlegroundTypeId bgType
|
|||
if (itr != m_BattlegroundTemplates.end())
|
||||
return itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32 BattlegroundMgr::GetNextClientVisibleInstanceId()
|
||||
|
|
@ -441,12 +441,12 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId original
|
|||
// get the template BG
|
||||
Battleground* bg_template = GetBattlegroundTemplate(bgTypeId);
|
||||
if (!bg_template)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
Battleground* bg = NULL;
|
||||
Battleground* bg = nullptr;
|
||||
// create a copy of the BG template
|
||||
if (BattlegroundMgr::bgTypeToTemplate.find(bgTypeId) == BattlegroundMgr::bgTypeToTemplate.end()) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bg = BattlegroundMgr::bgTypeToTemplate[bgTypeId](bg_template);
|
||||
|
|
@ -491,10 +491,10 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId original
|
|||
bool BattlegroundMgr::CreateBattleground(CreateBattlegroundData& data)
|
||||
{
|
||||
// Create the BG
|
||||
Battleground* bg = NULL;
|
||||
Battleground* bg = nullptr;
|
||||
bg = BattlegroundMgr::bgtypeToBattleground[data.bgTypeId];
|
||||
|
||||
if (bg == NULL)
|
||||
if (bg == nullptr)
|
||||
return false;
|
||||
|
||||
if (data.bgTypeId == BATTLEGROUND_RB)
|
||||
|
|
@ -542,7 +542,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
|
|||
|
||||
uint32 bgTypeId = fields[0].GetUInt32();
|
||||
|
||||
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, bgTypeId, NULL))
|
||||
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, bgTypeId, nullptr))
|
||||
continue;
|
||||
|
||||
// can be overwrite by values from DB
|
||||
|
|
@ -645,7 +645,7 @@ void BattlegroundMgr::InitAutomaticArenaPointDistribution()
|
|||
return;
|
||||
|
||||
time_t wstime = time_t(sWorld->getWorldState(WS_ARENA_DISTRIBUTION_TIME));
|
||||
time_t curtime = time(NULL);
|
||||
time_t curtime = time(nullptr);
|
||||
sLog->outString("AzerothCore Battleground: Initializing Automatic Arena Point Distribution");
|
||||
if (wstime < curtime)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ bool BattlegroundQueue::SelectionPool::AddGroup(GroupQueueInfo * ginfo, uint32 d
|
|||
/*** BATTLEGROUND QUEUES ***/
|
||||
/*********************************************************/
|
||||
|
||||
// add group or player (grp == NULL) to bg queue with the given leader and bg specifications
|
||||
// add group or player (grp == nullptr) to bg queue with the given leader and bg specifications
|
||||
GroupQueueInfo* BattlegroundQueue::AddGroup(Player * leader, Group * grp, PvPDifficultyEntry const* bracketEntry, bool isRated, bool isPremade, uint32 ArenaRating, uint32 MatchmakerRating, uint32 arenateamid)
|
||||
{
|
||||
BattlegroundBracketId bracketId = bracketEntry->GetBracketId();
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ bool BattlegroundEY::SetupBattleground()
|
|||
AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY);
|
||||
}
|
||||
|
||||
GraveyardStruct const* sg = NULL;
|
||||
GraveyardStruct const* sg = nullptr;
|
||||
sg = sGraveyard->GetGraveyard(BG_EY_GRAVEYARD_MAIN_ALLIANCE);
|
||||
AddSpiritGuide(BG_EY_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, TEAM_ALLIANCE);
|
||||
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ BattlegroundIC::BattlegroundIC()
|
|||
|
||||
siegeEngineWorkshopTimer = WORKSHOP_UPDATE_TIME;
|
||||
|
||||
gunshipHorde = NULL;
|
||||
gunshipAlliance = NULL;
|
||||
gunshipHorde = nullptr;
|
||||
gunshipAlliance = nullptr;
|
||||
respawnMap.clear();
|
||||
}
|
||||
|
||||
|
|
@ -127,7 +127,7 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff)
|
|||
{
|
||||
// Check if creature respawn time is properly saved
|
||||
RespawnMap::iterator itr = respawnMap.find(catapult->GetGUIDLow());
|
||||
if (itr == respawnMap.end() || time(NULL) < itr->second)
|
||||
if (itr == respawnMap.end() || time(nullptr) < itr->second)
|
||||
continue;
|
||||
|
||||
catapult->Relocate(BG_IC_DocksVehiclesCatapults[j].GetPositionX(), BG_IC_DocksVehiclesCatapults[j].GetPositionY(), BG_IC_DocksVehiclesCatapults[j].GetPositionZ(), BG_IC_DocksVehiclesCatapults[j].GetOrientation());
|
||||
|
|
@ -145,7 +145,7 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff)
|
|||
{
|
||||
// Check if creature respawn time is properly saved
|
||||
RespawnMap::iterator itr = respawnMap.find(glaiveThrower->GetGUIDLow());
|
||||
if (itr == respawnMap.end() || time(NULL) < itr->second)
|
||||
if (itr == respawnMap.end() || time(nullptr) < itr->second)
|
||||
continue;
|
||||
|
||||
glaiveThrower->Relocate(BG_IC_DocksVehiclesGlaives[j].GetPositionX(), BG_IC_DocksVehiclesGlaives[j].GetPositionY(), BG_IC_DocksVehiclesGlaives[j].GetPositionZ(), BG_IC_DocksVehiclesGlaives[j].GetOrientation());
|
||||
|
|
@ -174,7 +174,7 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff)
|
|||
{
|
||||
// Check if creature respawn time is properly saved
|
||||
RespawnMap::iterator itr = respawnMap.find(siege->GetGUIDLow());
|
||||
if (itr == respawnMap.end() || time(NULL) < itr->second)
|
||||
if (itr == respawnMap.end() || time(nullptr) < itr->second)
|
||||
continue;
|
||||
|
||||
siege->Relocate(BG_IC_WorkshopVehicles[4].GetPositionX(), BG_IC_WorkshopVehicles[4].GetPositionY(), BG_IC_WorkshopVehicles[4].GetPositionZ(), BG_IC_WorkshopVehicles[4].GetOrientation());
|
||||
|
|
@ -191,7 +191,7 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff)
|
|||
{
|
||||
// Check if creature respawn time is properly saved
|
||||
RespawnMap::iterator itr = respawnMap.find(demolisher->GetGUIDLow());
|
||||
if (itr == respawnMap.end() || time(NULL) < itr->second)
|
||||
if (itr == respawnMap.end() || time(nullptr) < itr->second)
|
||||
continue;
|
||||
|
||||
demolisher->Relocate(BG_IC_WorkshopVehicles[u].GetPositionX(), BG_IC_WorkshopVehicles[u].GetPositionY(), BG_IC_WorkshopVehicles[u].GetPositionZ(), BG_IC_WorkshopVehicles[u].GetOrientation());
|
||||
|
|
@ -519,7 +519,7 @@ void BattlegroundIC::HandleKillUnit(Creature* unit, Player* killer)
|
|||
// Xinef: Add to respawn list
|
||||
if (entry == NPC_DEMOLISHER || entry == NPC_SIEGE_ENGINE_H || entry == NPC_SIEGE_ENGINE_A ||
|
||||
entry == NPC_GLAIVE_THROWER_A || entry == NPC_GLAIVE_THROWER_H || entry == NPC_CATAPULT)
|
||||
respawnMap[unit->GetGUIDLow()] = time(NULL) + VEHICLE_RESPAWN_TIME;
|
||||
respawnMap[unit->GetGUIDLow()] = time(nullptr) + VEHICLE_RESPAWN_TIME;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -866,7 +866,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture)
|
|||
if (!siegeVehicle->IsVehicleInUse())
|
||||
Unit::Kill(siegeEngine, siegeEngine);
|
||||
|
||||
respawnMap[siegeEngine->GetGUIDLow()] = time(NULL) + VEHICLE_RESPAWN_TIME;
|
||||
respawnMap[siegeEngine->GetGUIDLow()] = time(nullptr) + VEHICLE_RESPAWN_TIME;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -958,7 +958,7 @@ GraveyardStruct const* BattlegroundIC::GetClosestGraveyard(Player* player)
|
|||
if (nodePoint[i].faction == player->GetTeamId() && !nodePoint[i].needChange) // xinef: controlled by faction and not contested!
|
||||
nodes.push_back(i);
|
||||
|
||||
GraveyardStruct const* good_entry = NULL;
|
||||
GraveyardStruct const* good_entry = nullptr;
|
||||
// If so, select the closest node to place ghost on
|
||||
if (!nodes.empty())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -334,6 +334,6 @@ GameObject* BattlegroundRV::GetPillarAtPosition(Position* p)
|
|||
{
|
||||
uint32 pillar = GetPillarIdForPos(p);
|
||||
if (!pillar)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return GetBgMap()->GetGameObject(BgObjects[pillar]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ bool BattlegroundSA::ResetObjs()
|
|||
//Graveyards!
|
||||
for (uint8 i = 0;i < BG_SA_MAX_GY; i++)
|
||||
{
|
||||
GraveyardStruct const* sg = NULL;
|
||||
GraveyardStruct const* sg = nullptr;
|
||||
sg = sGraveyard->GetGraveyard(BG_SA_GYEntries[i]);
|
||||
|
||||
if (!sg)
|
||||
|
|
@ -624,7 +624,7 @@ void BattlegroundSA::EventPlayerDamagedGO(Player* /*player*/, GameObject* go, ui
|
|||
case BG_SA_BLUE_GATE:
|
||||
case BG_SA_GREEN_GATE:
|
||||
{
|
||||
GameObject* go = NULL;
|
||||
GameObject* go = nullptr;
|
||||
if ((go = GetBGObject(BG_SA_RED_GATE)))
|
||||
go->SetDestructibleBuildingModifyState(true);
|
||||
if ((go = GetBGObject(BG_SA_PURPLE_GATE)))
|
||||
|
|
@ -764,7 +764,7 @@ void BattlegroundSA::DestroyGate(Player* player, GameObject* go)
|
|||
|
||||
GraveyardStruct const* BattlegroundSA::GetClosestGraveyard(Player* player)
|
||||
{
|
||||
GraveyardStruct const* closest = NULL;
|
||||
GraveyardStruct const* closest = nullptr;
|
||||
float mindist = 999999.0f;
|
||||
float x, y;
|
||||
|
||||
|
|
@ -884,7 +884,7 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player *Source)
|
|||
std::vector<uint64> ghost_list = m_ReviveQueue[BgCreatures[BG_SA_MAXNPC + i]];
|
||||
if (!ghost_list.empty())
|
||||
{
|
||||
GraveyardStruct const* ClosestGrave = NULL;
|
||||
GraveyardStruct const* ClosestGrave = nullptr;
|
||||
for (std::vector<uint64>::const_iterator itr = ghost_list.begin(); itr != ghost_list.end(); ++itr)
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(*itr);
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ struct CalendarInvite
|
|||
_text = calendarInvite.GetText();
|
||||
}
|
||||
|
||||
CalendarInvite() : _inviteId(1), _eventId(0), _invitee(0), _senderGUID(0), _statusTime(time(NULL)),
|
||||
CalendarInvite() : _inviteId(1), _eventId(0), _invitee(0), _senderGUID(0), _statusTime(time(nullptr)),
|
||||
_status(CALENDAR_STATUS_INVITED), _rank(CALENDAR_RANK_PLAYER), _text("") { }
|
||||
|
||||
CalendarInvite(uint64 inviteId, uint64 eventId, uint64 invitee, uint64 senderGUID, time_t statusTime,
|
||||
|
|
@ -325,7 +325,7 @@ class CalendarMgr
|
|||
void SendCalendarEventRemovedAlert(CalendarEvent const& calendarEvent);
|
||||
void SendCalendarEventModeratorStatusAlert(CalendarEvent const& calendarEvent, CalendarInvite const& invite);
|
||||
void SendCalendarClearPendingAction(uint64 guid);
|
||||
void SendCalendarCommandResult(uint64 guid, CalendarError err, char const* param = NULL);
|
||||
void SendCalendarCommandResult(uint64 guid, CalendarError err, char const* param = nullptr);
|
||||
|
||||
void SendPacketToAllEventRelatives(WorldPacket packet, CalendarEvent const& calendarEvent);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ Channel::Channel(std::string const& name, uint32 channelId, uint32 channelDBId,
|
|||
bool Channel::IsBanned(uint64 guid) const
|
||||
{
|
||||
BannedContainer::const_iterator itr = bannedStore.find(GUID_LOPART(guid));
|
||||
return itr != bannedStore.end() && itr->second > time(NULL);
|
||||
return itr != bannedStore.end() && itr->second > time(nullptr);
|
||||
}
|
||||
|
||||
void Channel::UpdateChannelInDB() const
|
||||
|
|
@ -417,8 +417,8 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b
|
|||
{
|
||||
if (!IsBanned(victim))
|
||||
{
|
||||
bannedStore[GUID_LOPART(victim)] = time(NULL) + CHANNEL_BAN_DURATION;
|
||||
AddChannelBanToDB(GUID_LOPART(victim), time(NULL) + CHANNEL_BAN_DURATION);
|
||||
bannedStore[GUID_LOPART(victim)] = time(nullptr) + CHANNEL_BAN_DURATION;
|
||||
AddChannelBanToDB(GUID_LOPART(victim), time(nullptr) + CHANNEL_BAN_DURATION);
|
||||
|
||||
if (notify)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ Channel* ChannelMgr::GetChannel(std::string const& name, Player* player, bool pk
|
|||
player->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return i->second;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ bool ChatHandler::isAvailable(ChatCommand const& cmd) const
|
|||
|
||||
bool ChatHandler::HasLowerSecurity(Player* target, uint64 guid, bool strong)
|
||||
{
|
||||
WorldSession* target_session = NULL;
|
||||
WorldSession* target_session = nullptr;
|
||||
uint32 target_account = 0;
|
||||
|
||||
if (target)
|
||||
|
|
@ -166,7 +166,7 @@ void ChatHandler::SendSysMessage(const char *str)
|
|||
|
||||
while (char* line = LineFromMessage(pos))
|
||||
{
|
||||
BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, NULL, line);
|
||||
BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
|
||||
m_session->SendPacket(&data);
|
||||
}
|
||||
|
||||
|
|
@ -184,7 +184,7 @@ void ChatHandler::SendGlobalSysMessage(const char *str)
|
|||
|
||||
while (char* line = LineFromMessage(pos))
|
||||
{
|
||||
BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, NULL, line);
|
||||
BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
|
||||
sWorld->SendGlobalMessage(&data);
|
||||
}
|
||||
|
||||
|
|
@ -202,7 +202,7 @@ void ChatHandler::SendGlobalGMSysMessage(const char *str)
|
|||
|
||||
while (char* line = LineFromMessage(pos))
|
||||
{
|
||||
BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, NULL, line);
|
||||
BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
|
||||
sWorld->SendGlobalGMMessage(&data);
|
||||
}
|
||||
|
||||
|
|
@ -553,7 +553,7 @@ bool ChatHandler::ShowHelpForCommand(std::vector<ChatCommand> const& table, cons
|
|||
continue;
|
||||
|
||||
// have subcommand
|
||||
char const* subcmd = (*cmd) ? strtok(NULL, " ") : "";
|
||||
char const* subcmd = (*cmd) ? strtok(nullptr, " ") : "";
|
||||
|
||||
if (!table[i].ChildCommands.empty() && subcmd && *subcmd)
|
||||
{
|
||||
|
|
@ -708,7 +708,7 @@ size_t ChatHandler::BuildChatPacket(WorldPacket& data, ChatMsg chatType, Languag
|
|||
Player* ChatHandler::getSelectedPlayer()
|
||||
{
|
||||
if (!m_session)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
uint64 selected = m_session->GetPlayer()->GetTarget();
|
||||
if (!selected)
|
||||
|
|
@ -720,7 +720,7 @@ Player* ChatHandler::getSelectedPlayer()
|
|||
Unit* ChatHandler::getSelectedUnit()
|
||||
{
|
||||
if (!m_session)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
if (Unit* selected = m_session->GetPlayer()->GetSelectedUnit())
|
||||
return selected;
|
||||
|
|
@ -731,7 +731,7 @@ Unit* ChatHandler::getSelectedUnit()
|
|||
WorldObject* ChatHandler::getSelectedObject()
|
||||
{
|
||||
if (!m_session)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
uint64 guid = m_session->GetPlayer()->GetTarget();
|
||||
|
||||
|
|
@ -744,7 +744,7 @@ WorldObject* ChatHandler::getSelectedObject()
|
|||
Creature* ChatHandler::getSelectedCreature()
|
||||
{
|
||||
if (!m_session)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return ObjectAccessor::GetCreatureOrPetOrVehicle(*m_session->GetPlayer(), m_session->GetPlayer()->GetTarget());
|
||||
}
|
||||
|
|
@ -752,7 +752,7 @@ Creature* ChatHandler::getSelectedCreature()
|
|||
Player* ChatHandler::getSelectedPlayerOrSelf()
|
||||
{
|
||||
if (!m_session)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
uint64 selected = m_session->GetPlayer()->GetTarget();
|
||||
if (!selected)
|
||||
|
|
@ -771,14 +771,14 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** s
|
|||
{
|
||||
// skip empty
|
||||
if (!text)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
// skip spaces
|
||||
while (*text == ' '||*text == '\t'||*text == '\b')
|
||||
++text;
|
||||
|
||||
if (!*text)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
// return non link case
|
||||
if (text[0] != '|')
|
||||
|
|
@ -790,28 +790,28 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** s
|
|||
|
||||
char* check = strtok(text, "|"); // skip color
|
||||
if (!check)
|
||||
return NULL; // end of data
|
||||
return nullptr; // end of data
|
||||
|
||||
char* cLinkType = strtok(NULL, ":"); // linktype
|
||||
char* cLinkType = strtok(nullptr, ":"); // linktype
|
||||
if (!cLinkType)
|
||||
return NULL; // end of data
|
||||
return nullptr; // end of data
|
||||
|
||||
if (strcmp(cLinkType, linkType) != 0)
|
||||
{
|
||||
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after retturn from function
|
||||
strtok(nullptr, " "); // skip link tail (to allow continue strtok(nullptr, s) use after retturn from function
|
||||
SendSysMessage(LANG_WRONG_LINK_TYPE);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
char* cKeys = strtok(NULL, "|"); // extract keys and values
|
||||
char* cKeysTail = strtok(NULL, "");
|
||||
char* cKeys = strtok(nullptr, "|"); // extract keys and values
|
||||
char* cKeysTail = strtok(nullptr, "");
|
||||
|
||||
char* cKey = strtok(cKeys, ":|"); // extract key
|
||||
if (something1)
|
||||
*something1 = strtok(NULL, ":|"); // extract something
|
||||
*something1 = strtok(nullptr, ":|"); // extract something
|
||||
|
||||
strtok(cKeysTail, "]"); // restart scan tail and skip name with possible spaces
|
||||
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after return from function
|
||||
strtok(nullptr, " "); // skip link tail (to allow continue strtok(nullptr, s) use after return from function
|
||||
return cKey;
|
||||
}
|
||||
|
||||
|
|
@ -819,14 +819,14 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* const* linkTypes,
|
|||
{
|
||||
// skip empty
|
||||
if (!text)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
// skip spaces
|
||||
while (*text == ' '||*text == '\t'||*text == '\b')
|
||||
++text;
|
||||
|
||||
if (!*text)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
// return non link case
|
||||
if (text[0] != '|')
|
||||
|
|
@ -844,48 +844,48 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* const* linkTypes,
|
|||
{
|
||||
char* check = strtok(text, "|"); // skip color
|
||||
if (!check)
|
||||
return NULL; // end of data
|
||||
return nullptr; // end of data
|
||||
|
||||
tail = strtok(NULL, ""); // tail
|
||||
tail = strtok(nullptr, ""); // tail
|
||||
}
|
||||
else
|
||||
tail = text+1; // skip first |
|
||||
|
||||
char* cLinkType = strtok(tail, ":"); // linktype
|
||||
if (!cLinkType)
|
||||
return NULL; // end of data
|
||||
return nullptr; // end of data
|
||||
|
||||
for (int i = 0; linkTypes[i]; ++i)
|
||||
{
|
||||
if (strcmp(cLinkType, linkTypes[i]) == 0)
|
||||
{
|
||||
char* cKeys = strtok(NULL, "|"); // extract keys and values
|
||||
char* cKeysTail = strtok(NULL, "");
|
||||
char* cKeys = strtok(nullptr, "|"); // extract keys and values
|
||||
char* cKeysTail = strtok(nullptr, "");
|
||||
|
||||
char* cKey = strtok(cKeys, ":|"); // extract key
|
||||
if (something1)
|
||||
*something1 = strtok(NULL, ":|"); // extract something
|
||||
*something1 = strtok(nullptr, ":|"); // extract something
|
||||
|
||||
strtok(cKeysTail, "]"); // restart scan tail and skip name with possible spaces
|
||||
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after return from function
|
||||
strtok(nullptr, " "); // skip link tail (to allow continue strtok(nullptr, s) use after return from function
|
||||
if (found_idx)
|
||||
*found_idx = i;
|
||||
return cKey;
|
||||
}
|
||||
}
|
||||
|
||||
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after return from function
|
||||
strtok(nullptr, " "); // skip link tail (to allow continue strtok(nullptr, s) use after return from function
|
||||
SendSysMessage(LANG_WRONG_LINK_TYPE);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GameObject* ChatHandler::GetNearbyGameObject()
|
||||
{
|
||||
if (!m_session)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
Player* pl = m_session->GetPlayer();
|
||||
GameObject* obj = NULL;
|
||||
GameObject* obj = nullptr;
|
||||
acore::NearestGameObjectCheck check(*pl);
|
||||
acore::GameObjectLastSearcher<acore::NearestGameObjectCheck> searcher(pl, obj, check);
|
||||
pl->VisitNearbyGridObject(SIZE_OF_GRIDS, searcher);
|
||||
|
|
@ -895,7 +895,7 @@ GameObject* ChatHandler::GetNearbyGameObject()
|
|||
GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid, uint32 entry)
|
||||
{
|
||||
if (!m_session)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
Player* pl = m_session->GetPlayer();
|
||||
|
||||
|
|
@ -944,7 +944,7 @@ uint32 ChatHandler::extractSpellIdFromLink(char* text)
|
|||
// number or [name] Shift-click form |color|Htalent:talent_id, rank|h[name]|h|r
|
||||
// number or [name] Shift-click form |color|Htrade:spell_id, skill_id, max_value, cur_value|h[name]|h|r
|
||||
int type = 0;
|
||||
char* param1_str = NULL;
|
||||
char* param1_str = nullptr;
|
||||
char* idS = extractKeyFromLink(text, spellKeys, &type, ¶m1_str);
|
||||
if (!idS)
|
||||
return 0;
|
||||
|
|
@ -995,7 +995,7 @@ GameTele const* ChatHandler::extractGameTeleFromLink(char* text)
|
|||
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
|
||||
char* cId = extractKeyFromLink(text, "Htele");
|
||||
if (!cId)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
// id case (explicit or from shift link)
|
||||
if (cId[0] >= '0' || cId[0] <= '9')
|
||||
|
|
@ -1141,12 +1141,12 @@ bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* playe
|
|||
void ChatHandler::extractOptFirstArg(char* args, char** arg1, char** arg2)
|
||||
{
|
||||
char* p1 = strtok(args, " ");
|
||||
char* p2 = strtok(NULL, " ");
|
||||
char* p2 = strtok(nullptr, " ");
|
||||
|
||||
if (!p2)
|
||||
{
|
||||
p2 = p1;
|
||||
p1 = NULL;
|
||||
p1 = nullptr;
|
||||
}
|
||||
|
||||
if (arg1)
|
||||
|
|
@ -1159,7 +1159,7 @@ void ChatHandler::extractOptFirstArg(char* args, char** arg1, char** arg2)
|
|||
char* ChatHandler::extractQuotedArg(char* args)
|
||||
{
|
||||
if (!*args)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
if (*args == '"')
|
||||
return strtok(args+1, "\"");
|
||||
|
|
@ -1174,7 +1174,7 @@ char* ChatHandler::extractQuotedArg(char* args)
|
|||
|
||||
// return NULL if we reached the end of the string
|
||||
if (!*args)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
// since we skipped all spaces, we expect another token now
|
||||
if (*args == '"')
|
||||
|
|
@ -1192,7 +1192,7 @@ char* ChatHandler::extractQuotedArg(char* args)
|
|||
return strtok(args + 1, "\"");
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1246,7 +1246,7 @@ bool CliHandler::needReportToTarget(Player* /*chr*/) const
|
|||
|
||||
bool ChatHandler::GetPlayerGroupAndGUIDByName(const char* cname, Player* &player, Group* &group, uint64 &guid, bool offline)
|
||||
{
|
||||
player = NULL;
|
||||
player = nullptr;
|
||||
guid = 0;
|
||||
|
||||
if (cname)
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class ChatHandler
|
|||
// Builds chat packet and returns receiver guid position in the packet to substitute in whisper builders
|
||||
static size_t BuildChatPacket(WorldPacket& data, ChatMsg chatType, Language language, WorldObject const* sender, WorldObject const* receiver, std::string const& message, uint32 achievementId = 0, std::string const& channelName = "", LocaleConstant locale = DEFAULT_LOCALE);
|
||||
|
||||
static char* LineFromMessage(char*& pos) { char* start = strtok(pos, "\n"); pos = NULL; return start; }
|
||||
static char* LineFromMessage(char*& pos) { char* start = strtok(pos, "\n"); pos = nullptr; return start; }
|
||||
|
||||
// function with different implementation for chat/console
|
||||
virtual char const* GetAcoreString(uint32 entry) const;
|
||||
|
|
@ -91,8 +91,8 @@ class ChatHandler
|
|||
// Returns either the selected player or self if there is no selected player
|
||||
Player* getSelectedPlayerOrSelf();
|
||||
|
||||
char* extractKeyFromLink(char* text, char const* linkType, char** something1 = NULL);
|
||||
char* extractKeyFromLink(char* text, char const* const* linkTypes, int* found_idx, char** something1 = NULL);
|
||||
char* extractKeyFromLink(char* text, char const* linkType, char** something1 = nullptr);
|
||||
char* extractKeyFromLink(char* text, char const* const* linkTypes, int* found_idx, char** something1 = nullptr);
|
||||
|
||||
// if args have single value then it return in arg2 and arg1 == NULL
|
||||
void extractOptFirstArg(char* args, char** arg1, char** arg2);
|
||||
|
|
@ -104,7 +104,7 @@ class ChatHandler
|
|||
bool GetPlayerGroupAndGUIDByName(const char* cname, Player* &player, Group* &group, uint64 &guid, bool offline = false);
|
||||
std::string extractPlayerNameFromLink(char* text);
|
||||
// select by arg (name/link) or in-game selection online/offline player
|
||||
bool extractPlayerTarget(char* args, Player** player, uint64* player_guid = NULL, std::string* player_name = NULL);
|
||||
bool extractPlayerTarget(char* args, Player** player, uint64* player_guid = NULL, std::string* player_name = nullptr);
|
||||
|
||||
std::string playerLink(std::string const& name) const { return m_session ? "|cffffffff|Hplayer:"+name+"|h["+name+"]|h|r" : name; }
|
||||
std::string GetNameLink(Player* chr) const;
|
||||
|
|
@ -118,7 +118,7 @@ class ChatHandler
|
|||
|
||||
bool ShowHelpForCommand(std::vector<ChatCommand> const& table, const char* cmd);
|
||||
protected:
|
||||
explicit ChatHandler() : m_session(NULL), sentErrorMessage(false) {} // for CLI subclass
|
||||
explicit ChatHandler() : m_session(nullptr), sentErrorMessage(false) {} // for CLI subclass
|
||||
static bool SetDataForCommandInTable(std::vector<ChatCommand>& table, const char* text, uint32 securityLevel, std::string const& help, std::string const& fullcommand);
|
||||
bool ExecuteCommandInTable(std::vector<ChatCommand> const& table, const char* text, std::string const& fullcmd);
|
||||
bool ShowHelpForSubCommands(std::vector<ChatCommand> const& table, char const* cmd, char const* subcmd);
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ bool ItemChatLink::ValidateName(char* buffer, const char* context)
|
|||
{
|
||||
ChatLink::ValidateName(buffer, context);
|
||||
|
||||
char* const* suffixStrings = _suffix ? _suffix->nameSuffix : (_property ? _property->nameSuffix : NULL);
|
||||
char* const* suffixStrings = _suffix ? _suffix->nameSuffix : (_property ? _property->nameSuffix : nullptr);
|
||||
|
||||
bool res = (FormatName(LOCALE_enUS, NULL, suffixStrings) == buffer);
|
||||
|
||||
|
|
@ -638,12 +638,12 @@ bool LinkExtractor::IsValidMessage()
|
|||
std::istringstream::pos_type startPos = 0;
|
||||
uint32 color = 0;
|
||||
|
||||
ChatLink* link = NULL;
|
||||
ChatLink* link = nullptr;
|
||||
while (!_iss.eof())
|
||||
{
|
||||
if (validSequence == validSequenceIterator)
|
||||
{
|
||||
link = NULL;
|
||||
link = nullptr;
|
||||
_iss.ignore(255, PIPE_CHAR);
|
||||
startPos = _iss.tellg() - std::istringstream::pos_type(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ protected:
|
|||
class ItemChatLink : public ChatLink
|
||||
{
|
||||
public:
|
||||
ItemChatLink() : ChatLink(), _item(NULL), _suffix(NULL), _property(NULL)
|
||||
ItemChatLink() : ChatLink(), _item(nullptr), _suffix(nullptr), _property(nullptr)
|
||||
{
|
||||
memset(_data, 0, sizeof(_data));
|
||||
}
|
||||
|
|
@ -65,7 +65,7 @@ protected:
|
|||
class QuestChatLink : public ChatLink
|
||||
{
|
||||
public:
|
||||
QuestChatLink() : ChatLink(), _quest(NULL), _questLevel(0) { }
|
||||
QuestChatLink() : ChatLink(), _quest(nullptr), _questLevel(0) { }
|
||||
virtual bool Initialize(std::istringstream& iss);
|
||||
virtual bool ValidateName(char* buffer, const char* context);
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ protected:
|
|||
class SpellChatLink : public ChatLink
|
||||
{
|
||||
public:
|
||||
SpellChatLink() : ChatLink(), _spell(NULL) { }
|
||||
SpellChatLink() : ChatLink(), _spell(nullptr) { }
|
||||
virtual bool Initialize(std::istringstream& iss);
|
||||
virtual bool ValidateName(char* buffer, const char* context);
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ protected:
|
|||
class AchievementChatLink : public ChatLink
|
||||
{
|
||||
public:
|
||||
AchievementChatLink() : ChatLink(), _guid(0), _achievement(NULL)
|
||||
AchievementChatLink() : ChatLink(), _guid(0), _achievement(nullptr)
|
||||
{
|
||||
memset(_data, 0, sizeof(_data));
|
||||
}
|
||||
|
|
@ -140,7 +140,7 @@ public:
|
|||
class GlyphChatLink : public SpellChatLink
|
||||
{
|
||||
public:
|
||||
GlyphChatLink() : SpellChatLink(), _slotId(0), _glyph(NULL) { }
|
||||
GlyphChatLink() : SpellChatLink(), _slotId(0), _glyph(nullptr) { }
|
||||
virtual bool Initialize(std::istringstream& iss);
|
||||
private:
|
||||
uint32 _slotId;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class HostileRefManager : public RefManager<Unit, ThreatManager>
|
|||
// send threat to all my hateres for the victim
|
||||
// The victim is hated than by them as well
|
||||
// use for buffs and healing threat functionality
|
||||
void threatAssist(Unit* victim, float baseThreat, SpellInfo const* threatSpell = NULL);
|
||||
void threatAssist(Unit* victim, float baseThreat, SpellInfo const* threatSpell = nullptr);
|
||||
|
||||
void addTempThreat(float threat, bool apply);
|
||||
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ void ThreatContainer::clearReferences()
|
|||
HostileReference* ThreatContainer::getReferenceByTarget(Unit* victim) const
|
||||
{
|
||||
if (!victim)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
uint64 const guid = victim->GetGUID();
|
||||
for (ThreatContainer::StorageType::const_iterator i = iThreatList.begin(); i != iThreatList.end(); ++i)
|
||||
|
|
@ -252,7 +252,7 @@ HostileReference* ThreatContainer::getReferenceByTarget(Unit* victim) const
|
|||
return ref;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//============================================================
|
||||
|
|
@ -293,7 +293,7 @@ HostileReference* ThreatContainer::selectNextVictim(Creature* attacker, HostileR
|
|||
{
|
||||
// pussywizard: pretty much remade this whole function
|
||||
|
||||
HostileReference* currentRef = NULL;
|
||||
HostileReference* currentRef = nullptr;
|
||||
bool found = false;
|
||||
bool noPriorityTargetFound = false;
|
||||
uint32 currTime = sWorld->GetGameTime();
|
||||
|
|
@ -303,9 +303,9 @@ HostileReference* ThreatContainer::selectNextVictim(Creature* attacker, HostileR
|
|||
{
|
||||
Unit* cvUnit = currentVictim->getTarget();
|
||||
if (!attacker->_CanDetectFeignDeathOf(cvUnit) || !attacker->CanCreatureAttack(cvUnit) || attacker->isTargetNotAcceptableByMMaps(cvUnit->GetGUID(), currTime, cvUnit)) // pussywizard: if currentVictim is not valid => don't compare the threat with it, just take the highest threat valid target
|
||||
currentVictim = NULL;
|
||||
currentVictim = nullptr;
|
||||
else if (cvUnit->IsImmunedToDamageOrSchool(attacker->GetMeleeDamageSchoolMask()) || cvUnit->HasNegativeAuraWithInterruptFlag(AURA_INTERRUPT_FLAG_TAKE_DAMAGE)) // pussywizard: no 10%/30% if currentVictim is immune to damage or has auras breakable by damage
|
||||
currentVictim = NULL;
|
||||
currentVictim = nullptr;
|
||||
}
|
||||
|
||||
ThreatContainer::StorageType::const_iterator lastRef = iThreatList.end();
|
||||
|
|
@ -361,7 +361,7 @@ HostileReference* ThreatContainer::selectNextVictim(Creature* attacker, HostileR
|
|||
break;
|
||||
}
|
||||
}
|
||||
else // pussywizard: nothing found previously was good and enough, this and next entries on the list have less than 110% threat, and currentVictim is present and valid as checked before the loop (otherwise it's NULL), so end now
|
||||
else // pussywizard: nothing found previously was good and enough, this and next entries on the list have less than 110% threat, and currentVictim is present and valid as checked before the loop (otherwise it's nullptr), so end now
|
||||
{
|
||||
currentRef = currentVictim;
|
||||
found = true;
|
||||
|
|
@ -377,7 +377,7 @@ HostileReference* ThreatContainer::selectNextVictim(Creature* attacker, HostileR
|
|||
++iter;
|
||||
}
|
||||
if (!found)
|
||||
currentRef = NULL;
|
||||
currentRef = nullptr;
|
||||
|
||||
return currentRef;
|
||||
}
|
||||
|
|
@ -386,7 +386,7 @@ HostileReference* ThreatContainer::selectNextVictim(Creature* attacker, HostileR
|
|||
//=================== ThreatManager ==========================
|
||||
//============================================================
|
||||
|
||||
ThreatManager::ThreatManager(Unit* owner) : iCurrentVictim(NULL), iOwner(owner), iUpdateTimer(THREAT_UPDATE_INTERVAL)
|
||||
ThreatManager::ThreatManager(Unit* owner) : iCurrentVictim(nullptr), iOwner(owner), iUpdateTimer(THREAT_UPDATE_INTERVAL)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -396,7 +396,7 @@ void ThreatManager::clearReferences()
|
|||
{
|
||||
iThreatContainer.clearReferences();
|
||||
iThreatOfflineContainer.clearReferences();
|
||||
iCurrentVictim = NULL;
|
||||
iCurrentVictim = nullptr;
|
||||
iUpdateTimer = THREAT_UPDATE_INTERVAL;
|
||||
}
|
||||
|
||||
|
|
@ -461,7 +461,7 @@ Unit* ThreatManager::getHostilTarget()
|
|||
iThreatContainer.update();
|
||||
HostileReference* nextVictim = iThreatContainer.selectNextVictim(GetOwner()->ToCreature(), getCurrentVictim());
|
||||
setCurrentVictim(nextVictim);
|
||||
return getCurrentVictim() != NULL ? getCurrentVictim()->getTarget() : NULL;
|
||||
return getCurrentVictim() != NULL ? getCurrentVictim()->getTarget() : nullptr;
|
||||
}
|
||||
|
||||
//============================================================
|
||||
|
|
@ -544,7 +544,7 @@ void ThreatManager::processThreatEvent(ThreatRefStatusChangeEvent* threatRefStat
|
|||
{
|
||||
if (hostilRef == getCurrentVictim())
|
||||
{
|
||||
setCurrentVictim(NULL);
|
||||
setCurrentVictim(nullptr);
|
||||
setDirty(true);
|
||||
}
|
||||
if (GetOwner() && GetOwner()->IsInWorld())
|
||||
|
|
@ -565,7 +565,7 @@ void ThreatManager::processThreatEvent(ThreatRefStatusChangeEvent* threatRefStat
|
|||
case UEV_THREAT_REF_REMOVE_FROM_LIST:
|
||||
if (hostilRef == getCurrentVictim())
|
||||
{
|
||||
setCurrentVictim(NULL);
|
||||
setCurrentVictim(nullptr);
|
||||
setDirty(true);
|
||||
}
|
||||
iOwner->SendRemoveFromThreatListOpcode(hostilRef);
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ class SpellInfo;
|
|||
|
||||
struct ThreatCalcHelper
|
||||
{
|
||||
static float calcThreat(Unit* hatedUnit, Unit* hatingUnit, float threat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = NULL);
|
||||
static bool isValidProcess(Unit* hatedUnit, Unit* hatingUnit, SpellInfo const* threatSpell = NULL);
|
||||
static float calcThreat(Unit* hatedUnit, Unit* hatingUnit, float threat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = nullptr);
|
||||
static bool isValidProcess(Unit* hatedUnit, Unit* hatingUnit, SpellInfo const* threatSpell = nullptr);
|
||||
};
|
||||
|
||||
//==============================================================
|
||||
|
|
@ -189,7 +189,7 @@ class ThreatManager
|
|||
|
||||
void clearReferences();
|
||||
|
||||
void addThreat(Unit* victim, float threat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = NULL);
|
||||
void addThreat(Unit* victim, float threat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = nullptr);
|
||||
|
||||
void doAddThreat(Unit* victim, float threat);
|
||||
|
||||
|
|
|
|||
|
|
@ -82,13 +82,13 @@ class ThreatRefStatusChangeEvent : public UnitBaseEvent
|
|||
};
|
||||
ThreatManager* iThreatManager;
|
||||
public:
|
||||
ThreatRefStatusChangeEvent(uint32 pType) : UnitBaseEvent(pType), iThreatManager(NULL) { iHostileReference = NULL; }
|
||||
ThreatRefStatusChangeEvent(uint32 pType) : UnitBaseEvent(pType), iThreatManager(nullptr) { iHostileReference = nullptr; }
|
||||
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference) : UnitBaseEvent(pType), iThreatManager(NULL) { iHostileReference = pHostileReference; }
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference) : UnitBaseEvent(pType), iThreatManager(nullptr) { iHostileReference = pHostileReference; }
|
||||
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, float pValue) : UnitBaseEvent(pType), iThreatManager(NULL) { iHostileReference = pHostileReference; iFValue = pValue; }
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, float pValue) : UnitBaseEvent(pType), iThreatManager(nullptr) { iHostileReference = pHostileReference; iFValue = pValue; }
|
||||
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, bool pValue) : UnitBaseEvent(pType), iThreatManager(NULL) { iHostileReference = pHostileReference; iBValue = pValue; }
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, bool pValue) : UnitBaseEvent(pType), iThreatManager(nullptr) { iHostileReference = pHostileReference; iBValue = pValue; }
|
||||
|
||||
int32 getIValue() const { return iIValue; }
|
||||
|
||||
|
|
@ -112,8 +112,8 @@ class ThreatManagerEvent : public ThreatRefStatusChangeEvent
|
|||
private:
|
||||
ThreatContainer* iThreatContainer;
|
||||
public:
|
||||
ThreatManagerEvent(uint32 pType) : ThreatRefStatusChangeEvent(pType), iThreatContainer(NULL) {}
|
||||
ThreatManagerEvent(uint32 pType, HostileReference* pHostileReference) : ThreatRefStatusChangeEvent(pType, pHostileReference), iThreatContainer(NULL) {}
|
||||
ThreatManagerEvent(uint32 pType) : ThreatRefStatusChangeEvent(pType), iThreatContainer(nullptr) {}
|
||||
ThreatManagerEvent(uint32 pType, HostileReference* pHostileReference) : ThreatRefStatusChangeEvent(pType, pHostileReference), iThreatContainer(nullptr) {}
|
||||
|
||||
void setThreatContainer(ThreatContainer* pThreatContainer) { iThreatContainer = pThreatContainer; }
|
||||
|
||||
|
|
|
|||
|
|
@ -165,12 +165,12 @@ struct ConditionSourceInfo
|
|||
{
|
||||
WorldObject* mConditionTargets[MAX_CONDITION_TARGETS]; // an array of targets available for conditions
|
||||
Condition* mLastFailedCondition;
|
||||
ConditionSourceInfo(WorldObject* target0, WorldObject* target1 = NULL, WorldObject* target2 = NULL)
|
||||
ConditionSourceInfo(WorldObject* target0, WorldObject* target1 = NULL, WorldObject* target2 = nullptr)
|
||||
{
|
||||
mConditionTargets[0] = target0;
|
||||
mConditionTargets[1] = target1;
|
||||
mConditionTargets[2] = target2;
|
||||
mLastFailedCondition = NULL;
|
||||
mLastFailedCondition = nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -104,10 +104,10 @@ class Lfg5Guids
|
|||
public:
|
||||
uint64 guid[5];
|
||||
LfgRolesMap* roles;
|
||||
Lfg5Guids() { memset(&guid, 0, 5*8); roles = NULL; }
|
||||
Lfg5Guids(uint64 g) { memset(&guid, 0, 5*8); guid[0] = g; roles = NULL; }
|
||||
Lfg5Guids(Lfg5Guids const& x) { memcpy(guid, x.guid, 5*8); if (x.roles) roles = new LfgRolesMap(*(x.roles)); else roles = NULL; }
|
||||
Lfg5Guids(Lfg5Guids const& x, bool /*copyRoles*/) { memcpy(guid, x.guid, 5*8); roles = NULL; }
|
||||
Lfg5Guids() { memset(&guid, 0, 5*8); roles = nullptr; }
|
||||
Lfg5Guids(uint64 g) { memset(&guid, 0, 5*8); guid[0] = g; roles = nullptr; }
|
||||
Lfg5Guids(Lfg5Guids const& x) { memcpy(guid, x.guid, 5*8); if (x.roles) roles = new LfgRolesMap(*(x.roles)); else roles = nullptr; }
|
||||
Lfg5Guids(Lfg5Guids const& x, bool /*copyRoles*/) { memcpy(guid, x.guid, 5*8); roles = nullptr; }
|
||||
~Lfg5Guids() { delete roles; }
|
||||
void addRoles(LfgRolesMap const& r) { roles = new LfgRolesMap(r); }
|
||||
void clear() { memset(&guid, 0, 5*8); }
|
||||
|
|
@ -182,7 +182,7 @@ public:
|
|||
{
|
||||
return guid[0] == x.guid[0] && guid[1] == x.guid[1] && guid[2] == x.guid[2] && guid[3] == x.guid[3] && guid[4] == x.guid[4];
|
||||
}
|
||||
void operator=(const Lfg5Guids& x) { memcpy(guid, x.guid, 5*8); delete roles; if (x.roles) roles = new LfgRolesMap(*(x.roles)); else roles = NULL; }
|
||||
void operator=(const Lfg5Guids& x) { memcpy(guid, x.guid, 5*8); delete roles; if (x.roles) roles = new LfgRolesMap(*(x.roles)); else roles = nullptr; }
|
||||
std::string toString() const // for debugging
|
||||
{
|
||||
std::ostringstream o;
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ void LFGMgr::LoadRewards()
|
|||
|
||||
uint32 count = 0;
|
||||
|
||||
Field* fields = NULL;
|
||||
Field* fields = nullptr;
|
||||
do
|
||||
{
|
||||
fields = result->Fetch();
|
||||
|
|
@ -160,7 +160,7 @@ LFGDungeonData const* LFGMgr::GetLFGDungeon(uint32 id)
|
|||
if (itr != LfgDungeonStore.end())
|
||||
return &(itr->second);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
|
||||
|
|
@ -266,7 +266,7 @@ void LFGMgr::Update(uint32 tdiff, uint8 task)
|
|||
|
||||
if (task == 0)
|
||||
{
|
||||
time_t currTime = time(NULL);
|
||||
time_t currTime = time(nullptr);
|
||||
|
||||
// Remove obsolete role checks
|
||||
for (LfgRoleCheckContainer::iterator it = RoleChecksStore.begin(); it != RoleChecksStore.end();)
|
||||
|
|
@ -656,7 +656,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
|
|||
// Create new rolecheck
|
||||
LfgRoleCheck& roleCheck = RoleChecksStore[gguid];
|
||||
roleCheck.roles.clear(); // pussywizard: NEW rolecheck, not old one with trash data >_>
|
||||
roleCheck.cancelTime = time_t(time(NULL)) + LFG_TIME_ROLECHECK;
|
||||
roleCheck.cancelTime = time_t(time(nullptr)) + LFG_TIME_ROLECHECK;
|
||||
roleCheck.state = LFG_ROLECHECK_INITIALITING;
|
||||
roleCheck.leader = guid;
|
||||
roleCheck.dungeons = dungeons;
|
||||
|
|
@ -671,7 +671,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
|
|||
SetState(gguid, LFG_STATE_ROLECHECK);
|
||||
// Send update to player
|
||||
LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_JOIN_QUEUE, dungeons, comment);
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = grp->GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
if (Player* plrg = itr->GetSource())
|
||||
{
|
||||
|
|
@ -694,7 +694,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
|
|||
LfgRolesMap rolesMap;
|
||||
rolesMap[guid] = roles;
|
||||
LFGQueue& queue = GetQueue(guid);
|
||||
queue.AddQueueData(guid, time(NULL), dungeons, rolesMap);
|
||||
queue.AddQueueData(guid, time(nullptr), dungeons, rolesMap);
|
||||
|
||||
if (!isContinue)
|
||||
{
|
||||
|
|
@ -1361,7 +1361,7 @@ void LFGMgr::UpdateRoleCheck(uint64 gguid, uint64 guid /* = 0 */, uint8 roles /*
|
|||
{
|
||||
SetState(gguid, LFG_STATE_QUEUED);
|
||||
LFGQueue& queue = GetQueue(gguid);
|
||||
queue.AddQueueData(gguid, time_t(time(NULL)), roleCheck.dungeons, roleCheck.roles);
|
||||
queue.AddQueueData(gguid, time_t(time(nullptr)), roleCheck.dungeons, roleCheck.roles);
|
||||
RoleChecksStore.erase(itRoleCheck);
|
||||
}
|
||||
else if (roleCheck.state != LFG_ROLECHECK_INITIALITING)
|
||||
|
|
@ -1493,7 +1493,7 @@ void LFGMgr::MakeNewGroup(LfgProposal const& proposal)
|
|||
LFGDungeonData const* dungeon = GetLFGDungeon(proposal.dungeonId);
|
||||
ASSERT(dungeon);
|
||||
|
||||
Group* grp = proposal.group ? sGroupMgr->GetGroupByGUID(GUID_LOPART(proposal.group)) : NULL;
|
||||
Group* grp = proposal.group ? sGroupMgr->GetGroupByGUID(GUID_LOPART(proposal.group)) : nullptr;
|
||||
uint64 oldGroupGUID = 0;
|
||||
for (LfgGuidList::const_iterator it = players.begin(); it != players.end(); ++it)
|
||||
{
|
||||
|
|
@ -1638,7 +1638,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
|
|||
|
||||
bool sendUpdate = proposal.state != LFG_PROPOSAL_SUCCESS;
|
||||
proposal.state = LFG_PROPOSAL_SUCCESS;
|
||||
time_t joinTime = time(NULL);
|
||||
time_t joinTime = time(nullptr);
|
||||
|
||||
LFGQueue& queue = GetQueue(guid);
|
||||
LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_GROUP_FOUND);
|
||||
|
|
@ -1824,7 +1824,7 @@ void LFGMgr::InitBoot(uint64 gguid, uint64 kicker, uint64 victim, std::string co
|
|||
|
||||
LfgPlayerBoot& boot = BootsStore[gguid];
|
||||
boot.inProgress = true;
|
||||
boot.cancelTime = time_t(time(NULL)) + LFG_TIME_BOOT;
|
||||
boot.cancelTime = time_t(time(nullptr)) + LFG_TIME_BOOT;
|
||||
boot.reason = reason;
|
||||
boot.victim = victim;
|
||||
|
||||
|
|
@ -1916,7 +1916,7 @@ void LFGMgr::UpdateBoot(uint64 guid, bool accept)
|
|||
*/
|
||||
void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*/)
|
||||
{
|
||||
LFGDungeonData const* dungeon = NULL;
|
||||
LFGDungeonData const* dungeon = nullptr;
|
||||
Group* group = player->GetGroup();
|
||||
|
||||
if (group && group->isLFGGroup())
|
||||
|
|
@ -1959,7 +1959,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
|
|||
if (!fromOpcode)
|
||||
{
|
||||
// Select a player inside to be teleported to
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* plrg = itr->GetSource();
|
||||
if (plrg && plrg != player && plrg->GetMapId() == uint32(dungeon->map))
|
||||
|
|
@ -2117,7 +2117,7 @@ LfgDungeonSet const& LFGMgr::GetDungeonsByRandom(uint32 randomdungeon)
|
|||
*/
|
||||
LfgReward const* LFGMgr::GetRandomDungeonReward(uint32 dungeon, uint8 level)
|
||||
{
|
||||
LfgReward const* rew = NULL;
|
||||
LfgReward const* rew = nullptr;
|
||||
LfgRewardContainerBounds bounds = RewardMapStore.equal_range(dungeon & 0x00FFFFFF);
|
||||
for (LfgRewardContainer::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ LfgCompatibility LFGQueue::FindNewGroups(const uint64& newGuid)
|
|||
{
|
||||
// unset roles here so they are not copied, restore after insertion
|
||||
LfgRolesMap* r = it->roles;
|
||||
it->roles = NULL;
|
||||
it->roles = nullptr;
|
||||
currentCompatibles.insert(*it);
|
||||
it->roles = r;
|
||||
}
|
||||
|
|
@ -409,7 +409,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(Lfg5Guids const& checkWith, const
|
|||
return LFG_COMPATIBILITY_PENDING;
|
||||
|
||||
// Create a new proposal
|
||||
proposal.cancelTime = time(NULL) + LFG_TIME_PROPOSAL;
|
||||
proposal.cancelTime = time(nullptr) + LFG_TIME_PROPOSAL;
|
||||
proposal.state = LFG_PROPOSAL_INITIATING;
|
||||
proposal.leader = 0;
|
||||
proposal.dungeonId = acore::Containers::SelectRandomContainerElement(proposalDungeons);
|
||||
|
|
@ -445,7 +445,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(Lfg5Guids const& checkWith, const
|
|||
|
||||
void LFGQueue::UpdateQueueTimers(uint32 diff)
|
||||
{
|
||||
time_t currTime = time(NULL);
|
||||
time_t currTime = time(nullptr);
|
||||
bool sendQueueStatus = false;
|
||||
|
||||
if (m_QueueStatusTimer > LFG_QUEUEUPDATE_INTERVAL)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ enum LfgCompatibility
|
|||
/// Stores player or group queue info
|
||||
struct LfgQueueData
|
||||
{
|
||||
LfgQueueData(): joinTime(time_t(time(NULL))), lastRefreshTime(joinTime), tanks(LFG_TANKS_NEEDED),
|
||||
LfgQueueData(): joinTime(time_t(time(nullptr))), lastRefreshTime(joinTime), tanks(LFG_TANKS_NEEDED),
|
||||
healers(LFG_HEALERS_NEEDED), dps(LFG_DPS_NEEDED)
|
||||
{ }
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ void LFGPlayerScript::OnMapChanged(Player* player)
|
|||
return;
|
||||
}
|
||||
|
||||
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())
|
||||
player->GetSession()->SendNameQueryOpcode(member->GetGUID());
|
||||
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES), m_type(type
|
|||
|
||||
m_valuesCount = CORPSE_END;
|
||||
|
||||
m_time = time(NULL);
|
||||
m_time = time(nullptr);
|
||||
|
||||
lootRecipient = NULL;
|
||||
lootRecipient = nullptr;
|
||||
}
|
||||
|
||||
Corpse::~Corpse()
|
||||
|
|
@ -116,7 +116,7 @@ void Corpse::SaveToDB()
|
|||
|
||||
void Corpse::DeleteFromDB(SQLTransaction& trans)
|
||||
{
|
||||
PreparedStatement* stmt = NULL;
|
||||
PreparedStatement* stmt = nullptr;
|
||||
if (GetType() == CORPSE_BONES)
|
||||
{
|
||||
// Only specific bones
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class Corpse : public WorldObject, public GridObject<Corpse>
|
|||
uint64 GetOwnerGUID() const { return GetUInt64Value(CORPSE_FIELD_OWNER); }
|
||||
|
||||
time_t const& GetGhostTime() const { return m_time; }
|
||||
void ResetGhostTime() { m_time = time(NULL); }
|
||||
void ResetGhostTime() { m_time = time(nullptr); }
|
||||
CorpseType GetType() const { return m_type; }
|
||||
|
||||
GridCoord const& GetGridCoord() const { return _gridCoord; }
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ TrainerSpell const* TrainerSpellData::Find(uint32 spell_id) const
|
|||
if (itr != spellList.end())
|
||||
return &itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool VendorItemData::RemoveItem(uint32 item_id)
|
||||
|
|
@ -77,7 +77,7 @@ VendorItem const* VendorItemData::FindItemCostPair(uint32 item_id, uint32 extend
|
|||
for (VendorItemList::const_iterator i = m_items.begin(); i != m_items.end(); ++i)
|
||||
if ((*i)->item == item_id && (*i)->ExtendedCost == extendedCost)
|
||||
return *i;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32 CreatureTemplate::GetRandomValidModelId() const
|
||||
|
|
@ -164,7 +164,7 @@ m_corpseRemoveTime(0), m_respawnTime(0), m_respawnDelay(300), m_corpseDelay(60),
|
|||
m_transportCheckTimer(1000), lootPickPocketRestoreTime(0), m_reactState(REACT_AGGRESSIVE), m_defaultMovementType(IDLE_MOTION_TYPE),
|
||||
m_DBTableGuid(0), m_equipmentId(0), m_originalEquipmentId(0), m_AlreadyCallAssistance(false),
|
||||
m_AlreadySearchedAssistance(false), m_regenHealth(true), m_AI_locked(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL), m_originalEntry(0), m_moveInLineOfSightDisabled(false), m_moveInLineOfSightStrictlyDisabled(false),
|
||||
m_homePosition(), m_transportHomePosition(), m_creatureInfo(NULL), m_creatureData(NULL), m_waypointID(0), m_path_id(0), m_formation(NULL), _lastDamagedTime(0)
|
||||
m_homePosition(), m_transportHomePosition(), m_creatureInfo(nullptr), m_creatureData(nullptr), m_waypointID(0), m_path_id(0), m_formation(nullptr), _lastDamagedTime(0)
|
||||
{
|
||||
m_regenTimer = CREATURE_REGEN_INTERVAL;
|
||||
m_valuesCount = UNIT_END;
|
||||
|
|
@ -184,7 +184,7 @@ m_homePosition(), m_transportHomePosition(), m_creatureInfo(NULL), m_creatureDat
|
|||
ResetLootMode(); // restore default loot mode
|
||||
TriggerJustRespawned = false;
|
||||
m_isTempWorldObject = false;
|
||||
_focusSpell = NULL;
|
||||
_focusSpell = nullptr;
|
||||
}
|
||||
|
||||
Creature::~Creature()
|
||||
|
|
@ -192,7 +192,7 @@ Creature::~Creature()
|
|||
m_vendorItemCounts.clear();
|
||||
|
||||
delete i_AI;
|
||||
i_AI = NULL;
|
||||
i_AI = nullptr;
|
||||
|
||||
//if (m_uint32Values)
|
||||
// sLog->outError("Deconstruct Creature Entry = %u", GetEntry());
|
||||
|
|
@ -269,7 +269,7 @@ void Creature::RemoveCorpse(bool setSpawnTime, bool skipVisibility)
|
|||
if (getDeathState() != CORPSE)
|
||||
return;
|
||||
|
||||
m_corpseRemoveTime = time(NULL);
|
||||
m_corpseRemoveTime = time(nullptr);
|
||||
setDeathState(DEAD);
|
||||
RemoveAllAuras();
|
||||
if (!skipVisibility) // pussywizard
|
||||
|
|
@ -282,7 +282,7 @@ void Creature::RemoveCorpse(bool setSpawnTime, bool skipVisibility)
|
|||
// Should get removed later, just keep "compatibility" with scripts
|
||||
if (setSpawnTime)
|
||||
{
|
||||
m_respawnTime = time(NULL) + respawnDelay;
|
||||
m_respawnTime = time(nullptr) + respawnDelay;
|
||||
//SaveRespawnTime();
|
||||
}
|
||||
|
||||
|
|
@ -507,7 +507,7 @@ void Creature::Update(uint32 diff)
|
|||
break;
|
||||
case DEAD:
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
time_t now = time(nullptr);
|
||||
if (m_respawnTime <= now)
|
||||
{
|
||||
bool allowed = IsAIEnabled ? AI()->CanRespawn() : true; // First check if there are any scripts that object to us respawning
|
||||
|
|
@ -549,7 +549,7 @@ void Creature::Update(uint32 diff)
|
|||
}
|
||||
else m_groupLootTimer -= diff;
|
||||
}
|
||||
else if (m_corpseRemoveTime <= time(NULL))
|
||||
else if (m_corpseRemoveTime <= time(nullptr))
|
||||
{
|
||||
RemoveCorpse(false);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
|
|
@ -757,7 +757,7 @@ void Creature::DoFleeToGetAssistance()
|
|||
float radius = sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS);
|
||||
if (radius >0)
|
||||
{
|
||||
Creature* creature = NULL;
|
||||
Creature* creature = nullptr;
|
||||
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
|
@ -946,14 +946,14 @@ bool Creature::isCanTrainingAndResetTalentsOf(Player* player) const
|
|||
Player* Creature::GetLootRecipient() const
|
||||
{
|
||||
if (!m_lootRecipient)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return ObjectAccessor::FindPlayerInOrOutOfWorld(m_lootRecipient);
|
||||
}
|
||||
|
||||
Group* Creature::GetLootRecipientGroup() const
|
||||
{
|
||||
if (!m_lootRecipientGroup)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return sGroupMgr->GetGroupByGUID(m_lootRecipientGroup);
|
||||
}
|
||||
|
||||
|
|
@ -1478,7 +1478,7 @@ bool Creature::IsInvisibleDueToDespawn() const
|
|||
if (Unit::IsInvisibleDueToDespawn())
|
||||
return true;
|
||||
|
||||
if (IsAlive() || m_corpseRemoveTime > time(NULL))
|
||||
if (IsAlive() || m_corpseRemoveTime > time(nullptr))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|
@ -1543,8 +1543,8 @@ void Creature::setDeathState(DeathState s, bool despawn)
|
|||
|
||||
if (s == JUST_DIED)
|
||||
{
|
||||
m_corpseRemoveTime = time(NULL) + m_corpseDelay;
|
||||
m_respawnTime = time(NULL) + m_respawnDelay + m_corpseDelay;
|
||||
m_corpseRemoveTime = time(nullptr) + m_corpseDelay;
|
||||
m_respawnTime = time(nullptr) + m_respawnDelay + m_corpseDelay;
|
||||
|
||||
// always save boss respawn time at death to prevent crash cheating
|
||||
if (GetMap()->IsDungeon() || isWorldBoss() || GetCreatureTemplate()->rank >= CREATURE_ELITE_ELITE)
|
||||
|
|
@ -1582,7 +1582,7 @@ void Creature::setDeathState(DeathState s, bool despawn)
|
|||
//if (IsPet())
|
||||
// setActive(true);
|
||||
SetFullHealth();
|
||||
SetLootRecipient(NULL);
|
||||
SetLootRecipient(nullptr);
|
||||
ResetPlayerDamageReq();
|
||||
CreatureTemplate const* cinfo = GetCreatureTemplate();
|
||||
// Xinef: npc run by default
|
||||
|
|
@ -1751,7 +1751,7 @@ bool Creature::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index)
|
|||
SpellInfo const* Creature::reachWithSpellAttack(Unit* victim)
|
||||
{
|
||||
if (!victim)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
for (uint32 i=0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
{
|
||||
|
|
@ -1793,13 +1793,13 @@ SpellInfo const* Creature::reachWithSpellAttack(Unit* victim)
|
|||
continue;
|
||||
return spellInfo;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SpellInfo const* Creature::reachWithSpellCure(Unit* victim)
|
||||
{
|
||||
if (!victim)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
for (uint32 i=0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
{
|
||||
|
|
@ -1840,7 +1840,7 @@ SpellInfo const* Creature::reachWithSpellCure(Unit* victim)
|
|||
continue;
|
||||
return spellInfo;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// select nearest hostile unit within the given distance (regardless of threat list).
|
||||
|
|
@ -1850,7 +1850,7 @@ Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) c
|
|||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Unit* target = NULL;
|
||||
Unit* target = nullptr;
|
||||
|
||||
{
|
||||
if (dist == 0.0f)
|
||||
|
|
@ -1876,7 +1876,7 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
|
|||
Cell cell(p);
|
||||
cell.SetNoCreate();
|
||||
|
||||
Unit* target = NULL;
|
||||
Unit* target = nullptr;
|
||||
|
||||
if (dist < ATTACK_DISTANCE)
|
||||
dist = ATTACK_DISTANCE;
|
||||
|
|
@ -2389,7 +2389,7 @@ bool Creature::HasSpell(uint32 spellID) const
|
|||
|
||||
time_t Creature::GetRespawnTimeEx() const
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
time_t now = time(nullptr);
|
||||
if (m_respawnTime > now)
|
||||
return m_respawnTime;
|
||||
else
|
||||
|
|
@ -2440,7 +2440,7 @@ void Creature::AllLootRemovedFromCorpse()
|
|||
{
|
||||
if (!HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE))
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
time_t now = time(nullptr);
|
||||
if (m_corpseRemoveTime <= now)
|
||||
return;
|
||||
|
||||
|
|
@ -2454,7 +2454,7 @@ void Creature::AllLootRemovedFromCorpse()
|
|||
|
||||
// corpse skinnable, but without skinning flag, and then skinned, corpse will despawn next update
|
||||
if (cinfo && cinfo->SkinLootId)
|
||||
m_corpseRemoveTime = time(NULL);
|
||||
m_corpseRemoveTime = time(nullptr);
|
||||
else
|
||||
m_corpseRemoveTime -= diff;
|
||||
}
|
||||
|
|
@ -2508,7 +2508,7 @@ uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem)
|
|||
|
||||
VendorItemCount* vCount = &*itr;
|
||||
|
||||
time_t ptime = time(NULL);
|
||||
time_t ptime = time(nullptr);
|
||||
|
||||
if (time_t(vCount->lastIncrementTime + vItem->incrtime) <= ptime)
|
||||
{
|
||||
|
|
@ -2547,7 +2547,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us
|
|||
|
||||
VendorItemCount* vCount = &*itr;
|
||||
|
||||
time_t ptime = time(NULL);
|
||||
time_t ptime = time(nullptr);
|
||||
|
||||
if (time_t(vCount->lastIncrementTime + vItem->incrtime) <= ptime)
|
||||
{
|
||||
|
|
@ -2815,7 +2815,7 @@ void Creature::ReleaseFocus(Spell const* focusSpell)
|
|||
if (focusSpell != _focusSpell)
|
||||
return;
|
||||
|
||||
_focusSpell = NULL;
|
||||
_focusSpell = nullptr;
|
||||
if (Unit* victim = GetVictim())
|
||||
SetUInt64Value(UNIT_FIELD_TARGET, victim->GetGUID());
|
||||
else
|
||||
|
|
|
|||
|
|
@ -354,7 +354,7 @@ struct VendorItemData
|
|||
VendorItem* GetItem(uint32 slot) const
|
||||
{
|
||||
if (slot >= m_items.size())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return m_items[slot];
|
||||
}
|
||||
|
|
@ -377,7 +377,7 @@ struct VendorItemData
|
|||
struct VendorItemCount
|
||||
{
|
||||
explicit VendorItemCount(uint32 _item, uint32 _count)
|
||||
: itemId(_item), count(_count), lastIncrementTime(time(NULL)) {}
|
||||
: itemId(_item), count(_count), lastIncrementTime(time(nullptr)) {}
|
||||
|
||||
uint32 itemId;
|
||||
uint32 count;
|
||||
|
|
@ -440,7 +440,7 @@ class Creature : public Unit, public GridObject<Creature>, public MovableMapObje
|
|||
|
||||
void DisappearAndDie();
|
||||
|
||||
bool Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 vehId, float x, float y, float z, float ang, const CreatureData* data = NULL);
|
||||
bool Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 vehId, float x, float y, float z, float ang, const CreatureData* data = nullptr);
|
||||
bool LoadCreaturesAddon(bool reload = false);
|
||||
void SelectLevel(bool changelevel = true);
|
||||
void LoadEquipment(int8 id = 1, bool force = false);
|
||||
|
|
@ -500,7 +500,7 @@ class Creature : public Unit, public GridObject<Creature>, public MovableMapObje
|
|||
|
||||
bool IsInEvadeMode() const { return HasUnitState(UNIT_STATE_EVADE); }
|
||||
|
||||
bool AIM_Initialize(CreatureAI* ai = NULL);
|
||||
bool AIM_Initialize(CreatureAI* ai = nullptr);
|
||||
void Motion_Initialize();
|
||||
|
||||
CreatureAI* AI() const { return (CreatureAI*)i_AI; }
|
||||
|
|
@ -579,8 +579,8 @@ class Creature : public Unit, public GridObject<Creature>, public MovableMapObje
|
|||
Group* GetLootRecipientGroup() const;
|
||||
bool hasLootRecipient() const { return m_lootRecipient || m_lootRecipientGroup; }
|
||||
bool isTappedBy(Player const* player) const; // return true if the creature is tapped by the player or a member of his party.
|
||||
bool CanGeneratePickPocketLoot() const { return lootPickPocketRestoreTime == 0 || lootPickPocketRestoreTime < time(NULL); }
|
||||
void SetPickPocketLootTime() { lootPickPocketRestoreTime = time(NULL) + MINUTE + GetCorpseDelay() + GetRespawnTime(); }
|
||||
bool CanGeneratePickPocketLoot() const { return lootPickPocketRestoreTime == 0 || lootPickPocketRestoreTime < time(nullptr); }
|
||||
void SetPickPocketLootTime() { lootPickPocketRestoreTime = time(nullptr) + MINUTE + GetCorpseDelay() + GetRespawnTime(); }
|
||||
void ResetPickPocketLootTime() { lootPickPocketRestoreTime = 0; }
|
||||
|
||||
void SetLootRecipient (Unit* unit, bool withGroup = true);
|
||||
|
|
@ -633,7 +633,7 @@ class Creature : public Unit, public GridObject<Creature>, public MovableMapObje
|
|||
|
||||
time_t const& GetRespawnTime() const { return m_respawnTime; }
|
||||
time_t GetRespawnTimeEx() const;
|
||||
void SetRespawnTime(uint32 respawn) { m_respawnTime = respawn ? time(NULL) + respawn : 0; }
|
||||
void SetRespawnTime(uint32 respawn) { m_respawnTime = respawn ? time(nullptr) + respawn : 0; }
|
||||
void Respawn(bool force = false);
|
||||
void SaveRespawnTime() override;
|
||||
|
||||
|
|
@ -719,7 +719,7 @@ class Creature : public Unit, public GridObject<Creature>, public MovableMapObje
|
|||
void SetLastDamagedTime(time_t val) { _lastDamagedTime = val; }
|
||||
|
||||
protected:
|
||||
bool CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, const CreatureData* data = NULL);
|
||||
bool CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, const CreatureData* data = nullptr);
|
||||
bool InitEntry(uint32 entry, const CreatureData* data=NULL);
|
||||
|
||||
// vendor items
|
||||
|
|
|
|||
|
|
@ -165,10 +165,10 @@ void CreatureGroup::AddMember(Creature* member)
|
|||
void CreatureGroup::RemoveMember(Creature* member)
|
||||
{
|
||||
if (m_leader == member)
|
||||
m_leader = NULL;
|
||||
m_leader = nullptr;
|
||||
|
||||
m_members.erase(member);
|
||||
member->SetFormation(NULL);
|
||||
member->SetFormation(nullptr);
|
||||
}
|
||||
|
||||
void CreatureGroup::MemberAttackStart(Creature* member, Unit* target)
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class CreatureGroup
|
|||
typedef std::map<Creature*, FormationInfo*> CreatureGroupMemberType;
|
||||
|
||||
//Group cannot be created empty
|
||||
explicit CreatureGroup(uint32 id) : m_leader(NULL), m_groupID(id), m_Formed(false) {}
|
||||
explicit CreatureGroup(uint32 id) : m_leader(nullptr), m_groupID(id), m_Formed(false) {}
|
||||
~CreatureGroup() {}
|
||||
|
||||
Creature* getLeader() const { return m_leader; }
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ class GossipMenu
|
|||
if (itr != _menuItems.end())
|
||||
return &itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GossipMenuItemData const* GetItemData(uint32 indexId) const
|
||||
|
|
@ -186,7 +186,7 @@ class GossipMenu
|
|||
if (itr != _menuItemData.end())
|
||||
return &itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32 GetMenuItemSender(uint32 menuItemId) const;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ m_timer(0), m_lifetime(0)
|
|||
|
||||
Unit* TempSummon::GetSummoner() const
|
||||
{
|
||||
return m_summonerGUID ? ObjectAccessor::GetUnit(*this, m_summonerGUID) : NULL;
|
||||
return m_summonerGUID ? ObjectAccessor::GetUnit(*this, m_summonerGUID) : nullptr;
|
||||
}
|
||||
|
||||
void TempSummon::Update(uint32 diff)
|
||||
|
|
@ -406,7 +406,7 @@ void Puppet::RemoveFromWorld()
|
|||
if (!IsInWorld())
|
||||
return;
|
||||
|
||||
RemoveCharmedBy(NULL);
|
||||
RemoveCharmedBy(nullptr);
|
||||
Minion::RemoveFromWorld();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#include "Transport.h"
|
||||
|
||||
DynamicObject::DynamicObject(bool isWorldObject) : WorldObject(isWorldObject), MovableMapObject(),
|
||||
_aura(NULL), _removedAura(NULL), _caster(NULL), _duration(0), _isViewpoint(false)
|
||||
_aura(nullptr), _removedAura(nullptr), _caster(nullptr), _duration(0), _isViewpoint(false)
|
||||
{
|
||||
m_objectType |= TYPEMASK_DYNAMICOBJECT;
|
||||
m_objectTypeId = TYPEID_DYNAMICOBJECT;
|
||||
|
|
@ -41,7 +41,7 @@ void DynamicObject::CleanupsBeforeDelete(bool finalCleanup /* = true */)
|
|||
if (Transport* transport = GetTransport())
|
||||
{
|
||||
transport->RemovePassenger(this);
|
||||
SetTransport(NULL);
|
||||
SetTransport(nullptr);
|
||||
m_movementInfo.transport.Reset();
|
||||
m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
|
||||
}
|
||||
|
|
@ -193,7 +193,7 @@ void DynamicObject::RemoveAura()
|
|||
{
|
||||
ASSERT(_aura && !_removedAura);
|
||||
_removedAura = _aura;
|
||||
_aura = NULL;
|
||||
_aura = nullptr;
|
||||
if (!_removedAura->IsRemoved())
|
||||
_removedAura->_Remove(AURA_REMOVE_BY_DEFAULT);
|
||||
}
|
||||
|
|
@ -229,5 +229,5 @@ void DynamicObject::UnbindFromCaster()
|
|||
{
|
||||
ASSERT(_caster);
|
||||
_caster->_UnregisterDynObject(this);
|
||||
_caster = NULL;
|
||||
_caster = nullptr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
#endif
|
||||
|
||||
GameObject::GameObject() : WorldObject(false), MovableMapObject(),
|
||||
m_model(NULL), m_goValue(), m_AI(NULL)
|
||||
m_model(nullptr), m_goValue(), m_AI(nullptr)
|
||||
{
|
||||
m_objectType |= TYPEMASK_GAMEOBJECT;
|
||||
m_objectTypeId = TYPEID_GAMEOBJECT;
|
||||
|
|
@ -46,9 +46,9 @@ GameObject::GameObject() : WorldObject(false), MovableMapObject(),
|
|||
m_usetimes = 0;
|
||||
m_spellId = 0;
|
||||
m_cooldownTime = 0;
|
||||
m_goInfo = NULL;
|
||||
m_goInfo = nullptr;
|
||||
m_ritualOwnerGUIDLow = 0;
|
||||
m_goData = NULL;
|
||||
m_goData = nullptr;
|
||||
m_packedRotation = 0;
|
||||
|
||||
m_DBTableGuid = 0;
|
||||
|
|
@ -95,7 +95,7 @@ void GameObject::CleanupsBeforeDelete(bool /*finalCleanup*/)
|
|||
if (GetTransport() && !ToTransport())
|
||||
{
|
||||
GetTransport()->RemovePassenger(this);
|
||||
SetTransport(NULL);
|
||||
SetTransport(nullptr);
|
||||
m_movementInfo.transport.Reset();
|
||||
m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
|
||||
}
|
||||
|
|
@ -390,7 +390,7 @@ void GameObject::Update(uint32 diff)
|
|||
case GAMEOBJECT_TYPE_FISHINGNODE:
|
||||
{
|
||||
// fishing code (bobber ready)
|
||||
if (time(NULL) > m_respawnTime - FISHING_BOBBER_READY_TIME)
|
||||
if (time(nullptr) > m_respawnTime - FISHING_BOBBER_READY_TIME)
|
||||
{
|
||||
// splash bobber (bobber ready now)
|
||||
Unit* caster = GetOwner();
|
||||
|
|
@ -488,7 +488,7 @@ void GameObject::Update(uint32 diff)
|
|||
{
|
||||
if (m_respawnTime > 0) // timer on
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
time_t now = time(nullptr);
|
||||
if (m_respawnTime <= now) // timer expired
|
||||
{
|
||||
uint64 dbtableHighGuid = MAKE_NEW_GUID(m_DBTableGuid, GetEntry(), HIGHGUID_GAMEOBJECT);
|
||||
|
|
@ -571,7 +571,7 @@ void GameObject::Update(uint32 diff)
|
|||
if (goInfo->trap.type == 2)
|
||||
{
|
||||
if (goInfo->trap.spellId)
|
||||
CastSpell(NULL, goInfo->trap.spellId); // FIXME: null target won't work for target type 1
|
||||
CastSpell(nullptr, goInfo->trap.spellId); // FIXME: null target won't work for target type 1
|
||||
SetLootState(GO_JUST_DEACTIVATED);
|
||||
break;
|
||||
}
|
||||
|
|
@ -595,7 +595,7 @@ void GameObject::Update(uint32 diff)
|
|||
|
||||
// Type 0 and 1 - trap (type 0 will not get removed after casting a spell)
|
||||
Unit* owner = GetOwner();
|
||||
Unit* target = NULL; // pointer to appropriate target if found any
|
||||
Unit* target = nullptr; // pointer to appropriate target if found any
|
||||
|
||||
// Note: this hack with search required until GO casting not implemented
|
||||
// search unfriendly creature
|
||||
|
|
@ -611,7 +611,7 @@ void GameObject::Update(uint32 diff)
|
|||
{
|
||||
// environmental damage spells already have around enemies targeting but this not help in case not existed GO casting support
|
||||
// affect only players
|
||||
Player* player = NULL;
|
||||
Player* player = nullptr;
|
||||
acore::AnyPlayerInObjectRangeCheck checker(this, radius, true, true);
|
||||
acore::PlayerSearcher<acore::AnyPlayerInObjectRangeCheck> searcher(this, player, checker);
|
||||
VisitNearbyWorldObject(radius, searcher);
|
||||
|
|
@ -732,7 +732,7 @@ void GameObject::Update(uint32 diff)
|
|||
return;
|
||||
}
|
||||
|
||||
m_respawnTime = time(NULL) + m_respawnDelayTime;
|
||||
m_respawnTime = time(nullptr) + m_respawnDelayTime;
|
||||
|
||||
// if option not set then object will be saved at grid unload
|
||||
if (GetMap()->IsDungeon())
|
||||
|
|
@ -945,7 +945,7 @@ bool GameObject::LoadGameObjectFromDB(uint32 guid, Map* map, bool addToMap)
|
|||
m_respawnTime = GetMap()->GetGORespawnTime(m_DBTableGuid);
|
||||
|
||||
// ready to respawn
|
||||
if (m_respawnTime && m_respawnTime <= time(NULL))
|
||||
if (m_respawnTime && m_respawnTime <= time(nullptr))
|
||||
{
|
||||
m_respawnTime = 0;
|
||||
GetMap()->RemoveGORespawnTime(m_DBTableGuid);
|
||||
|
|
@ -1029,7 +1029,7 @@ Unit* GameObject::GetOwner() const
|
|||
|
||||
void GameObject::SaveRespawnTime()
|
||||
{
|
||||
if (m_goData && m_goData->dbData && m_respawnTime > time(NULL) && m_spawnedByDefault)
|
||||
if (m_goData && m_goData->dbData && m_respawnTime > time(nullptr) && m_spawnedByDefault)
|
||||
GetMap()->SaveGORespawnTime(m_DBTableGuid, m_respawnTime);
|
||||
}
|
||||
|
||||
|
|
@ -1088,7 +1088,7 @@ void GameObject::Respawn()
|
|||
{
|
||||
if (m_spawnedByDefault && m_respawnTime > 0)
|
||||
{
|
||||
m_respawnTime = time(NULL);
|
||||
m_respawnTime = time(nullptr);
|
||||
GetMap()->RemoveGORespawnTime(m_DBTableGuid);
|
||||
}
|
||||
}
|
||||
|
|
@ -1167,7 +1167,7 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target)
|
|||
range = 5.0f;
|
||||
|
||||
// search nearest linked GO
|
||||
GameObject* trapGO = NULL;
|
||||
GameObject* trapGO = nullptr;
|
||||
{
|
||||
// using original GO distance
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
|
|
@ -1188,7 +1188,7 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target)
|
|||
|
||||
GameObject* GameObject::LookupFishingHoleAround(float range)
|
||||
{
|
||||
GameObject* ok = NULL;
|
||||
GameObject* ok = nullptr;
|
||||
|
||||
CellCoord p(acore::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
|
@ -1235,7 +1235,7 @@ void GameObject::SetGoArtKit(uint8 kit)
|
|||
|
||||
void GameObject::SetGoArtKit(uint8 artkit, GameObject* go, uint32 lowguid)
|
||||
{
|
||||
const GameObjectData* data = NULL;
|
||||
const GameObjectData* data = nullptr;
|
||||
if (go)
|
||||
{
|
||||
go->SetGoArtKit(artkit);
|
||||
|
|
@ -2265,7 +2265,7 @@ void GameObject::EnableCollision(bool enable)
|
|||
GetMap()->InsertGameObjectModel(*m_model);*/
|
||||
|
||||
uint32 phaseMask = 0;
|
||||
if (enable && !DisableMgr::IsDisabledFor(DISABLE_TYPE_GO_LOS, GetEntry(), NULL))
|
||||
if (enable && !DisableMgr::IsDisabledFor(DISABLE_TYPE_GO_LOS, GetEntry(), nullptr))
|
||||
phaseMask = GetPhaseMask();
|
||||
|
||||
m_model->enable(phaseMask);
|
||||
|
|
@ -2287,14 +2287,14 @@ void GameObject::UpdateModel()
|
|||
Player* GameObject::GetLootRecipient() const
|
||||
{
|
||||
if (!m_lootRecipient)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return ObjectAccessor::FindPlayerInOrOutOfWorld(m_lootRecipient);
|
||||
}
|
||||
|
||||
Group* GameObject::GetLootRecipientGroup() const
|
||||
{
|
||||
if (!m_lootRecipientGroup)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return sGroupMgr->GetGroupByGUID(m_lootRecipientGroup);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -720,7 +720,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Mov
|
|||
time_t GetRespawnTime() const { return m_respawnTime; }
|
||||
time_t GetRespawnTimeEx() const
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
time_t now = time(nullptr);
|
||||
if (m_respawnTime > now)
|
||||
return m_respawnTime;
|
||||
else
|
||||
|
|
@ -729,7 +729,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Mov
|
|||
|
||||
void SetRespawnTime(int32 respawn)
|
||||
{
|
||||
m_respawnTime = respawn > 0 ? time(NULL) + respawn : 0;
|
||||
m_respawnTime = respawn > 0 ? time(nullptr) + respawn : 0;
|
||||
m_respawnDelayTime = respawn > 0 ? respawn : 0;
|
||||
}
|
||||
void Respawn();
|
||||
|
|
@ -763,7 +763,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Mov
|
|||
|
||||
LootState getLootState() const { return m_lootState; }
|
||||
// Note: unit is only used when s = GO_ACTIVATED
|
||||
void SetLootState(LootState s, Unit* unit = NULL);
|
||||
void SetLootState(LootState s, Unit* unit = nullptr);
|
||||
|
||||
uint16 GetLootMode() const { return m_LootMode; }
|
||||
bool HasLootMode(uint16 lootMode) const { return m_LootMode & lootMode; }
|
||||
|
|
@ -800,13 +800,13 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Mov
|
|||
bool HasLootRecipient() const { return m_lootRecipient || m_lootRecipientGroup; }
|
||||
uint32 m_groupLootTimer; // (msecs)timer used for group loot
|
||||
uint32 lootingGroupLowGUID; // used to find group which is looting
|
||||
void SetLootGenerationTime() { m_lootGenerationTime = time(NULL); }
|
||||
void SetLootGenerationTime() { m_lootGenerationTime = time(nullptr); }
|
||||
uint32 GetLootGenerationTime() const { return m_lootGenerationTime; }
|
||||
|
||||
bool hasQuest(uint32 quest_id) const override;
|
||||
bool hasInvolvedQuest(uint32 quest_id) const override;
|
||||
bool ActivateToQuest(Player* target) const;
|
||||
void UseDoorOrButton(uint32 time_to_restore = 0, bool alternative = false, Unit* user = NULL);
|
||||
void UseDoorOrButton(uint32 time_to_restore = 0, bool alternative = false, Unit* user = nullptr);
|
||||
// 0 = use `gameobject`.`spawntimesecs`
|
||||
void ResetDoorOrButton();
|
||||
|
||||
|
|
@ -830,7 +830,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Mov
|
|||
void SendCustomAnim(uint32 anim);
|
||||
bool IsInRange(float x, float y, float z, float radius) const;
|
||||
|
||||
void SendMessageToSetInRange(WorldPacket* data, float dist, bool /*self*/, bool includeMargin = false, Player const* skipped_rcvr = NULL) override; // pussywizard!
|
||||
void SendMessageToSetInRange(WorldPacket* data, float dist, bool /*self*/, bool includeMargin = false, Player const* skipped_rcvr = nullptr) override; // pussywizard!
|
||||
|
||||
void ModifyHealth(int32 change, Unit* attackerOrHealer = NULL, uint32 spellId = 0);
|
||||
void SetDestructibleBuildingModifyState(bool allow) { m_allowModifyDestructibleBuilding = allow; }
|
||||
|
|
@ -855,7 +855,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Mov
|
|||
uint32 GetDisplayId() const { return GetUInt32Value(GAMEOBJECT_DISPLAYID); }
|
||||
|
||||
GameObjectModel* m_model;
|
||||
void GetRespawnPosition(float &x, float &y, float &z, float* ori = NULL) const;
|
||||
void GetRespawnPosition(float &x, float &y, float &z, float* ori = nullptr) const;
|
||||
|
||||
void SetPosition(float x, float y, float z, float o);
|
||||
void SetPosition(const Position &pos) { SetPosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()); }
|
||||
|
|
@ -863,14 +863,14 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Mov
|
|||
bool IsStaticTransport() const { return GetGOInfo()->type == GAMEOBJECT_TYPE_TRANSPORT; }
|
||||
bool IsMotionTransport() const { return GetGOInfo()->type == GAMEOBJECT_TYPE_MO_TRANSPORT; }
|
||||
|
||||
Transport* ToTransport() { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MO_TRANSPORT || GetGOInfo()->type == GAMEOBJECT_TYPE_TRANSPORT) return reinterpret_cast<Transport*>(this); else return NULL; }
|
||||
Transport const* ToTransport() const { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MO_TRANSPORT || GetGOInfo()->type == GAMEOBJECT_TYPE_TRANSPORT) return reinterpret_cast<Transport const*>(this); else return NULL; }
|
||||
Transport* ToTransport() { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MO_TRANSPORT || GetGOInfo()->type == GAMEOBJECT_TYPE_TRANSPORT) return reinterpret_cast<Transport*>(this); else return nullptr; }
|
||||
Transport const* ToTransport() const { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MO_TRANSPORT || GetGOInfo()->type == GAMEOBJECT_TYPE_TRANSPORT) return reinterpret_cast<Transport const*>(this); else return nullptr; }
|
||||
|
||||
StaticTransport* ToStaticTransport() { if (GetGOInfo()->type == GAMEOBJECT_TYPE_TRANSPORT) return reinterpret_cast<StaticTransport*>(this); else return NULL; }
|
||||
StaticTransport const* ToStaticTransport() const { if (GetGOInfo()->type == GAMEOBJECT_TYPE_TRANSPORT) return reinterpret_cast<StaticTransport const*>(this); else return NULL; }
|
||||
StaticTransport* ToStaticTransport() { if (GetGOInfo()->type == GAMEOBJECT_TYPE_TRANSPORT) return reinterpret_cast<StaticTransport*>(this); else return nullptr; }
|
||||
StaticTransport const* ToStaticTransport() const { if (GetGOInfo()->type == GAMEOBJECT_TYPE_TRANSPORT) return reinterpret_cast<StaticTransport const*>(this); else return nullptr; }
|
||||
|
||||
MotionTransport* ToMotionTransport() { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MO_TRANSPORT) return reinterpret_cast<MotionTransport*>(this); else return NULL; }
|
||||
MotionTransport const* ToMotionTransport() const { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MO_TRANSPORT) return reinterpret_cast<MotionTransport const*>(this); else return NULL; }
|
||||
MotionTransport* ToMotionTransport() { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MO_TRANSPORT) return reinterpret_cast<MotionTransport*>(this); else return nullptr; }
|
||||
MotionTransport const* ToMotionTransport() const { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MO_TRANSPORT) return reinterpret_cast<MotionTransport const*>(this); else return nullptr; }
|
||||
|
||||
float GetStationaryX() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetPositionX(); return GetPositionX(); }
|
||||
float GetStationaryY() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetPositionY(); return GetPositionY(); }
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ bool Bag::Create(uint32 guidlow, uint32 itemid, Player const* owner)
|
|||
for (uint8 i = 0; i < MAX_BAG_SIZE; ++i)
|
||||
{
|
||||
SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (i*2), 0);
|
||||
m_bagslot[i] = NULL;
|
||||
m_bagslot[i] = nullptr;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -106,7 +106,7 @@ bool Bag::LoadFromDB(uint32 guid, uint64 owner_guid, Field* fields, uint32 entry
|
|||
{
|
||||
SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (i*2), 0);
|
||||
delete m_bagslot[i];
|
||||
m_bagslot[i] = NULL;
|
||||
m_bagslot[i] = nullptr;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -136,9 +136,9 @@ void Bag::RemoveItem(uint8 slot, bool /*update*/)
|
|||
ASSERT(slot < MAX_BAG_SIZE);
|
||||
|
||||
if (m_bagslot[slot])
|
||||
m_bagslot[slot]->SetContainer(NULL);
|
||||
m_bagslot[slot]->SetContainer(nullptr);
|
||||
|
||||
m_bagslot[slot] = NULL;
|
||||
m_bagslot[slot] = nullptr;
|
||||
SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), 0);
|
||||
}
|
||||
|
||||
|
|
@ -228,6 +228,6 @@ Item* Bag::GetItemByPos(uint8 slot) const
|
|||
if (slot < GetBagSize())
|
||||
return m_bagslot[slot];
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ class Bag : public Item
|
|||
void RemoveItem(uint8 slot, bool update);
|
||||
|
||||
Item* GetItemByPos(uint8 slot) const;
|
||||
uint32 GetItemCount(uint32 item, Item* eItem = NULL) const;
|
||||
uint32 GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem = NULL) const;
|
||||
uint32 GetItemCount(uint32 item, Item* eItem = nullptr) const;
|
||||
uint32 GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem = nullptr) const;
|
||||
|
||||
uint8 GetSlotByItemGUID(uint64 guid) const;
|
||||
bool IsEmpty() const;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ void AddItemsSetItem(Player* player, Item* item)
|
|||
if (set->required_skill_id && player->GetSkillValue(set->required_skill_id) < set->required_skill_value)
|
||||
return;
|
||||
|
||||
ItemSetEffect* eff = NULL;
|
||||
ItemSetEffect* eff = nullptr;
|
||||
|
||||
for (size_t x = 0; x < player->ItemSetEff.size(); ++x)
|
||||
{
|
||||
|
|
@ -111,7 +111,7 @@ void RemoveItemsSetItem(Player*player, ItemTemplate const* proto)
|
|||
return;
|
||||
}
|
||||
|
||||
ItemSetEffect* eff = NULL;
|
||||
ItemSetEffect* eff = nullptr;
|
||||
size_t setindex = 0;
|
||||
for (; setindex < player->ItemSetEff.size(); setindex++)
|
||||
{
|
||||
|
|
@ -153,7 +153,7 @@ void RemoveItemsSetItem(Player*player, ItemTemplate const* proto)
|
|||
{
|
||||
ASSERT(eff == player->ItemSetEff[setindex]);
|
||||
delete eff;
|
||||
player->ItemSetEff[setindex] = NULL;
|
||||
player->ItemSetEff[setindex] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -233,10 +233,10 @@ Item::Item()
|
|||
m_slot = 0;
|
||||
uState = ITEM_NEW;
|
||||
uQueuePos = -1;
|
||||
m_container = NULL;
|
||||
m_container = nullptr;
|
||||
m_lootGenerated = false;
|
||||
mb_in_trade = false;
|
||||
m_lastPlayedTimeUpdate = time(NULL);
|
||||
m_lastPlayedTimeUpdate = time(nullptr);
|
||||
|
||||
m_refundRecipient = 0;
|
||||
m_paidMoney = 0;
|
||||
|
|
@ -674,7 +674,7 @@ void Item::AddToUpdateQueueOf(Player* player)
|
|||
if (IsInUpdateQueue())
|
||||
return;
|
||||
|
||||
ASSERT(player != NULL);
|
||||
ASSERT(player != nullptr);
|
||||
|
||||
if (player->GetGUID() != GetOwnerGUID())
|
||||
{
|
||||
|
|
@ -696,7 +696,7 @@ void Item::RemoveFromUpdateQueueOf(Player* player)
|
|||
if (!IsInUpdateQueue())
|
||||
return;
|
||||
|
||||
ASSERT(player != NULL);
|
||||
ASSERT(player != nullptr);
|
||||
|
||||
if (player->GetGUID() != GetOwnerGUID())
|
||||
{
|
||||
|
|
@ -709,7 +709,7 @@ void Item::RemoveFromUpdateQueueOf(Player* player)
|
|||
if (player->m_itemUpdateQueueBlocked)
|
||||
return;
|
||||
|
||||
player->m_itemUpdateQueue[uQueuePos] = NULL;
|
||||
player->m_itemUpdateQueue[uQueuePos] = nullptr;
|
||||
uQueuePos = -1;
|
||||
}
|
||||
|
||||
|
|
@ -1016,7 +1016,7 @@ void Item::SendTimeUpdate(Player* owner)
|
|||
Item* Item::CreateItem(uint32 item, uint32 count, Player const* player, bool clone, uint32 randomPropertyId)
|
||||
{
|
||||
if (count < 1)
|
||||
return NULL; //don't create item at zero count
|
||||
return nullptr; //don't create item at zero count
|
||||
|
||||
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item);
|
||||
if (pProto)
|
||||
|
|
@ -1042,7 +1042,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player, bool clo
|
|||
}
|
||||
else
|
||||
ABORT();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Item* Item::CloneItem(uint32 count, Player const* player) const
|
||||
|
|
@ -1050,7 +1050,7 @@ Item* Item::CloneItem(uint32 count, Player const* player) const
|
|||
// player CAN be NULL in which case we must not update random properties because that accesses player's item update queue
|
||||
Item * newItem = CreateItem(GetEntry(), count, player, true, player ? GetItemRandomPropertyId() : 0);
|
||||
if (!newItem)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
newItem->SetUInt32Value(ITEM_FIELD_CREATOR, GetUInt32Value(ITEM_FIELD_CREATOR));
|
||||
newItem->SetUInt32Value(ITEM_FIELD_GIFTCREATOR, GetUInt32Value(ITEM_FIELD_GIFTCREATOR));
|
||||
|
|
@ -1143,7 +1143,7 @@ void Item::UpdatePlayedTime(Player* owner)
|
|||
// Get current played time
|
||||
uint32 current_playtime = GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME);
|
||||
// Calculate time elapsed since last played time update
|
||||
time_t curtime = time(NULL);
|
||||
time_t curtime = time(nullptr);
|
||||
uint32 elapsed = uint32(curtime - m_lastPlayedTimeUpdate);
|
||||
uint32 new_playtime = current_playtime + elapsed;
|
||||
// Check if the refund timer has expired yet
|
||||
|
|
@ -1164,7 +1164,7 @@ void Item::UpdatePlayedTime(Player* owner)
|
|||
|
||||
uint32 Item::GetPlayedTime()
|
||||
{
|
||||
time_t curtime = time(NULL);
|
||||
time_t curtime = time(nullptr);
|
||||
uint32 elapsed = uint32(curtime - m_lastPlayedTimeUpdate);
|
||||
return GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME) + elapsed;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ class Item : public Object
|
|||
{
|
||||
public:
|
||||
static Item* CreateItem(uint32 item, uint32 count, Player const* player = NULL, bool clone = false, uint32 randomPropertyId = 0);
|
||||
Item* CloneItem(uint32 count, Player const* player = NULL) const;
|
||||
Item* CloneItem(uint32 count, Player const* player = nullptr) const;
|
||||
|
||||
Item();
|
||||
|
||||
|
|
@ -224,8 +224,8 @@ class Item : public Object
|
|||
void SaveRefundDataToDB();
|
||||
void DeleteRefundDataFromDB(SQLTransaction* trans);
|
||||
|
||||
Bag* ToBag() { if (IsBag()) return reinterpret_cast<Bag*>(this); else return NULL; }
|
||||
const Bag* ToBag() const { if (IsBag()) return reinterpret_cast<const Bag*>(this); else return NULL; }
|
||||
Bag* ToBag() { if (IsBag()) return reinterpret_cast<Bag*>(this); else return nullptr; }
|
||||
const Bag* ToBag() const { if (IsBag()) return reinterpret_cast<const Bag*>(this); else return nullptr; }
|
||||
|
||||
bool IsLocked() const { return !HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_UNLOCKED); }
|
||||
bool IsBag() const { return GetTemplate()->InventoryType == INVTYPE_BAG; }
|
||||
|
|
@ -257,7 +257,7 @@ class Item : public Object
|
|||
uint16 GetPos() const { return uint16(GetBagSlot()) << 8 | GetSlot(); }
|
||||
void SetContainer(Bag* container) { m_container = container; }
|
||||
|
||||
bool IsInBag() const { return m_container != NULL; }
|
||||
bool IsInBag() const { return m_container != nullptr; }
|
||||
bool IsEquipped() const;
|
||||
|
||||
uint32 GetSkill();
|
||||
|
|
@ -294,7 +294,7 @@ class Item : public Object
|
|||
|
||||
// Update States
|
||||
ItemUpdateState GetState() const { return uState; }
|
||||
void SetState(ItemUpdateState state, Player* forplayer = NULL);
|
||||
void SetState(ItemUpdateState state, Player* forplayer = nullptr);
|
||||
void AddToUpdateQueueOf(Player* player);
|
||||
void RemoveFromUpdateQueueOf(Player* player);
|
||||
bool IsInUpdateQueue() const { return uQueuePos != -1; }
|
||||
|
|
@ -312,7 +312,7 @@ class Item : public Object
|
|||
bool IsConjuredConsumable() const { return GetTemplate()->IsConjuredConsumable(); }
|
||||
|
||||
// Item Refund system
|
||||
void SetNotRefundable(Player* owner, bool changestate = true, SQLTransaction* trans = NULL);
|
||||
void SetNotRefundable(Player* owner, bool changestate = true, SQLTransaction* trans = nullptr);
|
||||
void SetRefundRecipient(uint32 pGuidLow) { m_refundRecipient = pGuidLow; }
|
||||
void SetPaidMoney(uint32 money) { m_paidMoney = money; }
|
||||
void SetPaidExtendedCost(uint32 iece) { m_paidExtendedCost = iece; }
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ Object::Object() : m_PackGUID(sizeof(uint64)+1)
|
|||
m_objectTypeId = TYPEID_OBJECT;
|
||||
m_objectType = TYPEMASK_OBJECT;
|
||||
|
||||
m_uint32Values = NULL;
|
||||
m_uint32Values = nullptr;
|
||||
m_valuesCount = 0;
|
||||
_fieldNotifyFlags = UF_FLAG_DYNAMIC;
|
||||
|
||||
|
|
@ -84,7 +84,7 @@ WorldObject::~WorldObject()
|
|||
{
|
||||
#ifdef ELUNA
|
||||
delete elunaEvents;
|
||||
elunaEvents = NULL;
|
||||
elunaEvents = nullptr;
|
||||
#endif
|
||||
|
||||
// this may happen because there are many !create/delete
|
||||
|
|
@ -300,8 +300,8 @@ void Object::DestroyForPlayer(Player* target, bool onDeath) const
|
|||
|
||||
void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
|
||||
{
|
||||
Unit const* unit = NULL;
|
||||
WorldObject const* object = NULL;
|
||||
Unit const* unit = nullptr;
|
||||
WorldObject const* object = nullptr;
|
||||
|
||||
if (isType(TYPEMASK_UNIT))
|
||||
unit = ToUnit();
|
||||
|
|
@ -463,7 +463,7 @@ void Object::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* targe
|
|||
UpdateMask updateMask;
|
||||
updateMask.SetCount(m_valuesCount);
|
||||
|
||||
uint32* flags = NULL;
|
||||
uint32* flags = nullptr;
|
||||
uint32 visibleFlag = GetUpdateFieldData(target, flags);
|
||||
|
||||
for (uint16 index = 0; index < m_valuesCount; ++index)
|
||||
|
|
@ -950,7 +950,7 @@ void MovementInfo::OutDebug()
|
|||
sLog->outString("guid " UI64FMTD, guid);
|
||||
sLog->outString("flags %u", flags);
|
||||
sLog->outString("flags2 %u", flags2);
|
||||
sLog->outString("time %u current time " UI64FMTD "", flags2, uint64(::time(NULL)));
|
||||
sLog->outString("time %u current time " UI64FMTD "", flags2, uint64(::time(nullptr)));
|
||||
sLog->outString("position: `%s`", pos.ToString().c_str());
|
||||
if (flags & MOVEMENTFLAG_ONTRANSPORT)
|
||||
{
|
||||
|
|
@ -976,10 +976,10 @@ void MovementInfo::OutDebug()
|
|||
|
||||
WorldObject::WorldObject(bool isWorldObject) : WorldLocation(),
|
||||
#ifdef ELUNA
|
||||
elunaEvents(NULL),
|
||||
elunaEvents(nullptr),
|
||||
#endif
|
||||
LastUsedScriptID(0), m_name(""), m_isActive(false), m_isVisibilityDistanceOverride(false), m_isWorldObject(isWorldObject), m_zoneScript(NULL),
|
||||
m_transport(NULL), m_currMap(NULL), m_InstanceId(0),
|
||||
LastUsedScriptID(0), m_name(""), m_isActive(false), m_isVisibilityDistanceOverride(false), m_isWorldObject(isWorldObject), m_zoneScript(nullptr),
|
||||
m_transport(nullptr), m_currMap(nullptr), m_InstanceId(0),
|
||||
m_phaseMask(PHASEMASK_NORMAL), m_useCombinedPhases(true), m_notifyflags(0), m_executed_notifies(0)
|
||||
{
|
||||
m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE | GHOST_VISIBILITY_GHOST);
|
||||
|
|
@ -1087,7 +1087,7 @@ void WorldObject::GetZoneAndAreaId(uint32& zoneid, uint32& areaid, bool /*forceR
|
|||
InstanceScript* WorldObject::GetInstanceScript()
|
||||
{
|
||||
Map* map = GetMap();
|
||||
return map->IsDungeon() ? map->ToInstanceMap()->GetInstanceScript() : NULL;
|
||||
return map->IsDungeon() ? map->ToInstanceMap()->GetInstanceScript() : nullptr;
|
||||
}
|
||||
|
||||
float WorldObject::GetDistanceZ(const WorldObject* obj) const
|
||||
|
|
@ -2094,10 +2094,10 @@ void WorldObject::ResetMap()
|
|||
|
||||
#ifdef ELUNA
|
||||
delete elunaEvents;
|
||||
elunaEvents = NULL;
|
||||
elunaEvents = nullptr;
|
||||
#endif
|
||||
|
||||
m_currMap = NULL;
|
||||
m_currMap = nullptr;
|
||||
//maybe not for corpse
|
||||
//m_mapId = 0;
|
||||
//m_InstanceId = 0;
|
||||
|
|
@ -2170,7 +2170,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
|
|||
break;
|
||||
}
|
||||
default:
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2178,7 +2178,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
|
|||
if (summoner)
|
||||
phase = summoner->GetPhaseMask();
|
||||
|
||||
TempSummon* summon = NULL;
|
||||
TempSummon* summon = nullptr;
|
||||
switch (mask)
|
||||
{
|
||||
case UNIT_MASK_SUMMON:
|
||||
|
|
@ -2197,14 +2197,14 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
|
|||
summon = new Minion(properties, summoner ? summoner->GetGUID() : 0, false);
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
EnsureGridLoaded(Cell(pos.GetPositionX(), pos.GetPositionY()));
|
||||
if (!summon->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), this, phase, entry, vehId, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation()))
|
||||
{
|
||||
delete summon;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
summon->SetUInt32Value(UNIT_CREATED_BY_SPELL, spellId);
|
||||
|
|
@ -2245,14 +2245,14 @@ GameObject* Map::SummonGameObject(uint32 entry, float x, float y, float z, float
|
|||
if (!goinfo)
|
||||
{
|
||||
sLog->outErrorDb("Gameobject template %u not found in database!", entry);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GameObject* go = sObjectMgr->IsGameObjectStaticTransport(entry) ? new StaticTransport() : new GameObject();
|
||||
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, this, PHASEMASK_NORMAL, x, y, z, ang, G3D::Quat(rotation0, rotation1, rotation2, rotation3), 100, GO_STATE_READY))
|
||||
{
|
||||
delete go;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Xinef: if gameobject is temporary, set custom spellid
|
||||
|
|
@ -2286,26 +2286,26 @@ TempSummon* WorldObject::SummonCreature(uint32 entry, const Position &pos, TempS
|
|||
{
|
||||
if (Map* map = FindMap())
|
||||
{
|
||||
if (TempSummon* summon = map->SummonCreature(entry, pos, properties, duration, isType(TYPEMASK_UNIT) ? (Unit*)this : NULL))
|
||||
if (TempSummon* summon = map->SummonCreature(entry, pos, properties, duration, isType(TYPEMASK_UNIT) ? (Unit*)this : nullptr))
|
||||
{
|
||||
summon->SetTempSummonType(spwtype);
|
||||
return summon;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport)
|
||||
{
|
||||
if (!IsInWorld())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(entry);
|
||||
if (!goinfo)
|
||||
{
|
||||
sLog->outErrorDb("Gameobject template %u not found in database!", entry);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Map* map = GetMap();
|
||||
|
|
@ -2313,7 +2313,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
|
|||
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, map, GetPhaseMask(), x, y, z, ang, G3D::Quat(rotation0, rotation1, rotation2, rotation3), 100, GO_STATE_READY))
|
||||
{
|
||||
delete go;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
go->SetRespawnTime(respawnTime);
|
||||
|
|
@ -2336,7 +2336,7 @@ Creature* WorldObject::SummonTrigger(float x, float y, float z, float ang, uint3
|
|||
TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;
|
||||
Creature* summon = SummonCreature(WORLD_TRIGGER, x, y, z, ang, summonType, duration);
|
||||
if (!summon)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
//summon->SetName(GetName());
|
||||
if (setLevel && (GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT))
|
||||
|
|
@ -2375,7 +2375,7 @@ void WorldObject::SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list
|
|||
|
||||
Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive) const
|
||||
{
|
||||
Creature* creature = NULL;
|
||||
Creature* creature = nullptr;
|
||||
acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
|
||||
acore::CreatureLastSearcher<acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(this, creature, checker);
|
||||
VisitNearbyObject(range, searcher);
|
||||
|
|
@ -2384,7 +2384,7 @@ Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive
|
|||
|
||||
GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
|
||||
{
|
||||
GameObject* go = NULL;
|
||||
GameObject* go = nullptr;
|
||||
acore::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range);
|
||||
acore::GameObjectLastSearcher<acore::NearestGameObjectEntryInObjectRangeCheck> searcher(this, go, checker);
|
||||
VisitNearbyGridObject(range, searcher);
|
||||
|
|
@ -2393,7 +2393,7 @@ GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
|
|||
|
||||
GameObject* WorldObject::FindNearestGameObjectOfType(GameobjectTypes type, float range) const
|
||||
{
|
||||
GameObject* go = NULL;
|
||||
GameObject* go = nullptr;
|
||||
acore::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range);
|
||||
acore::GameObjectLastSearcher<acore::NearestGameObjectTypeInObjectRangeCheck> searcher(this, go, checker);
|
||||
VisitNearbyGridObject(range, searcher);
|
||||
|
|
@ -2402,7 +2402,7 @@ GameObject* WorldObject::FindNearestGameObjectOfType(GameobjectTypes type, float
|
|||
|
||||
Player* WorldObject::SelectNearestPlayer(float distance) const
|
||||
{
|
||||
Player* target = NULL;
|
||||
Player* target = nullptr;
|
||||
|
||||
acore::NearestPlayerInObjectRangeCheck checker(this, distance);
|
||||
acore::PlayerLastSearcher<acore::NearestPlayerInObjectRangeCheck> searcher(this, target, checker);
|
||||
|
|
@ -2965,7 +2965,7 @@ struct WorldObjectChangeAccumulator
|
|||
}
|
||||
void Visit(PlayerMapType &m)
|
||||
{
|
||||
Player* source = NULL;
|
||||
Player* source = nullptr;
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
source = iter->GetSource();
|
||||
|
|
@ -2983,7 +2983,7 @@ struct WorldObjectChangeAccumulator
|
|||
|
||||
void Visit(CreatureMapType &m)
|
||||
{
|
||||
Creature* source = NULL;
|
||||
Creature* source = nullptr;
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
source = iter->GetSource();
|
||||
|
|
@ -2998,7 +2998,7 @@ struct WorldObjectChangeAccumulator
|
|||
|
||||
void Visit(DynamicObjectMapType &m)
|
||||
{
|
||||
DynamicObject* source = NULL;
|
||||
DynamicObject* source = nullptr;
|
||||
for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
source = iter->GetSource();
|
||||
|
|
|
|||
|
|
@ -307,21 +307,21 @@ class Object
|
|||
// FG: some hacky helpers
|
||||
void ForceValuesUpdateAtIndex(uint32);
|
||||
|
||||
Player* ToPlayer() { if (GetTypeId() == TYPEID_PLAYER) return reinterpret_cast<Player*>(this); else return NULL; }
|
||||
Player const* ToPlayer() const { if (GetTypeId() == TYPEID_PLAYER) return (Player const*)((Player*)this); else return NULL; }
|
||||
Creature* ToCreature() { if (GetTypeId() == TYPEID_UNIT) return reinterpret_cast<Creature*>(this); else return NULL; }
|
||||
Creature const* ToCreature() const { if (GetTypeId() == TYPEID_UNIT) return (Creature const*)((Creature*)this); else return NULL; }
|
||||
Player* ToPlayer() { if (GetTypeId() == TYPEID_PLAYER) return reinterpret_cast<Player*>(this); else return nullptr; }
|
||||
Player const* ToPlayer() const { if (GetTypeId() == TYPEID_PLAYER) return (Player const*)((Player*)this); else return nullptr; }
|
||||
Creature* ToCreature() { if (GetTypeId() == TYPEID_UNIT) return reinterpret_cast<Creature*>(this); else return nullptr; }
|
||||
Creature const* ToCreature() const { if (GetTypeId() == TYPEID_UNIT) return (Creature const*)((Creature*)this); else return nullptr; }
|
||||
|
||||
Unit* ToUnit() { if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return reinterpret_cast<Unit*>(this); else return NULL; }
|
||||
Unit const* ToUnit() const { if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return (const Unit*)((Unit*)this); else return NULL; }
|
||||
GameObject* ToGameObject() { if (GetTypeId() == TYPEID_GAMEOBJECT) return reinterpret_cast<GameObject*>(this); else return NULL; }
|
||||
GameObject const* ToGameObject() const { if (GetTypeId() == TYPEID_GAMEOBJECT) return (const GameObject*)((GameObject*)this); else return NULL; }
|
||||
Unit* ToUnit() { if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return reinterpret_cast<Unit*>(this); else return nullptr; }
|
||||
Unit const* ToUnit() const { if (GetTypeId() == TYPEID_UNIT || GetTypeId() == TYPEID_PLAYER) return (const Unit*)((Unit*)this); else return nullptr; }
|
||||
GameObject* ToGameObject() { if (GetTypeId() == TYPEID_GAMEOBJECT) return reinterpret_cast<GameObject*>(this); else return nullptr; }
|
||||
GameObject const* ToGameObject() const { if (GetTypeId() == TYPEID_GAMEOBJECT) return (const GameObject*)((GameObject*)this); else return nullptr; }
|
||||
|
||||
Corpse* ToCorpse() { if (GetTypeId() == TYPEID_CORPSE) return reinterpret_cast<Corpse*>(this); else return NULL; }
|
||||
Corpse const* ToCorpse() const { if (GetTypeId() == TYPEID_CORPSE) return (const Corpse*)((Corpse*)this); else return NULL; }
|
||||
Corpse* ToCorpse() { if (GetTypeId() == TYPEID_CORPSE) return reinterpret_cast<Corpse*>(this); else return nullptr; }
|
||||
Corpse const* ToCorpse() const { if (GetTypeId() == TYPEID_CORPSE) return (const Corpse*)((Corpse*)this); else return nullptr; }
|
||||
|
||||
DynamicObject* ToDynObject() { if (GetTypeId() == TYPEID_DYNAMICOBJECT) return reinterpret_cast<DynamicObject*>(this); else return NULL; }
|
||||
DynamicObject const* ToDynObject() const { if (GetTypeId() == TYPEID_DYNAMICOBJECT) return reinterpret_cast<DynamicObject const*>(this); else return NULL; }
|
||||
DynamicObject* ToDynObject() { if (GetTypeId() == TYPEID_DYNAMICOBJECT) return reinterpret_cast<DynamicObject*>(this); else return nullptr; }
|
||||
DynamicObject const* ToDynObject() const { if (GetTypeId() == TYPEID_DYNAMICOBJECT) return reinterpret_cast<DynamicObject const*>(this); else return nullptr; }
|
||||
|
||||
DataMap CustomData;
|
||||
|
||||
|
|
@ -897,7 +897,7 @@ class WorldObject : public Object, public WorldLocation
|
|||
virtual void CleanupsBeforeDelete(bool finalCleanup = true); // used in destructor or explicitly before mass creature delete to remove cross-references to already deleted units
|
||||
|
||||
virtual void SendMessageToSet(WorldPacket* data, bool self) { if (IsInWorld()) SendMessageToSetInRange(data, GetVisibilityRange(), self, true); } // pussywizard!
|
||||
virtual void SendMessageToSetInRange(WorldPacket* data, float dist, bool /*self*/, bool includeMargin = false, Player const* skipped_rcvr = NULL); // pussywizard!
|
||||
virtual void SendMessageToSetInRange(WorldPacket* data, float dist, bool /*self*/, bool includeMargin = false, Player const* skipped_rcvr = nullptr); // pussywizard!
|
||||
virtual void SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr) { if (IsInWorld()) SendMessageToSetInRange(data, GetVisibilityRange(), false, true, skipped_rcvr); } // pussywizard!
|
||||
|
||||
virtual uint8 getLevelForTarget(WorldObject const* /*target*/) const { return 1; }
|
||||
|
|
@ -911,8 +911,8 @@ class WorldObject : public Object, public WorldLocation
|
|||
void MonsterTextEmote(int32 textId, WorldObject const* target, bool IsBossEmote = false);
|
||||
void MonsterWhisper(int32 textId, Player const* target, bool IsBossWhisper = false);
|
||||
|
||||
void PlayDistanceSound(uint32 sound_id, Player* target = NULL);
|
||||
void PlayDirectSound(uint32 sound_id, Player* target = NULL);
|
||||
void PlayDistanceSound(uint32 sound_id, Player* target = nullptr);
|
||||
void PlayDirectSound(uint32 sound_id, Player* target = nullptr);
|
||||
|
||||
void SendObjectDeSpawnAnim(uint64 guid);
|
||||
|
||||
|
|
@ -921,7 +921,7 @@ class WorldObject : public Object, public WorldLocation
|
|||
|
||||
float GetGridActivationRange() const;
|
||||
float GetVisibilityRange() const;
|
||||
float GetSightRange(const WorldObject* target = NULL) const;
|
||||
float GetSightRange(const WorldObject* target = nullptr) const;
|
||||
//bool CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth = false, bool distanceCheck = false) const;
|
||||
bool CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth = false, bool distanceCheck = false, bool checkAlert = false) const;
|
||||
|
||||
|
|
@ -950,8 +950,8 @@ class WorldObject : public Object, public WorldLocation
|
|||
void SetZoneScript();
|
||||
ZoneScript* GetZoneScript() const { return m_zoneScript; }
|
||||
|
||||
TempSummon* SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, uint32 vehId = 0, SummonPropertiesEntry const *properties = NULL) const;
|
||||
TempSummon* SummonCreature(uint32 id, float x, float y, float z, float ang = 0, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, SummonPropertiesEntry const *properties = NULL)
|
||||
TempSummon* SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, uint32 vehId = 0, SummonPropertiesEntry const *properties = nullptr) const;
|
||||
TempSummon* SummonCreature(uint32 id, float x, float y, float z, float ang = 0, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, SummonPropertiesEntry const *properties = nullptr)
|
||||
{
|
||||
if (!x && !y && !z)
|
||||
{
|
||||
|
|
@ -963,8 +963,8 @@ class WorldObject : public Object, public WorldLocation
|
|||
return SummonCreature(id, pos, spwtype, despwtime, 0, properties);
|
||||
}
|
||||
GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport = true);
|
||||
Creature* SummonTrigger(float x, float y, float z, float ang, uint32 dur, bool setLevel = false, CreatureAI* (*GetAI)(Creature*) = NULL);
|
||||
void SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list = NULL);
|
||||
Creature* SummonTrigger(float x, float y, float z, float ang, uint32 dur, bool setLevel = false, CreatureAI* (*GetAI)(Creature*) = nullptr);
|
||||
void SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list = nullptr);
|
||||
|
||||
Creature* FindNearestCreature(uint32 entry, float range, bool alive = true) const;
|
||||
GameObject* FindNearestGameObject(uint32 entry, float range) const;
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ ObjectPosSelector::ObjectPosSelector(float x, float y, float size, float dist)
|
|||
m_smallStepOk[USED_POS_PLUS] = false;
|
||||
m_smallStepOk[USED_POS_MINUS] = false;
|
||||
|
||||
m_smallStepNextUsedPos[USED_POS_PLUS] = NULL;
|
||||
m_smallStepNextUsedPos[USED_POS_MINUS] = NULL;
|
||||
m_smallStepNextUsedPos[USED_POS_PLUS] = nullptr;
|
||||
m_smallStepNextUsedPos[USED_POS_MINUS] = nullptr;
|
||||
}
|
||||
|
||||
ObjectPosSelector::UsedPosList::value_type const* ObjectPosSelector::nextUsedPos(UsedPosType uptype)
|
||||
|
|
@ -35,7 +35,7 @@ ObjectPosSelector::UsedPosList::value_type const* ObjectPosSelector::nextUsedPos
|
|||
if (!m_UsedPosLists[~uptype].empty())
|
||||
return &*m_UsedPosLists[~uptype].rbegin();
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
return &*itr;
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ class UpdateMask
|
|||
CLIENT_UPDATE_MASK_BITS = sizeof(ClientUpdateMaskType) * 8,
|
||||
};
|
||||
|
||||
UpdateMask() : _fieldCount(0), _blockCount(0), _bits(NULL) { }
|
||||
UpdateMask() : _fieldCount(0), _blockCount(0), _bits(nullptr) { }
|
||||
|
||||
UpdateMask(UpdateMask const& right) : _bits(NULL)
|
||||
UpdateMask(UpdateMask const& right) : _bits(nullptr)
|
||||
{
|
||||
SetCount(right.GetCount());
|
||||
memcpy(_bits, right._bits, sizeof(uint8) * _blockCount * 32);
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@
|
|||
|
||||
#define PET_XP_FACTOR 0.05f
|
||||
|
||||
Pet::Pet(Player* owner, PetType type) : Guardian(NULL, owner ? owner->GetGUID() : 0, true),
|
||||
Pet::Pet(Player* owner, PetType type) : Guardian(nullptr, owner ? owner->GetGUID() : 0, true),
|
||||
m_usedTalentCount(0), m_removed(false), m_owner(owner),
|
||||
m_happinessTimer(PET_LOSE_HAPPINES_INTERVAL), m_petType(type), m_duration(0),
|
||||
m_auraRaidUpdateMask(0), m_loading(false), m_petRegenTimer(PET_FOCUS_REGEN_INTERVAL), m_declinedname(NULL), m_tempspellTarget(NULL), m_tempoldTarget(NULL), m_tempspellIsPositive(false), m_tempspell(0), asynchLoadType(PET_LOAD_DEFAULT)
|
||||
m_auraRaidUpdateMask(0), m_loading(false), m_petRegenTimer(PET_FOCUS_REGEN_INTERVAL), m_declinedname(nullptr), m_tempspellTarget(nullptr), m_tempoldTarget(nullptr), m_tempspellIsPositive(false), m_tempspell(0), asynchLoadType(PET_LOAD_DEFAULT)
|
||||
{
|
||||
m_unitTypeMask |= UNIT_MASK_PET;
|
||||
if (type == HUNTER_PET)
|
||||
|
|
@ -289,7 +289,7 @@ void Pet::SavePetToDB(PetSaveMode mode, bool logout)
|
|||
stmt->setUInt32(12, curhealth);
|
||||
stmt->setUInt32(13, curmana);
|
||||
stmt->setUInt32(14, GetPower(POWER_HAPPINESS));
|
||||
stmt->setUInt32(15, time(NULL));
|
||||
stmt->setUInt32(15, time(nullptr));
|
||||
|
||||
std::ostringstream ss;
|
||||
for (uint32 i = ACTION_BAR_INDEX_START; i < ACTION_BAR_INDEX_END; ++i)
|
||||
|
|
@ -373,7 +373,7 @@ void Pet::Update(uint32 diff)
|
|||
{
|
||||
case CORPSE:
|
||||
{
|
||||
if (getPetType() != HUNTER_PET || m_corpseRemoveTime <= time(NULL))
|
||||
if (getPetType() != HUNTER_PET || m_corpseRemoveTime <= time(nullptr))
|
||||
{
|
||||
Remove(PET_SAVE_NOT_IN_SLOT); //hunters' pets never get removed because of death, NEVER!
|
||||
return;
|
||||
|
|
@ -463,7 +463,7 @@ void Pet::Update(uint32 diff)
|
|||
|
||||
CastSpell(tempspellTarget, tempspell, true);
|
||||
m_tempspell = 0;
|
||||
m_tempspellTarget = NULL;
|
||||
m_tempspellTarget = nullptr;
|
||||
|
||||
if (tempspellIsPositive)
|
||||
{
|
||||
|
|
@ -489,7 +489,7 @@ void Pet::Update(uint32 diff)
|
|||
GetMotionMaster()->MoveFollow(charmer, PET_FOLLOW_DIST, GetFollowAngle());
|
||||
}
|
||||
|
||||
m_tempoldTarget = NULL;
|
||||
m_tempoldTarget = nullptr;
|
||||
m_tempspellIsPositive = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -498,8 +498,8 @@ void Pet::Update(uint32 diff)
|
|||
else
|
||||
{
|
||||
m_tempspell = 0;
|
||||
m_tempspellTarget = NULL;
|
||||
m_tempoldTarget = NULL;
|
||||
m_tempspellTarget = nullptr;
|
||||
m_tempoldTarget = nullptr;
|
||||
m_tempspellIsPositive = false;
|
||||
|
||||
Unit* victim = charmer->GetVictim();
|
||||
|
|
@ -1060,7 +1060,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
|||
|
||||
// xinef: fixes orc death knight command racial
|
||||
if (owner->getRace() == RACE_ORC)
|
||||
CastSpell(this, SPELL_ORC_RACIAL_COMMAND, true, NULL, NULL, owner->GetGUID());
|
||||
CastSpell(this, SPELL_ORC_RACIAL_COMMAND, true, nullptr, nullptr, owner->GetGUID());
|
||||
|
||||
// Avoidance, Night of the Dead
|
||||
if (Aura *aur = AddAura(SPELL_NIGHT_OF_THE_DEAD_AVOIDANCE, this))
|
||||
|
|
@ -1128,7 +1128,7 @@ void Pet::_LoadSpellCooldowns(PreparedQueryResult result)
|
|||
|
||||
if (result)
|
||||
{
|
||||
time_t curTime = time(NULL);
|
||||
time_t curTime = time(nullptr);
|
||||
|
||||
PacketCooldowns cooldowns;
|
||||
WorldPacket data;
|
||||
|
|
@ -1174,7 +1174,7 @@ void Pet::_SaveSpellCooldowns(SQLTransaction& trans, bool logout)
|
|||
stmt->setUInt32(0, m_charmInfo->GetPetNumber());
|
||||
trans->Append(stmt);
|
||||
|
||||
time_t curTime = time(NULL);
|
||||
time_t curTime = time(nullptr);
|
||||
uint32 checkTime = World::GetGameTimeMS() + 30*IN_MILLISECONDS;
|
||||
|
||||
// remove oudated and save active
|
||||
|
|
@ -1587,7 +1587,7 @@ void Pet::InitLevelupSpellsForLevel()
|
|||
{
|
||||
uint8 level = getLevel();
|
||||
|
||||
if (PetLevelupSpellSet const* levelupSpells = GetCreatureTemplate()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureTemplate()->family) : NULL)
|
||||
if (PetLevelupSpellSet const* levelupSpells = GetCreatureTemplate()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureTemplate()->family) : nullptr)
|
||||
{
|
||||
// PetLevelupSpellSet ordered by levels, process in reversed order
|
||||
for (PetLevelupSpellSet::const_reverse_iterator itr = levelupSpells->rbegin(); itr != levelupSpells->rend(); ++itr)
|
||||
|
|
@ -2157,7 +2157,7 @@ void Pet::HandleAsynchLoadSucceed()
|
|||
// Warlock pet exception, check if owner is casting new summon spell
|
||||
if (Spell* spell = owner->GetCurrentSpell(CURRENT_GENERIC_SPELL))
|
||||
if (spell->GetSpellInfo()->HasEffect(SPELL_EFFECT_SUMMON_PET))
|
||||
CastSpell(this, 32752, true, NULL, NULL, GetGUID());
|
||||
CastSpell(this, 32752, true, nullptr, nullptr, GetGUID());
|
||||
|
||||
|
||||
if (owner->NeedSendSpectatorData() && GetCreatureTemplate()->family)
|
||||
|
|
@ -2215,7 +2215,7 @@ void Pet::HandleAsynchLoadFailed(AsynchPetSummon* info, Player* player, uint8 as
|
|||
pet->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, 1000);
|
||||
pet->SetFullHealth();
|
||||
pet->SetPower(POWER_MANA, pet->GetMaxPower(POWER_MANA));
|
||||
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); // cast can't be helped in this case
|
||||
pet->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(nullptr))); // cast can't be helped in this case
|
||||
}
|
||||
|
||||
map->AddToMap(pet->ToCreature(), true);
|
||||
|
|
@ -2324,8 +2324,8 @@ void Pet::ClearCastWhenWillAvailable()
|
|||
{
|
||||
m_tempspellIsPositive = false;
|
||||
m_tempspell = 0;
|
||||
m_tempspellTarget = NULL;
|
||||
m_tempoldTarget = NULL;
|
||||
m_tempspellTarget = nullptr;
|
||||
m_tempoldTarget = nullptr;
|
||||
}
|
||||
|
||||
void Pet::RemoveSpellCooldown(uint32 spell_id, bool update /* = false */)
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class Pet : public Guardian
|
|||
bool CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit* owner);
|
||||
bool CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phaseMask);
|
||||
static SpellCastResult TryLoadFromDB(Player* owner, bool current = false, PetType mandatoryPetType = MAX_PET_TYPE);
|
||||
static bool LoadPetFromDB(Player* owner, uint8 asynchLoadType, uint32 petentry = 0, uint32 petnumber = 0, bool current = false, AsynchPetSummon* info = NULL);
|
||||
static bool LoadPetFromDB(Player* owner, uint8 asynchLoadType, uint32 petentry = 0, uint32 petnumber = 0, bool current = false, AsynchPetSummon* info = nullptr);
|
||||
bool isBeingLoaded() const override { return m_loading;}
|
||||
void SavePetToDB(PetSaveMode mode, bool logout);
|
||||
void Remove(PetSaveMode mode, bool returnreagent = false);
|
||||
|
|
@ -136,7 +136,7 @@ class Pet : public Guardian
|
|||
void InitPetCreateSpells();
|
||||
|
||||
bool resetTalents();
|
||||
static void resetTalentsForAllPetsOf(Player* owner, Pet* online_pet = NULL);
|
||||
static void resetTalentsForAllPetsOf(Player* owner, Pet* online_pet = nullptr);
|
||||
void InitTalentForLevel();
|
||||
|
||||
uint8 GetMaxTalentPointsForLevel(uint8 level);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -143,7 +143,7 @@ enum TalentTree // talent tabs
|
|||
// Spell modifier (used for modify other spells)
|
||||
struct SpellModifier
|
||||
{
|
||||
SpellModifier(Aura* _ownerAura = NULL) : op(SPELLMOD_DAMAGE), type(SPELLMOD_FLAT), charges(0), value(0), mask(), spellId(0), ownerAura(_ownerAura) {}
|
||||
SpellModifier(Aura* _ownerAura = nullptr) : op(SPELLMOD_DAMAGE), type(SPELLMOD_FLAT), charges(0), value(0), mask(), spellId(0), ownerAura(_ownerAura) {}
|
||||
SpellModOp op : 8;
|
||||
SpellModType type : 8;
|
||||
int16 charges : 16;
|
||||
|
|
@ -257,7 +257,7 @@ struct PlayerClassLevelInfo
|
|||
|
||||
struct PlayerClassInfo
|
||||
{
|
||||
PlayerClassInfo() : levelInfo(NULL) { }
|
||||
PlayerClassInfo() : levelInfo(nullptr) { }
|
||||
|
||||
PlayerClassLevelInfo* levelInfo; //[level-1] 0..MaxPlayerLevel-1
|
||||
};
|
||||
|
|
@ -286,7 +286,7 @@ typedef std::list<PlayerCreateInfoAction> PlayerCreateInfoActions;
|
|||
struct PlayerInfo
|
||||
{
|
||||
// existence checked by displayId != 0
|
||||
PlayerInfo() : mapId(0), areaId(0), positionX(0.0f), positionY(0.0f), positionZ(0.0f), orientation(0.0f), displayId_m(0), displayId_f(0), levelInfo(NULL) { }
|
||||
PlayerInfo() : mapId(0), areaId(0), positionX(0.0f), positionY(0.0f), positionZ(0.0f), orientation(0.0f), displayId_m(0), displayId_f(0), levelInfo(nullptr) { }
|
||||
|
||||
uint32 mapId;
|
||||
uint32 areaId;
|
||||
|
|
@ -316,7 +316,7 @@ struct PvPInfo
|
|||
|
||||
struct DuelInfo
|
||||
{
|
||||
DuelInfo() : initiator(NULL), opponent(NULL), startTimer(0), startTime(0), outOfBound(0), isMounted(false) {}
|
||||
DuelInfo() : initiator(nullptr), opponent(nullptr), startTimer(0), startTime(0), outOfBound(0), isMounted(false) {}
|
||||
|
||||
Player* initiator;
|
||||
Player* opponent;
|
||||
|
|
@ -380,7 +380,7 @@ struct Runes
|
|||
|
||||
struct EnchantDuration
|
||||
{
|
||||
EnchantDuration() : item(NULL), slot(MAX_ENCHANTMENT_SLOT), leftduration(0) {};
|
||||
EnchantDuration() : item(nullptr), slot(MAX_ENCHANTMENT_SLOT), leftduration(0) {};
|
||||
EnchantDuration(Item* _item, EnchantmentSlot _slot, uint32 _leftduration) : item(_item), slot(_slot),
|
||||
leftduration(_leftduration){ ASSERT(item); };
|
||||
|
||||
|
|
@ -1065,7 +1065,7 @@ class TradeData
|
|||
void SetItem(TradeSlots slot, Item* item);
|
||||
|
||||
uint32 GetSpell() const { return m_spell; }
|
||||
void SetSpell(uint32 spell_id, Item* castItem = NULL);
|
||||
void SetSpell(uint32 spell_id, Item* castItem = nullptr);
|
||||
|
||||
Item* GetSpellCastItem() const;
|
||||
bool HasSpellCastItem() const { return m_spellCastItem != 0; }
|
||||
|
|
@ -1161,14 +1161,14 @@ class Player : public Unit, public GridObject<Player>
|
|||
|
||||
void SetSummonPoint(uint32 mapid, float x, float y, float z, uint32 delay = 0, bool asSpectator = false)
|
||||
{
|
||||
m_summon_expire = time(NULL) + (delay ? delay : MAX_PLAYER_SUMMON_DELAY);
|
||||
m_summon_expire = time(nullptr) + (delay ? delay : MAX_PLAYER_SUMMON_DELAY);
|
||||
m_summon_mapid = mapid;
|
||||
m_summon_x = x;
|
||||
m_summon_y = y;
|
||||
m_summon_z = z;
|
||||
m_summon_asSpectator = asSpectator;
|
||||
}
|
||||
bool IsSummonAsSpectator() const { return m_summon_asSpectator && m_summon_expire >= time(NULL); }
|
||||
bool IsSummonAsSpectator() const { return m_summon_asSpectator && m_summon_expire >= time(nullptr); }
|
||||
void SetSummonAsSpectator(bool on) { m_summon_asSpectator = on; }
|
||||
void SummonIfPossible(bool agree, uint32 summoner_guid);
|
||||
time_t GetSummonExpireTimer() const { return m_summon_expire; }
|
||||
|
|
@ -1271,8 +1271,8 @@ class Player : public Unit, public GridObject<Player>
|
|||
void SetVirtualItemSlot(uint8 i, Item* item);
|
||||
void SetSheath(SheathState sheathed) override; // overwrite Unit version
|
||||
uint8 FindEquipSlot(ItemTemplate const* proto, uint32 slot, bool swap) const;
|
||||
uint32 GetItemCount(uint32 item, bool inBankAlso = false, Item* skipItem = NULL) const;
|
||||
uint32 GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem = NULL) const;
|
||||
uint32 GetItemCount(uint32 item, bool inBankAlso = false, Item* skipItem = nullptr) const;
|
||||
uint32 GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem = nullptr) const;
|
||||
Item* GetItemByGuid(uint64 guid) const;
|
||||
Item* GetItemByEntry(uint32 entry) const;
|
||||
Item* GetItemByPos(uint16 pos) const;
|
||||
|
|
@ -1281,7 +1281,7 @@ class Player : public Unit, public GridObject<Player>
|
|||
inline Item* GetUseableItemByPos(uint8 bag, uint8 slot) const //Does additional check for disarmed weapons
|
||||
{
|
||||
if (!CanUseAttackType(GetAttackBySlot(slot)))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return GetItemByPos(bag, slot);
|
||||
}
|
||||
Item* GetWeaponForAttack(WeaponAttackType attackType, bool useable = false) const;
|
||||
|
|
@ -1300,13 +1300,13 @@ class Player : public Unit, public GridObject<Player>
|
|||
uint8 GetBankBagSlotCount() const { return GetByteValue(PLAYER_BYTES_2, 2); }
|
||||
void SetBankBagSlotCount(uint8 count) { SetByteValue(PLAYER_BYTES_2, 2, count); }
|
||||
bool HasItemCount(uint32 item, uint32 count = 1, bool inBankAlso = false) const;
|
||||
bool HasItemFitToSpellRequirements(SpellInfo const* spellInfo, Item const* ignoreItem = NULL) const;
|
||||
bool HasItemFitToSpellRequirements(SpellInfo const* spellInfo, Item const* ignoreItem = nullptr) const;
|
||||
bool CanNoReagentCast(SpellInfo const* spellInfo) const;
|
||||
bool HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_slot = NULL_SLOT) const;
|
||||
bool HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot = NULL_SLOT) const;
|
||||
InventoryResult CanTakeMoreSimilarItems(Item* pItem) const { return CanTakeMoreSimilarItems(pItem->GetEntry(), pItem->GetCount(), pItem); }
|
||||
InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count) const { return CanTakeMoreSimilarItems(entry, count, NULL); }
|
||||
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = NULL) const
|
||||
InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count) const { return CanTakeMoreSimilarItems(entry, count, nullptr); }
|
||||
InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = nullptr) const
|
||||
{
|
||||
return CanStoreItem(bag, slot, dest, item, count, NULL, false, no_space_count);
|
||||
}
|
||||
|
|
@ -1315,7 +1315,7 @@ class Player : public Unit, public GridObject<Player>
|
|||
if (!pItem)
|
||||
return EQUIP_ERR_ITEM_NOT_FOUND;
|
||||
uint32 count = pItem->GetCount();
|
||||
return CanStoreItem(bag, slot, dest, pItem->GetEntry(), count, pItem, swap, NULL);
|
||||
return CanStoreItem(bag, slot, dest, pItem->GetEntry(), count, pItem, swap, nullptr);
|
||||
}
|
||||
InventoryResult CanStoreItems(Item** pItem, int32 count) const;
|
||||
InventoryResult CanEquipNewItem(uint8 slot, uint16& dest, uint32 item, bool swap) const;
|
||||
|
|
@ -1345,8 +1345,8 @@ class Player : public Unit, public GridObject<Player>
|
|||
void UpdateLootAchievements(LootItem *item, Loot* loot);
|
||||
void UpdateTitansGrip();
|
||||
|
||||
InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = NULL) const;
|
||||
InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* pItem = NULL, bool swap = false, uint32* no_space_count = NULL) const;
|
||||
InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = nullptr) const;
|
||||
InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* pItem = NULL, bool swap = false, uint32* no_space_count = nullptr) const;
|
||||
|
||||
void AddRefundReference(uint32 it);
|
||||
void DeleteRefundReference(uint32 it);
|
||||
|
|
@ -1400,7 +1400,7 @@ class Player : public Unit, public GridObject<Player>
|
|||
|
||||
float GetReputationPriceDiscount(Creature const* creature) const;
|
||||
|
||||
Player* GetTrader() const { return m_trade ? m_trade->GetTrader() : NULL; }
|
||||
Player* GetTrader() const { return m_trade ? m_trade->GetTrader() : nullptr; }
|
||||
TradeData* GetTradeData() const { return m_trade; }
|
||||
void TradeCancel(bool sendback);
|
||||
|
||||
|
|
@ -1456,7 +1456,7 @@ class Player : public Unit, public GridObject<Player>
|
|||
bool CanSeeStartQuest(Quest const* quest);
|
||||
bool CanTakeQuest(Quest const* quest, bool msg);
|
||||
bool CanAddQuest(Quest const* quest, bool msg);
|
||||
bool CanCompleteQuest(uint32 quest_id, const QuestStatusData* q_savedStatus = NULL);
|
||||
bool CanCompleteQuest(uint32 quest_id, const QuestStatusData* q_savedStatus = nullptr);
|
||||
bool CanCompleteRepeatableQuest(Quest const* quest);
|
||||
bool CanRewardQuest(Quest const* quest, bool msg);
|
||||
bool CanRewardQuest(Quest const* quest, uint32 reward, bool msg);
|
||||
|
|
@ -1692,7 +1692,7 @@ class Player : public Unit, public GridObject<Player>
|
|||
Item* GetMItem(uint32 id)
|
||||
{
|
||||
ItemMap::const_iterator itr = mMitems.find(id);
|
||||
return itr != mMitems.end() ? itr->second : NULL;
|
||||
return itr != mMitems.end() ? itr->second : nullptr;
|
||||
}
|
||||
|
||||
void AddMItem(Item* it)
|
||||
|
|
@ -1793,12 +1793,12 @@ class Player : public Unit, public GridObject<Player>
|
|||
SpellCooldowns & GetSpellCooldownMap() { return m_spellCooldowns; }
|
||||
|
||||
void AddSpellMod(SpellModifier* mod, bool apply);
|
||||
bool IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod, Spell* spell = NULL);
|
||||
bool IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod, Spell* spell = nullptr);
|
||||
bool HasSpellMod(SpellModifier* mod, Spell* spell);
|
||||
template <class T> T ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell* spell = NULL, bool temporaryPet = false);
|
||||
void RemoveSpellMods(Spell* spell);
|
||||
void RestoreSpellMods(Spell* spell, uint32 ownerAuraId = 0, Aura* aura = NULL);
|
||||
void RestoreAllSpellMods(uint32 ownerAuraId = 0, Aura* aura = NULL);
|
||||
void RestoreSpellMods(Spell* spell, uint32 ownerAuraId = 0, Aura* aura = nullptr);
|
||||
void RestoreAllSpellMods(uint32 ownerAuraId = 0, Aura* aura = nullptr);
|
||||
void DropModCharge(SpellModifier* mod, Spell* spell);
|
||||
void SetSpellModTakingSpell(Spell* spell, bool apply);
|
||||
|
||||
|
|
@ -1911,7 +1911,7 @@ class Player : public Unit, public GridObject<Player>
|
|||
bool IsInSameGroupWith(Player const* p) const;
|
||||
bool IsInSameRaidWith(Player const* p) const { return p == this || (GetGroup() != NULL && GetGroup() == p->GetGroup()); }
|
||||
void UninviteFromGroup();
|
||||
static void RemoveFromGroup(Group* group, uint64 guid, RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker = 0, const char* reason = NULL);
|
||||
static void RemoveFromGroup(Group* group, uint64 guid, RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker = 0, const char* reason = nullptr);
|
||||
void RemoveFromGroup(RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT) { RemoveFromGroup(GetGroup(), GetGUID(), method); }
|
||||
void SendUpdateToOutOfRangeGroupMembers();
|
||||
|
||||
|
|
@ -2055,7 +2055,7 @@ class Player : public Unit, public GridObject<Player>
|
|||
void UpdateUnderwaterState(Map* m, float x, float y, float z) override;
|
||||
|
||||
void SendMessageToSet(WorldPacket* data, bool self) override { SendMessageToSetInRange(data, GetVisibilityRange(), self, true); } // pussywizard!
|
||||
void SendMessageToSetInRange(WorldPacket* data, float dist, bool self, bool includeMargin = false, Player const* skipped_rcvr = NULL) override; // pussywizard!
|
||||
void SendMessageToSetInRange(WorldPacket* data, float dist, bool self, bool includeMargin = false, Player const* skipped_rcvr = nullptr) override; // pussywizard!
|
||||
void SendMessageToSetInRange_OwnTeam(WorldPacket* data, float dist, bool self); // pussywizard! param includeMargin not needed here
|
||||
void SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr) override { SendMessageToSetInRange(data, GetVisibilityRange(), skipped_rcvr != this, true, skipped_rcvr); } // pussywizard!
|
||||
|
||||
|
|
@ -2167,8 +2167,8 @@ class Player : public Unit, public GridObject<Player>
|
|||
bool RewardHonor(Unit* victim, uint32 groupsize, int32 honor = -1, bool awardXP = true);
|
||||
uint32 GetHonorPoints() const { return GetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY); }
|
||||
uint32 GetArenaPoints() const { return GetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY); }
|
||||
void ModifyHonorPoints(int32 value, SQLTransaction* trans = NULL); //! If trans is specified, honor save query will be added to trans
|
||||
void ModifyArenaPoints(int32 value, SQLTransaction* trans = NULL); //! If trans is specified, arena point save query will be added to trans
|
||||
void ModifyHonorPoints(int32 value, SQLTransaction* trans = nullptr); //! If trans is specified, honor save query will be added to trans
|
||||
void ModifyArenaPoints(int32 value, SQLTransaction* trans = nullptr); //! If trans is specified, arena point save query will be added to trans
|
||||
uint32 GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot) const;
|
||||
void SetHonorPoints(uint32 value);
|
||||
void SetArenaPoints(uint32 value);
|
||||
|
|
@ -2328,7 +2328,7 @@ class Player : public Unit, public GridObject<Player>
|
|||
|
||||
TeamId GetBgTeamId() const { return m_bgData.bgTeamId != TEAM_NEUTRAL ? m_bgData.bgTeamId : GetTeamId(); }
|
||||
|
||||
void LeaveBattleground(Battleground* bg = NULL);
|
||||
void LeaveBattleground(Battleground* bg = nullptr);
|
||||
bool CanJoinToBattleground() const;
|
||||
bool CanReportAfkDueToLimit();
|
||||
void ReportedAfkBy(Player* reporter);
|
||||
|
|
@ -2555,7 +2555,7 @@ class Player : public Unit, public GridObject<Player>
|
|||
void ResetAchievements();
|
||||
void CheckAllAchievementCriteria();
|
||||
void ResetAchievementCriteria(AchievementCriteriaCondition condition, uint32 value, bool evenIfCriteriaComplete = false);
|
||||
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit* unit = NULL);
|
||||
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit* unit = nullptr);
|
||||
void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost = 0);
|
||||
void RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry);
|
||||
void CompletedAchievement(AchievementEntry const* entry);
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ void Totem::UnSummon(uint32 msTime)
|
|||
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* target = itr->GetSource();
|
||||
if (target && target->IsInMap(player) && group->SameSubGroup(player, target))
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#include "WorldModel.h"
|
||||
#include "Spell.h"
|
||||
|
||||
MotionTransport::MotionTransport() : Transport(), _transportInfo(NULL), _isMoving(true), _pendingStop(false), _triggeredArrivalEvent(false), _triggeredDepartureEvent(false), _passengersLoaded(false), _delayedTeleport(false)
|
||||
MotionTransport::MotionTransport() : Transport(), _transportInfo(nullptr), _isMoving(true), _pendingStop(false), _triggeredArrivalEvent(false), _triggeredDepartureEvent(false), _passengersLoaded(false), _delayedTeleport(false)
|
||||
{
|
||||
m_updateFlag = UPDATEFLAG_TRANSPORT | UPDATEFLAG_LOWGUID | UPDATEFLAG_STATIONARY_POSITION | UPDATEFLAG_ROTATION;
|
||||
}
|
||||
|
|
@ -102,7 +102,7 @@ void MotionTransport::CleanupsBeforeDelete(bool finalCleanup /*= true*/)
|
|||
{
|
||||
WorldObject* obj = *_passengers.begin();
|
||||
RemovePassenger(obj);
|
||||
obj->SetTransport(NULL);
|
||||
obj->SetTransport(nullptr);
|
||||
obj->m_movementInfo.transport.Reset();
|
||||
obj->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
|
||||
}
|
||||
|
|
@ -281,12 +281,12 @@ void MotionTransport::RemovePassenger(WorldObject* passenger, bool withAll)
|
|||
if (Player* plr = passenger->ToPlayer())
|
||||
{
|
||||
sScriptMgr->OnRemovePassenger(ToTransport(), plr);
|
||||
plr->SetFallInformation(time(NULL), plr->GetPositionZ());
|
||||
plr->SetFallInformation(time(nullptr), plr->GetPositionZ());
|
||||
}
|
||||
|
||||
if (withAll)
|
||||
{
|
||||
passenger->SetTransport(NULL);
|
||||
passenger->SetTransport(nullptr);
|
||||
passenger->m_movementInfo.flags &= ~MOVEMENTFLAG_ONTRANSPORT;
|
||||
passenger->m_movementInfo.transport.guid = 0;
|
||||
passenger->m_movementInfo.transport.pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
|
@ -302,7 +302,7 @@ Creature* MotionTransport::CreateNPCPassenger(uint32 guid, CreatureData const* d
|
|||
if (!creature->LoadCreatureFromDB(guid, map, false))
|
||||
{
|
||||
delete creature;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
float x = data->posX;
|
||||
|
|
@ -327,13 +327,13 @@ Creature* MotionTransport::CreateNPCPassenger(uint32 guid, CreatureData const* d
|
|||
{
|
||||
sLog->outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates aren't valid (X: %f Y: %f)",creature->GetGUIDLow(),creature->GetEntry(),creature->GetPositionX(),creature->GetPositionY());
|
||||
delete creature;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!map->AddToMap(creature))
|
||||
{
|
||||
delete creature;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
_staticPassengers.insert(creature);
|
||||
|
|
@ -350,7 +350,7 @@ GameObject* MotionTransport::CreateGOPassenger(uint32 guid, GameObjectData const
|
|||
if (!go->LoadGameObjectFromDB(guid, map, false))
|
||||
{
|
||||
delete go;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
float x = data->posX;
|
||||
|
|
@ -368,13 +368,13 @@ GameObject* MotionTransport::CreateGOPassenger(uint32 guid, GameObjectData const
|
|||
{
|
||||
sLog->outError("GameObject (guidlow %d, entry %d) not created. Suggested coordinates aren't valid (X: %f Y: %f)", go->GetGUIDLow(), go->GetEntry(), go->GetPositionX(), go->GetPositionY());
|
||||
delete go;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!map->AddToMap(go))
|
||||
{
|
||||
delete go;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
_staticPassengers.insert(go);
|
||||
|
|
@ -754,7 +754,7 @@ void StaticTransport::CleanupsBeforeDelete(bool finalCleanup /*= true*/)
|
|||
{
|
||||
WorldObject* obj = *_passengers.begin();
|
||||
RemovePassenger(obj);
|
||||
obj->SetTransport(NULL);
|
||||
obj->SetTransport(nullptr);
|
||||
obj->m_movementInfo.transport.Reset();
|
||||
obj->m_movementInfo.RemoveMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
|
||||
}
|
||||
|
|
@ -829,7 +829,7 @@ void StaticTransport::Update(uint32 diff)
|
|||
|
||||
void StaticTransport::RelocateToProgress(uint32 progress)
|
||||
{
|
||||
TransportAnimationEntry const *curr = NULL, *next = NULL;
|
||||
TransportAnimationEntry const *curr = NULL, *next = nullptr;
|
||||
float percPos;
|
||||
if (m_goValue.Transport.AnimationInfo->GetAnimNode(progress, curr, next, percPos))
|
||||
{
|
||||
|
|
@ -955,12 +955,12 @@ void StaticTransport::RemovePassenger(WorldObject* passenger, bool withAll)
|
|||
if (Player* plr = passenger->ToPlayer())
|
||||
{
|
||||
sScriptMgr->OnRemovePassenger(ToTransport(), plr);
|
||||
plr->SetFallInformation(time(NULL), plr->GetPositionZ());
|
||||
plr->SetFallInformation(time(nullptr), plr->GetPositionZ());
|
||||
}
|
||||
|
||||
if (withAll)
|
||||
{
|
||||
passenger->SetTransport(NULL);
|
||||
passenger->SetTransport(nullptr);
|
||||
passenger->m_movementInfo.flags &= ~MOVEMENTFLAG_ONTRANSPORT;
|
||||
passenger->m_movementInfo.transport.guid = 0;
|
||||
passenger->m_movementInfo.transport.pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ class Transport : public GameObject, public TransportBase
|
|||
{
|
||||
public:
|
||||
Transport() : GameObject() {}
|
||||
void CalculatePassengerPosition(float& x, float& y, float& z, float* o = NULL) const { TransportBase::CalculatePassengerPosition(x, y, z, o, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); }
|
||||
void CalculatePassengerOffset(float& x, float& y, float& z, float* o = NULL) const { TransportBase::CalculatePassengerOffset(x, y, z, o, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); }
|
||||
void CalculatePassengerPosition(float& x, float& y, float& z, float* o = nullptr) const { TransportBase::CalculatePassengerPosition(x, y, z, o, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); }
|
||||
void CalculatePassengerOffset(float& x, float& y, float& z, float* o = nullptr) const { TransportBase::CalculatePassengerOffset(x, y, z, o, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); }
|
||||
|
||||
typedef std::set<WorldObject*> PassengerSet;
|
||||
virtual void AddPassenger(WorldObject* passenger, bool withAll = false) = 0;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -950,7 +950,7 @@ public:
|
|||
uint32 GetSpellTypeMask() const { return _spellTypeMask; }
|
||||
uint32 GetSpellPhaseMask() const { return _spellPhaseMask; }
|
||||
uint32 GetHitMask() const { return _hitMask; }
|
||||
SpellInfo const* GetSpellInfo() const { return NULL; }
|
||||
SpellInfo const* GetSpellInfo() const { return nullptr; }
|
||||
SpellSchoolMask GetSchoolMask() const { return SPELL_SCHOOL_MASK_NONE; }
|
||||
DamageInfo* GetDamageInfo() const { return _damageInfo; }
|
||||
HealInfo* GetHealInfo() const { return _healInfo; }
|
||||
|
|
@ -1419,13 +1419,13 @@ class Unit : public WorldObject
|
|||
}
|
||||
Unit* getAttackerForHelper() const // If someone wants to help, who to give them
|
||||
{
|
||||
if (GetVictim() != NULL)
|
||||
if (GetVictim() != nullptr)
|
||||
return GetVictim();
|
||||
|
||||
if (!m_attackers.empty())
|
||||
return *(m_attackers.begin());
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
bool Attack(Unit* victim, bool meleeAttack);
|
||||
void CastStop(uint32 except_spellid = 0, bool withInstant = true);
|
||||
|
|
@ -1440,8 +1440,8 @@ class Unit : public WorldObject
|
|||
void StopAttackFaction(uint32 faction_id);
|
||||
Unit* SelectNearbyTarget(Unit* exclude = NULL, float dist = NOMINAL_MELEE_RANGE) const;
|
||||
Unit* SelectNearbyNoTotemTarget(Unit* exclude = NULL, float dist = NOMINAL_MELEE_RANGE) const;
|
||||
void SendMeleeAttackStop(Unit* victim = NULL);
|
||||
void SendMeleeAttackStart(Unit* victim, Player* sendTo = NULL);
|
||||
void SendMeleeAttackStop(Unit* victim = nullptr);
|
||||
void SendMeleeAttackStart(Unit* victim, Player* sendTo = nullptr);
|
||||
|
||||
void AddUnitState(uint32 f) { m_state |= f; }
|
||||
bool HasUnitState(const uint32 f) const { return (m_state & f); }
|
||||
|
|
@ -1481,7 +1481,7 @@ class Unit : public WorldObject
|
|||
uint32 GetResistance(SpellSchools school) const { return GetUInt32Value(UNIT_FIELD_RESISTANCES+school); }
|
||||
uint32 GetResistance(SpellSchoolMask mask) const;
|
||||
void SetResistance(SpellSchools school, int32 val) { SetStatInt32Value(UNIT_FIELD_RESISTANCES+school, val); }
|
||||
static float GetEffectiveResistChance(Unit const* owner, SpellSchoolMask schoolMask, Unit const* victim, SpellInfo const* spellInfo = NULL);
|
||||
static float GetEffectiveResistChance(Unit const* owner, SpellSchoolMask schoolMask, Unit const* victim, SpellInfo const* spellInfo = nullptr);
|
||||
|
||||
uint32 GetHealth() const { return GetUInt32Value(UNIT_FIELD_HEALTH); }
|
||||
uint32 GetMaxHealth() const { return GetUInt32Value(UNIT_FIELD_MAXHEALTH); }
|
||||
|
|
@ -1577,14 +1577,14 @@ class Unit : public WorldObject
|
|||
void Mount(uint32 mount, uint32 vehicleId = 0, uint32 creatureEntry = 0);
|
||||
void Dismount();
|
||||
|
||||
uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
|
||||
uint16 GetMaxSkillValueForLevel(Unit const* target = nullptr) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
|
||||
static void DealDamageMods(Unit const* victim, uint32 &damage, uint32* absorb);
|
||||
static uint32 DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = NULL, bool durabilityLoss = true, bool allowGM = false);
|
||||
static void Kill(Unit* killer, Unit* victim, bool durabilityLoss = true, WeaponAttackType attackType = BASE_ATTACK, SpellInfo const *spellProto = NULL);
|
||||
static void Kill(Unit* killer, Unit* victim, bool durabilityLoss = true, WeaponAttackType attackType = BASE_ATTACK, SpellInfo const *spellProto = nullptr);
|
||||
static int32 DealHeal(Unit* healer, Unit* victim, uint32 addhealth);
|
||||
|
||||
void ProcDamageAndSpell(Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpell = NULL, SpellInfo const* procAura = NULL);
|
||||
void ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage, SpellInfo const* procAura = NULL);
|
||||
void ProcDamageAndSpell(Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpell = NULL, SpellInfo const* procAura = nullptr);
|
||||
void ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage, SpellInfo const* procAura = nullptr);
|
||||
|
||||
void GetProcAurasTriggeredOnEvent(std::list<AuraApplication*>& aurasTriggeringProc, std::list<AuraApplication*>* procAuras, ProcEventInfo eventInfo);
|
||||
void TriggerAurasProcOnEvent(CalcDamageInfo& damageInfo);
|
||||
|
|
@ -1655,9 +1655,9 @@ class Unit : public WorldObject
|
|||
|
||||
return value;
|
||||
}
|
||||
uint32 GetUnitMeleeSkill(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
|
||||
uint32 GetDefenseSkillValue(Unit const* target = NULL) const;
|
||||
uint32 GetWeaponSkillValue(WeaponAttackType attType, Unit const* target = NULL) const;
|
||||
uint32 GetUnitMeleeSkill(Unit const* target = nullptr) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
|
||||
uint32 GetDefenseSkillValue(Unit const* target = nullptr) const;
|
||||
uint32 GetWeaponSkillValue(WeaponAttackType attType, Unit const* target = nullptr) const;
|
||||
float GetWeaponProcChance() const;
|
||||
float GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo* spellProto) const;
|
||||
|
||||
|
|
@ -1706,7 +1706,7 @@ class Unit : public WorldObject
|
|||
bool HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint32 familyFlags) const;
|
||||
bool virtual HasSpell(uint32 /*spellID*/) const { return false; }
|
||||
bool HasBreakableByDamageAuraType(AuraType type, uint32 excludeAura = 0) const;
|
||||
bool HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel = NULL) const;
|
||||
bool HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel = nullptr) const;
|
||||
|
||||
bool HasStealthAura() const { return HasAuraType(SPELL_AURA_MOD_STEALTH); }
|
||||
bool HasInvisibilityAura() const { return HasAuraType(SPELL_AURA_MOD_INVISIBILITY); }
|
||||
|
|
@ -1716,10 +1716,10 @@ class Unit : public WorldObject
|
|||
|
||||
bool isFrozen() const;
|
||||
|
||||
bool isTargetableForAttack(bool checkFakeDeath = true, Unit const* byWho = NULL) const;
|
||||
bool isTargetableForAttack(bool checkFakeDeath = true, Unit const* byWho = nullptr) const;
|
||||
|
||||
bool IsValidAttackTarget(Unit const* target) const;
|
||||
bool _IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, WorldObject const* obj = NULL) const;
|
||||
bool _IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, WorldObject const* obj = nullptr) const;
|
||||
|
||||
bool IsValidAssistTarget(Unit const* target) const;
|
||||
bool _IsValidAssistTarget(Unit const* target, SpellInfo const* bySpell) const;
|
||||
|
|
@ -1781,8 +1781,8 @@ class Unit : public WorldObject
|
|||
|
||||
void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 TransitTime, SplineFlags sf = SPLINEFLAG_WALK_MODE); // pussywizard: need to just send packet, with no shitty movement/spline
|
||||
void MonsterMoveWithSpeed(float x, float y, float z, float speed);
|
||||
//void SetFacing(float ori, WorldObject* obj = NULL);
|
||||
//void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL);
|
||||
//void SetFacing(float ori, WorldObject* obj = nullptr);
|
||||
//void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = nullptr);
|
||||
void SendMovementFlagUpdate(bool self = false);
|
||||
|
||||
bool IsLevitating() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY); }
|
||||
|
|
@ -1867,7 +1867,7 @@ class Unit : public WorldObject
|
|||
void RemoveAllMinionsByEntry(uint32 entry);
|
||||
void SetCharm(Unit* target, bool apply);
|
||||
Unit* GetNextRandomRaidMemberOrPet(float radius);
|
||||
bool SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* aurApp = NULL);
|
||||
bool SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* aurApp = nullptr);
|
||||
void RemoveCharmedBy(Unit* charmer);
|
||||
void RestoreFaction();
|
||||
|
||||
|
|
@ -1925,7 +1925,7 @@ class Unit : public WorldObject
|
|||
void RemoveOwnedAura(uint32 spellId, uint64 casterGUID = 0, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
void RemoveOwnedAura(Aura* aura, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
|
||||
Aura* GetOwnedAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, Aura* except = NULL) const;
|
||||
Aura* GetOwnedAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, Aura* except = nullptr) const;
|
||||
|
||||
// m_appliedAuras container management
|
||||
AuraApplicationMap & GetAppliedAuras() { return m_appliedAuras; }
|
||||
|
|
@ -1974,10 +1974,10 @@ class Unit : public WorldObject
|
|||
AuraEffect * GetAuraEffectDummy(uint32 spellid) const;
|
||||
inline AuraEffect* GetDummyAuraEffect(SpellFamilyNames name, uint32 iconId, uint8 effIndex) const { return GetAuraEffect(SPELL_AURA_DUMMY, name, iconId, effIndex);}
|
||||
|
||||
AuraApplication * GetAuraApplication(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, AuraApplication * except = NULL) const;
|
||||
AuraApplication * GetAuraApplication(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, AuraApplication * except = nullptr) const;
|
||||
Aura* GetAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const;
|
||||
|
||||
AuraApplication * GetAuraApplicationOfRankedSpell(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, AuraApplication * except = NULL) const;
|
||||
AuraApplication * GetAuraApplicationOfRankedSpell(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, AuraApplication * except = nullptr) const;
|
||||
Aura* GetAuraOfRankedSpell(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const;
|
||||
|
||||
void GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelChargesList& dispelList);
|
||||
|
|
@ -2007,7 +2007,7 @@ class Unit : public WorldObject
|
|||
|
||||
int32 GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const;
|
||||
float GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const;
|
||||
int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, const AuraEffect* except = NULL) const;
|
||||
int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, const AuraEffect* except = nullptr) const;
|
||||
int32 GetMaxNegativeAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const;
|
||||
|
||||
int32 GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
|
||||
|
|
@ -2117,7 +2117,7 @@ class Unit : public WorldObject
|
|||
virtual void UpdateMaxPower(Powers power) = 0;
|
||||
virtual void UpdateAttackPowerAndDamage(bool ranged = false) = 0;
|
||||
virtual void UpdateDamagePhysical(WeaponAttackType attType);
|
||||
float GetTotalAttackPowerValue(WeaponAttackType attType, Unit *pVictim = NULL) const;
|
||||
float GetTotalAttackPowerValue(WeaponAttackType attType, Unit *pVictim = nullptr) const;
|
||||
float GetWeaponDamageRange(WeaponAttackType attType, WeaponDamageRange type) const;
|
||||
void SetBaseWeaponDamage(WeaponAttackType attType, WeaponDamageRange damageRange, float value) { m_weaponDamage[attType][damageRange] = value; }
|
||||
virtual void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage) = 0;
|
||||
|
|
@ -2142,7 +2142,7 @@ class Unit : public WorldObject
|
|||
|
||||
// Threat related methods
|
||||
bool CanHaveThreatList() const;
|
||||
void AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = NULL);
|
||||
void AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = nullptr);
|
||||
float ApplyTotalThreatModifier(float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL);
|
||||
void DeleteThreatList();
|
||||
void TauntApply(Unit* victim);
|
||||
|
|
@ -2190,10 +2190,10 @@ class Unit : public WorldObject
|
|||
|
||||
void ModifyAuraState(AuraStateType flag, bool apply);
|
||||
uint32 BuildAuraStateUpdateForTarget(Unit* target) const;
|
||||
bool HasAuraState(AuraStateType flag, SpellInfo const* spellProto = NULL, Unit const* Caster = NULL) const;
|
||||
bool HasAuraState(AuraStateType flag, SpellInfo const* spellProto = NULL, Unit const* Caster = nullptr) const;
|
||||
void UnsummonAllTotems();
|
||||
Unit* GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo);
|
||||
Unit* GetMeleeHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo = NULL);
|
||||
Unit* GetMeleeHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo = nullptr);
|
||||
|
||||
int32 SpellBaseDamageBonusDone(SpellSchoolMask schoolMask);
|
||||
int32 SpellBaseDamageBonusTaken(SpellSchoolMask schoolMask, bool isDoT = false);
|
||||
|
|
@ -2206,8 +2206,8 @@ class Unit : public WorldObject
|
|||
uint32 SpellHealingBonusDone(Unit* victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, float TotalMod = 0.0f, uint32 stack = 1);
|
||||
uint32 SpellHealingBonusTaken(Unit* caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1);
|
||||
|
||||
uint32 MeleeDamageBonusDone(Unit *pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const *spellProto = NULL);
|
||||
uint32 MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage,WeaponAttackType attType, SpellInfo const *spellProto = NULL);
|
||||
uint32 MeleeDamageBonusDone(Unit *pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const *spellProto = nullptr);
|
||||
uint32 MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage,WeaponAttackType attType, SpellInfo const *spellProto = nullptr);
|
||||
|
||||
bool isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType = BASE_ATTACK);
|
||||
bool isBlockCritical();
|
||||
|
|
@ -2219,7 +2219,7 @@ class Unit : public WorldObject
|
|||
void SetLastManaUse(uint32 spellCastTime) { m_lastManaUse = spellCastTime; }
|
||||
bool IsUnderLastManaUseEffect() const;
|
||||
|
||||
void SetContestedPvP(Player* attackedPlayer = NULL);
|
||||
void SetContestedPvP(Player* attackedPlayer = nullptr);
|
||||
|
||||
uint32 GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const;
|
||||
float CalculateDefaultCoefficient(SpellInfo const *spellInfo, DamageEffectType damagetype) const;
|
||||
|
|
@ -2250,7 +2250,7 @@ class Unit : public WorldObject
|
|||
void SetSpeedRate(UnitMoveType mtype, float rate) { m_speed_rate[mtype] = rate; }
|
||||
|
||||
float ApplyEffectModifiers(SpellInfo const* spellProto, uint8 effect_index, float value) const;
|
||||
int32 CalculateSpellDamage(Unit const* target, SpellInfo const* spellProto, uint8 effect_index, int32 const* basePoints = NULL) const;
|
||||
int32 CalculateSpellDamage(Unit const* target, SpellInfo const* spellProto, uint8 effect_index, int32 const* basePoints = nullptr) const;
|
||||
int32 CalcSpellDuration(SpellInfo const* spellProto);
|
||||
int32 ModSpellDuration(SpellInfo const* spellProto, Unit const* target, int32 duration, bool positive, uint32 effectMask);
|
||||
void ModSpellCastTime(SpellInfo const* spellProto, int32 & castTime, Spell * spell=NULL);
|
||||
|
|
@ -2351,12 +2351,12 @@ class Unit : public WorldObject
|
|||
bool HandleSpellClick(Unit* clicker, int8 seatId = -1);
|
||||
void EnterVehicle(Unit* base, int8 seatId = -1);
|
||||
void EnterVehicleUnattackable(Unit *base, int8 seatId = -1);
|
||||
void ExitVehicle(Position const* exitPosition = NULL);
|
||||
void ExitVehicle(Position const* exitPosition = nullptr);
|
||||
void ChangeSeat(int8 seatId, bool next = true);
|
||||
|
||||
// Should only be called by AuraEffect::HandleAuraControlVehicle(AuraApplication const* auraApp, uint8 mode, bool apply) const;
|
||||
void _ExitVehicle(Position const* exitPosition = NULL);
|
||||
void _EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp = NULL);
|
||||
void _ExitVehicle(Position const* exitPosition = nullptr);
|
||||
void _EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp = nullptr);
|
||||
|
||||
void BuildMovementPacket(ByteBuffer *data) const;
|
||||
|
||||
|
|
@ -2378,15 +2378,15 @@ class Unit : public WorldObject
|
|||
virtual bool isBeingLoaded() const { return false;}
|
||||
bool IsDuringRemoveFromWorld() const {return m_duringRemoveFromWorld;}
|
||||
|
||||
Pet* ToPet(){ if (IsPet()) return reinterpret_cast<Pet*>(this); else return NULL; }
|
||||
Totem* ToTotem(){ if (IsTotem()) return reinterpret_cast<Totem*>(this); else return NULL; }
|
||||
TempSummon* ToTempSummon() { if (IsSummon()) return reinterpret_cast<TempSummon*>(this); else return NULL; }
|
||||
const TempSummon* ToTempSummon() const { if (IsSummon()) return reinterpret_cast<const TempSummon*>(this); else return NULL; }
|
||||
Pet* ToPet(){ if (IsPet()) return reinterpret_cast<Pet*>(this); else return nullptr; }
|
||||
Totem* ToTotem(){ if (IsTotem()) return reinterpret_cast<Totem*>(this); else return nullptr; }
|
||||
TempSummon* ToTempSummon() { if (IsSummon()) return reinterpret_cast<TempSummon*>(this); else return nullptr; }
|
||||
const TempSummon* ToTempSummon() const { if (IsSummon()) return reinterpret_cast<const TempSummon*>(this); else return nullptr; }
|
||||
|
||||
// pussywizard:
|
||||
// MMaps
|
||||
std::map<uint64, MMapTargetData> m_targetsNotAcceptable;
|
||||
bool isTargetNotAcceptableByMMaps(uint64 guid, uint32 currTime, const Position* t = NULL) const { std::map<uint64, MMapTargetData>::const_iterator itr = m_targetsNotAcceptable.find(guid); if (itr != m_targetsNotAcceptable.end() && (itr->second._endTime >= currTime || (t && !itr->second.PosChanged(*this, *t)))) return true; return false; }
|
||||
bool isTargetNotAcceptableByMMaps(uint64 guid, uint32 currTime, const Position* t = nullptr) const { std::map<uint64, MMapTargetData>::const_iterator itr = m_targetsNotAcceptable.find(guid); if (itr != m_targetsNotAcceptable.end() && (itr->second._endTime >= currTime || (t && !itr->second.PosChanged(*this, *t)))) return true; return false; }
|
||||
uint32 m_mmapNotAcceptableStartTime;
|
||||
// Safe mover
|
||||
std::set<SafeUnitPointer*> SafeUnitPointerSet;
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ Unit* Vehicle::GetPassenger(int8 seatId) const
|
|||
{
|
||||
SeatMap::const_iterator seat = Seats.find(seatId);
|
||||
if (seat == Seats.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return ObjectAccessor::GetUnit(*GetBase(), seat->second.Passenger.Guid);
|
||||
}
|
||||
|
|
@ -587,7 +587,7 @@ VehicleSeatEntry const* Vehicle::GetSeatForPassenger(Unit const* passenger)
|
|||
if (itr->second.Passenger.Guid == passenger->GetGUID())
|
||||
return itr->second.SeatInfo;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SeatMap::iterator Vehicle::GetSeatIteratorForPassenger(Unit* passenger)
|
||||
|
|
|
|||
|
|
@ -100,10 +100,10 @@ protected:
|
|||
|
||||
public:
|
||||
/// This method transforms supplied transport offsets into global coordinates
|
||||
virtual void CalculatePassengerPosition(float& x, float& y, float& z, float* o = NULL) const = 0;
|
||||
virtual void CalculatePassengerPosition(float& x, float& y, float& z, float* o = nullptr) const = 0;
|
||||
|
||||
/// This method transforms supplied global coordinates into local offsets
|
||||
virtual void CalculatePassengerOffset(float& x, float& y, float& z, float* o = NULL) const = 0;
|
||||
virtual void CalculatePassengerOffset(float& x, float& y, float& z, float* o = nullptr) const = 0;
|
||||
|
||||
protected:
|
||||
static void CalculatePassengerPosition(float& x, float& y, float& z, float* o, float transX, float transY, float transZ, float transO)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ bool GameEventMgr::CheckOneGameEvent(uint16 entry) const
|
|||
default:
|
||||
case GAMEEVENT_NORMAL:
|
||||
{
|
||||
time_t currenttime = time(NULL);
|
||||
time_t currenttime = time(nullptr);
|
||||
// Get the event information
|
||||
return mGameEvent[entry].start < currenttime
|
||||
&& currenttime < mGameEvent[entry].end
|
||||
|
|
@ -54,7 +54,7 @@ bool GameEventMgr::CheckOneGameEvent(uint16 entry) const
|
|||
// if inactive world event, check the prerequisite events
|
||||
case GAMEEVENT_WORLD_INACTIVE:
|
||||
{
|
||||
time_t currenttime = time(NULL);
|
||||
time_t currenttime = time(nullptr);
|
||||
for (std::set<uint16>::const_iterator itr = mGameEvent[entry].prerequisite_events.begin(); itr != mGameEvent[entry].prerequisite_events.end(); ++itr)
|
||||
{
|
||||
if ((mGameEvent[*itr].state != GAMEEVENT_WORLD_NEXTPHASE && mGameEvent[*itr].state != GAMEEVENT_WORLD_FINISHED) || // if prereq not in nextphase or finished state, then can't start this one
|
||||
|
|
@ -70,7 +70,7 @@ bool GameEventMgr::CheckOneGameEvent(uint16 entry) const
|
|||
|
||||
uint32 GameEventMgr::NextCheck(uint16 entry) const
|
||||
{
|
||||
time_t currenttime = time(NULL);
|
||||
time_t currenttime = time(nullptr);
|
||||
|
||||
// for NEXTPHASE state world events, return the delay to start the next event, so the followup event will be checked correctly
|
||||
if ((mGameEvent[entry].state == GAMEEVENT_WORLD_NEXTPHASE || mGameEvent[entry].state == GAMEEVENT_WORLD_FINISHED) && mGameEvent[entry].nextstart >= currenttime)
|
||||
|
|
@ -130,7 +130,7 @@ bool GameEventMgr::StartEvent(uint16 event_id, bool overwrite)
|
|||
ApplyNewEvent(event_id);
|
||||
if (overwrite)
|
||||
{
|
||||
mGameEvent[event_id].start = time(NULL);
|
||||
mGameEvent[event_id].start = time(nullptr);
|
||||
if (data.end <= data.start)
|
||||
data.end = data.start + data.length;
|
||||
}
|
||||
|
|
@ -178,7 +178,7 @@ void GameEventMgr::StopEvent(uint16 event_id, bool overwrite)
|
|||
|
||||
if (overwrite && !serverwide_evt)
|
||||
{
|
||||
data.start = time(NULL) - data.length * MINUTE;
|
||||
data.start = time(nullptr) - data.length * MINUTE;
|
||||
if (data.end <= data.start)
|
||||
data.end = data.start + data.length;
|
||||
}
|
||||
|
|
@ -876,7 +876,7 @@ void GameEventMgr::LoadFromDB()
|
|||
newEntry.entry = data->id;
|
||||
|
||||
// check validity with event's npcflag
|
||||
if (!sObjectMgr->IsVendorItemValid(newEntry.entry, newEntry.item, newEntry.maxcount, newEntry.incrtime, newEntry.ExtendedCost, NULL, NULL, event_npc_flag))
|
||||
if (!sObjectMgr->IsVendorItemValid(newEntry.entry, newEntry.item, newEntry.maxcount, newEntry.incrtime, newEntry.ExtendedCost, nullptr, nullptr, event_npc_flag))
|
||||
continue;
|
||||
|
||||
vendors.push_back(newEntry);
|
||||
|
|
@ -1100,7 +1100,7 @@ void GameEventMgr::StartArenaSeason()
|
|||
|
||||
uint32 GameEventMgr::Update() // return the next event delay in ms
|
||||
{
|
||||
time_t currenttime = time(NULL);
|
||||
time_t currenttime = time(nullptr);
|
||||
uint32 nextEventDelay = max_ge_check_delay; // 1 day
|
||||
uint32 calcDelay;
|
||||
std::set<uint16> activate, deactivate;
|
||||
|
|
@ -1682,7 +1682,7 @@ bool GameEventMgr::CheckOneGameEventConditions(uint16 event_id)
|
|||
// set the followup events' start time
|
||||
if (!mGameEvent[event_id].nextstart)
|
||||
{
|
||||
time_t currenttime = time(NULL);
|
||||
time_t currenttime = time(nullptr);
|
||||
mGameEvent[event_id].nextstart = currenttime + mGameEvent[event_id].length * 60;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -1779,7 +1779,7 @@ void GameEventMgr::SetHolidayEventTime(GameEventData& event)
|
|||
|
||||
bool singleDate = ((holiday->Date[0] >> 24) & 0x1F) == 31; // Events with fixed date within year have - 1
|
||||
|
||||
time_t curTime = time(NULL);
|
||||
time_t curTime = time(nullptr);
|
||||
for (int i = 0; i < MAX_HOLIDAY_DATES && holiday->Date[i]; ++i)
|
||||
{
|
||||
uint32 date = holiday->Date[i];
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ ObjectAccessor* ObjectAccessor::instance()
|
|||
Player* ObjectAccessor::GetObjectInWorld(uint64 guid, Player* /*typeSpecifier*/)
|
||||
{
|
||||
Player* player = HashMapHolder<Player>::Find(guid);
|
||||
return player && player->IsInWorld() ? player : NULL;
|
||||
return player && player->IsInWorld() ? player : nullptr;
|
||||
}
|
||||
|
||||
WorldObject* ObjectAccessor::GetWorldObject(WorldObject const& p, uint64 guid)
|
||||
|
|
@ -60,7 +60,7 @@ WorldObject* ObjectAccessor::GetWorldObject(WorldObject const& p, uint64 guid)
|
|||
case HIGHGUID_PET: return GetPet(p, guid);
|
||||
case HIGHGUID_DYNAMICOBJECT: return GetDynamicObject(p, guid);
|
||||
case HIGHGUID_CORPSE: return GetCorpse(p, guid);
|
||||
default: return NULL;
|
||||
default: return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ Object* ObjectAccessor::GetObjectByTypeMask(WorldObject const& p, uint64 guid, u
|
|||
break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Corpse* ObjectAccessor::GetCorpse(WorldObject const& u, uint64 guid)
|
||||
|
|
@ -115,10 +115,10 @@ GameObject* ObjectAccessor::GetGameObject(WorldObject const& u, uint64 guid)
|
|||
Transport* ObjectAccessor::GetTransport(WorldObject const& u, uint64 guid)
|
||||
{
|
||||
if (GUID_HIPART(guid) != HIGHGUID_MO_TRANSPORT && GUID_HIPART(guid) != HIGHGUID_TRANSPORT)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
GameObject* go = GetGameObject(u, guid);
|
||||
return go ? go->ToTransport() : NULL;
|
||||
return go ? go->ToTransport() : nullptr;
|
||||
}
|
||||
|
||||
DynamicObject* ObjectAccessor::GetDynamicObject(WorldObject const& u, uint64 guid)
|
||||
|
|
@ -154,7 +154,7 @@ Creature* ObjectAccessor::GetCreatureOrPetOrVehicle(WorldObject const& u, uint64
|
|||
if (IS_CRE_OR_VEH_GUID(guid))
|
||||
return GetCreature(u, guid);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Pet* ObjectAccessor::FindPet(uint64 guid)
|
||||
|
|
@ -206,7 +206,7 @@ Player* ObjectAccessor::FindPlayerByName(std::string const& name, bool checkInWo
|
|||
if (!checkInWorld || itr->second->IsInWorld())
|
||||
return itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ObjectAccessor::SaveAllPlayers()
|
||||
|
|
@ -223,7 +223,7 @@ Corpse* ObjectAccessor::GetCorpseForPlayerGUID(uint64 guid)
|
|||
|
||||
Player2CorpsesMapType::iterator iter = i_player2corpse.find(guid);
|
||||
if (iter == i_player2corpse.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
ASSERT(iter->second->GetType() != CORPSE_BONES);
|
||||
|
||||
|
|
@ -321,7 +321,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
|
|||
{
|
||||
//in fact this function is called from several places
|
||||
//even when player doesn't have a corpse, not an error
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
|
|
@ -340,7 +340,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
|
|||
corpse->DeleteFromDB(trans);
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
|
||||
Corpse* bones = NULL;
|
||||
Corpse* bones = nullptr;
|
||||
// create the bones only if the map and the grid is loaded at the corpse's location
|
||||
// ignore bones creating option in case insignia
|
||||
|
||||
|
|
@ -392,7 +392,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
|
|||
|
||||
void ObjectAccessor::RemoveOldCorpses()
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
time_t now = time(nullptr);
|
||||
Player2CorpsesMapType::iterator next;
|
||||
for (Player2CorpsesMapType::iterator itr = i_player2corpse.begin(); itr != i_player2corpse.end(); itr = next)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class HashMapHolder
|
|||
{
|
||||
ACORE_READ_GUARD(LockType, i_lock);
|
||||
typename MapType::iterator itr = m_objectMap.find(guid);
|
||||
return (itr != m_objectMap.end()) ? itr->second : NULL;
|
||||
return (itr != m_objectMap.end()) ? itr->second : nullptr;
|
||||
}
|
||||
|
||||
static MapType& GetContainer() { return m_objectMap; }
|
||||
|
|
@ -139,27 +139,27 @@ class ObjectAccessor
|
|||
if (T * obj = GetObjectInWorld(guid, (T*)NULL))
|
||||
if (obj->GetMap() == map)
|
||||
return obj;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template<class T> static T* GetObjectInWorld(uint32 mapid, float x, float y, uint64 guid, T* /*fake*/)
|
||||
{
|
||||
T* obj = HashMapHolder<T>::Find(guid);
|
||||
if (!obj || obj->GetMapId() != mapid)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
CellCoord p = acore::ComputeCellCoord(x, y);
|
||||
if (!p.IsCoordValid())
|
||||
{
|
||||
sLog->outError("ObjectAccessor::GetObjectInWorld: invalid coordinates supplied X:%f Y:%f grid cell [%u:%u]", x, y, p.x_coord, p.y_coord);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CellCoord q = acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
|
||||
if (!q.IsCoordValid())
|
||||
{
|
||||
sLog->outError("ObjectAccessor::GetObjecInWorld: object (GUID: %u TypeId: %u) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUIDLow(), obj->GetTypeId(), obj->GetPositionX(), obj->GetPositionY(), q.x_coord, q.y_coord);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int32 dx = int32(p.x_coord) - int32(q.x_coord);
|
||||
|
|
@ -168,7 +168,7 @@ class ObjectAccessor
|
|||
if (dx > -2 && dx < 2 && dy > -2 && dy < 2)
|
||||
return obj;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// these functions return objects only if in map of specified object
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ std::string GetScriptsTableNameByType(ScriptsType type)
|
|||
|
||||
ScriptMapMap* GetScriptsMapByType(ScriptsType type)
|
||||
{
|
||||
ScriptMapMap* res = NULL;
|
||||
ScriptMapMap* res = nullptr;
|
||||
switch (type)
|
||||
{
|
||||
case SCRIPTS_SPELL: res = &sSpellScripts; break;
|
||||
|
|
@ -171,7 +171,7 @@ LanguageDesc const* GetLanguageDescByID(uint32 lang)
|
|||
return &lang_description[i];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool SpellClickInfo::IsFitToRequirements(Unit const* clicker, Unit const* clickee) const
|
||||
|
|
@ -180,7 +180,7 @@ bool SpellClickInfo::IsFitToRequirements(Unit const* clicker, Unit const* clicke
|
|||
if (!playerClicker)
|
||||
return true;
|
||||
|
||||
Unit const* summoner = NULL;
|
||||
Unit const* summoner = nullptr;
|
||||
// Check summoners for party
|
||||
if (clickee->IsSummon())
|
||||
summoner = clickee->ToTempSummon()->GetSummoner();
|
||||
|
|
@ -228,9 +228,9 @@ ObjectMgr::ObjectMgr():
|
|||
{
|
||||
for (uint8 i = 0; i < MAX_CLASSES; ++i)
|
||||
{
|
||||
_playerClassInfo[i] = NULL;
|
||||
_playerClassInfo[i] = nullptr;
|
||||
for (uint8 j = 0; j < MAX_RACES; ++j)
|
||||
_playerInfo[j][i] = NULL;
|
||||
_playerInfo[j][i] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -514,7 +514,7 @@ void ObjectMgr::LoadCreatureTemplates()
|
|||
if (max)
|
||||
{
|
||||
_creatureTemplateStoreFast.clear();
|
||||
_creatureTemplateStoreFast.resize(max+1, NULL);
|
||||
_creatureTemplateStoreFast.resize(max+1, nullptr);
|
||||
for (CreatureTemplateContainer::iterator itr = _creatureTemplateStore.begin(); itr != _creatureTemplateStore.end(); ++itr)
|
||||
_creatureTemplateStoreFast[itr->first] = &(itr->second);
|
||||
}
|
||||
|
|
@ -748,7 +748,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
|
|||
sLog->outErrorDb("Creature (Entry: %u) has non-existing faction template (%u).", cInfo->Entry, cInfo->faction);
|
||||
|
||||
// used later for scale
|
||||
CreatureDisplayInfoEntry const* displayScaleEntry = NULL;
|
||||
CreatureDisplayInfoEntry const* displayScaleEntry = nullptr;
|
||||
|
||||
if (cInfo->Modelid1)
|
||||
{
|
||||
|
|
@ -1082,7 +1082,7 @@ GameObjectAddon const* ObjectMgr::GetGameObjectAddon(uint32 lowguid)
|
|||
if (itr != _gameObjectAddonStore.end())
|
||||
return &(itr->second);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CreatureAddon const* ObjectMgr::GetCreatureAddon(uint32 lowguid)
|
||||
|
|
@ -1091,7 +1091,7 @@ CreatureAddon const* ObjectMgr::GetCreatureAddon(uint32 lowguid)
|
|||
if (itr != _creatureAddonStore.end())
|
||||
return &(itr->second);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CreatureAddon const* ObjectMgr::GetCreatureTemplateAddon(uint32 entry)
|
||||
|
|
@ -1100,17 +1100,17 @@ CreatureAddon const* ObjectMgr::GetCreatureTemplateAddon(uint32 entry)
|
|||
if (itr != _creatureTemplateAddonStore.end())
|
||||
return &(itr->second);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
EquipmentInfo const* ObjectMgr::GetEquipmentInfo(uint32 entry, int8& id)
|
||||
{
|
||||
EquipmentInfoContainer::const_iterator itr = _equipmentInfoStore.find(entry);
|
||||
if (itr == _equipmentInfoStore.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
if (itr->second.empty())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
if (id == -1) // select a random element
|
||||
{
|
||||
|
|
@ -1126,7 +1126,7 @@ EquipmentInfo const* ObjectMgr::GetEquipmentInfo(uint32 entry, int8& id)
|
|||
return &itr2->second;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadEquipmentTemplates()
|
||||
|
|
@ -1214,7 +1214,7 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelId)
|
|||
if (itr != _creatureModelStore.end())
|
||||
return &(itr->second);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32 ObjectMgr::ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data /*= NULL*/)
|
||||
|
|
@ -1249,7 +1249,7 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* display
|
|||
{
|
||||
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(*displayID);
|
||||
if (!modelInfo)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
// If a model for another gender exists, 50% chance to use it
|
||||
if (modelInfo->modelid_other_gender != 0 && urand(0, 1) == 0)
|
||||
|
|
@ -2601,7 +2601,7 @@ void ObjectMgr::LoadItemTemplates()
|
|||
else if (itemTemplate.Spells[1].SpellId != -1)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itemTemplate.Spells[1].SpellId);
|
||||
if (!spellInfo && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[1].SpellId, NULL))
|
||||
if (!spellInfo && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[1].SpellId, nullptr))
|
||||
{
|
||||
sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)", entry, 1+1, itemTemplate.Spells[1].SpellId);
|
||||
itemTemplate.Spells[0].SpellId = 0;
|
||||
|
|
@ -2649,7 +2649,7 @@ void ObjectMgr::LoadItemTemplates()
|
|||
if (itemTemplate.Spells[j].SpellId && itemTemplate.Spells[j].SpellId != -1)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itemTemplate.Spells[j].SpellId);
|
||||
if (!spellInfo && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[j].SpellId, NULL))
|
||||
if (!spellInfo && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[j].SpellId, nullptr))
|
||||
{
|
||||
sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)", entry, j+1, itemTemplate.Spells[j].SpellId);
|
||||
itemTemplate.Spells[j].SpellId = 0;
|
||||
|
|
@ -2806,7 +2806,7 @@ void ObjectMgr::LoadItemTemplates()
|
|||
if (max)
|
||||
{
|
||||
_itemTemplateStoreFast.clear();
|
||||
_itemTemplateStoreFast.resize(max+1, NULL);
|
||||
_itemTemplateStoreFast.resize(max+1, nullptr);
|
||||
for (ItemTemplateContainer::iterator itr = _itemTemplateStore.begin(); itr != _itemTemplateStore.end(); ++itr)
|
||||
_itemTemplateStoreFast[itr->first] = &(itr->second);
|
||||
}
|
||||
|
|
@ -2844,7 +2844,7 @@ void ObjectMgr::LoadItemTemplates()
|
|||
|
||||
ItemTemplate const* ObjectMgr::GetItemTemplate(uint32 entry)
|
||||
{
|
||||
return entry < _itemTemplateStoreFast.size() ? _itemTemplateStoreFast[entry] : NULL;
|
||||
return entry < _itemTemplateStoreFast.size() ? _itemTemplateStoreFast[entry] : nullptr;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadItemSetNameLocales()
|
||||
|
|
@ -3113,7 +3113,7 @@ void ObjectMgr::LoadPetLevelInfo()
|
|||
|
||||
PetLevelInfo*& pInfoMapEntry = _petInfoStore[creature_id];
|
||||
|
||||
if (pInfoMapEntry == NULL)
|
||||
if (pInfoMapEntry == nullptr)
|
||||
pInfoMapEntry = new PetLevelInfo[sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)];
|
||||
|
||||
// data for level 1 stored in [0] array element, ...
|
||||
|
|
@ -3167,7 +3167,7 @@ PetLevelInfo const* ObjectMgr::GetPetLevelInfo(uint32 creature_id, uint8 level)
|
|||
|
||||
PetLevelInfoContainer::const_iterator itr = _petInfoStore.find(creature_id);
|
||||
if (itr == _petInfoStore.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return &itr->second[level-1]; // data for level 1 stored in [0] array element, ...
|
||||
}
|
||||
|
|
@ -3903,7 +3903,7 @@ void ObjectMgr::LoadQuests()
|
|||
if (max)
|
||||
{
|
||||
_questTemplatesFast.clear();
|
||||
_questTemplatesFast.resize(max+1, NULL);
|
||||
_questTemplatesFast.resize(max+1, nullptr);
|
||||
for (QuestMap::iterator itr = _questTemplates.begin(); itr != _questTemplates.end(); ++itr)
|
||||
_questTemplatesFast[itr->first] = itr->second;
|
||||
}
|
||||
|
|
@ -4008,7 +4008,7 @@ void ObjectMgr::LoadQuests()
|
|||
for (QuestMap::iterator iter = _questTemplates.begin(); iter != _questTemplates.end(); ++iter)
|
||||
{
|
||||
// skip post-loading checks for disabled quests
|
||||
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, iter->first, NULL))
|
||||
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, iter->first, nullptr))
|
||||
continue;
|
||||
|
||||
Quest * qinfo = iter->second;
|
||||
|
|
@ -5211,7 +5211,7 @@ PageText const* ObjectMgr::GetPageText(uint32 pageEntry)
|
|||
if (itr != _pageTextStore.end())
|
||||
return &(itr->second);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadPageTextLocales()
|
||||
|
|
@ -5293,7 +5293,7 @@ InstanceTemplate const* ObjectMgr::GetInstanceTemplate(uint32 mapID)
|
|||
if (itr != _instanceTemplateStore.end())
|
||||
return &(itr->second);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadInstanceEncounters()
|
||||
|
|
@ -5386,7 +5386,7 @@ GossipText const* ObjectMgr::GetGossipText(uint32 Text_ID) const
|
|||
GossipTextContainer::const_iterator itr = _gossipTextStore.find(Text_ID);
|
||||
if (itr != _gossipTextStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadGossipText()
|
||||
|
|
@ -5508,7 +5508,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
|
|||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
time_t curTime = time(NULL);
|
||||
time_t curTime = time(nullptr);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_EXPIRED_MAIL);
|
||||
stmt->setUInt32(0, curTime);
|
||||
|
|
@ -5549,7 +5549,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
|
|||
m->checked = fields[7].GetUInt8();
|
||||
m->mailTemplateId = fields[8].GetInt16();
|
||||
|
||||
Player* player = NULL;
|
||||
Player* player = nullptr;
|
||||
if (serverUp)
|
||||
player = ObjectAccessor::FindPlayerInOrOutOfWorld(MAKE_NEW_GUID(m->receiver, 0, HIGHGUID_PLAYER));
|
||||
|
||||
|
|
@ -6150,14 +6150,14 @@ AreaTriggerTeleport const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
|
|||
uint32 parentId = 0;
|
||||
const MapEntry* mapEntry = sMapStore.LookupEntry(Map);
|
||||
if (!mapEntry || mapEntry->entrance_map < 0)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
if (mapEntry->IsDungeon())
|
||||
{
|
||||
const InstanceTemplate* iTemplate = sObjectMgr->GetInstanceTemplate(Map);
|
||||
|
||||
if (!iTemplate)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
parentId = iTemplate->Parent;
|
||||
useParentDbValue = true;
|
||||
|
|
@ -6171,7 +6171,7 @@ AreaTriggerTeleport const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
|
|||
if (atEntry && atEntry->map == Map)
|
||||
return &itr->second;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -6189,7 +6189,7 @@ AreaTriggerTeleport const* ObjectMgr::GetMapEntranceTrigger(uint32 Map) const
|
|||
return &itr->second;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ObjectMgr::SetHighestGuids()
|
||||
|
|
@ -8010,13 +8010,13 @@ GameTele const* ObjectMgr::GetGameTele(const std::string& name) const
|
|||
// explicit name case
|
||||
std::wstring wname;
|
||||
if (!Utf8toWStr(name, wname))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
// converting string that we try to find to lower case
|
||||
wstrToLower(wname);
|
||||
|
||||
// Alternative first GameTele what contains wnameLow as substring in case no GameTele location found
|
||||
const GameTele* alt = NULL;
|
||||
const GameTele* alt = nullptr;
|
||||
for (GameTeleContainer::const_iterator itr = _gameTeleStore.begin(); itr != _gameTeleStore.end(); ++itr)
|
||||
{
|
||||
if (itr->second.wnameLow == wname)
|
||||
|
|
@ -9124,7 +9124,7 @@ GameObjectTemplate const* ObjectMgr::GetGameObjectTemplate(uint32 entry)
|
|||
if (itr != _gameObjectTemplateStore.end())
|
||||
return &(itr->second);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Player* ObjectMgr::GetPlayerByLowGUID(uint32 lowguid) const
|
||||
|
|
@ -9150,7 +9150,7 @@ GameObjectTemplateAddon const* ObjectMgr::GetGameObjectTemplateAddon(uint32 entr
|
|||
|
||||
CreatureTemplate const* ObjectMgr::GetCreatureTemplate(uint32 entry)
|
||||
{
|
||||
return entry < _creatureTemplateStoreFast.size() ? _creatureTemplateStoreFast[entry] : NULL;
|
||||
return entry < _creatureTemplateStoreFast.size() ? _creatureTemplateStoreFast[entry] : nullptr;
|
||||
}
|
||||
|
||||
VehicleAccessoryList const* ObjectMgr::GetVehicleAccessoryList(Vehicle* veh) const
|
||||
|
|
@ -9167,18 +9167,18 @@ VehicleAccessoryList const* ObjectMgr::GetVehicleAccessoryList(Vehicle* veh) con
|
|||
VehicleAccessoryContainer::const_iterator itr = _vehicleTemplateAccessoryStore.find(veh->GetCreatureEntry());
|
||||
if (itr != _vehicleTemplateAccessoryStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PlayerInfo const* ObjectMgr::GetPlayerInfo(uint32 race, uint32 class_) const
|
||||
{
|
||||
if (race >= MAX_RACES)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
if (class_ >= MAX_CLASSES)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
PlayerInfo const* info = _playerInfo[race][class_];
|
||||
if (!info)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return info;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -732,8 +732,8 @@ class ObjectMgr
|
|||
CreatureTemplateContainer const* GetCreatureTemplates() const { return &_creatureTemplateStore; }
|
||||
CreatureModelInfo const* GetCreatureModelInfo(uint32 modelId);
|
||||
CreatureModelInfo const* GetCreatureModelRandomGender(uint32* displayID);
|
||||
static uint32 ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data = NULL);
|
||||
static void ChooseCreatureFlags(CreatureTemplate const* cinfo, uint32& npcflag, uint32& unit_flags, uint32& dynamicflags, CreatureData const* data = NULL);
|
||||
static uint32 ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data = nullptr);
|
||||
static void ChooseCreatureFlags(CreatureTemplate const* cinfo, uint32& npcflag, uint32& unit_flags, uint32& dynamicflags, CreatureData const* data = nullptr);
|
||||
EquipmentInfo const* GetEquipmentInfo(uint32 entry, int8& id);
|
||||
CreatureAddon const* GetCreatureAddon(uint32 lowguid);
|
||||
GameObjectAddon const* GetGameObjectAddon(uint32 lowguid);
|
||||
|
|
@ -748,7 +748,7 @@ class ObjectMgr
|
|||
ItemSetNameContainer::iterator itr = _itemSetNameStore.find(itemId);
|
||||
if (itr != _itemSetNameStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
InstanceTemplate const* GetInstanceTemplate(uint32 mapId);
|
||||
|
|
@ -758,7 +758,7 @@ class ObjectMgr
|
|||
PlayerClassInfo const* GetPlayerClassInfo(uint32 class_) const
|
||||
{
|
||||
if (class_ >= MAX_CLASSES)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return _playerClassInfo[class_];
|
||||
}
|
||||
void GetPlayerClassLevelInfo(uint32 class_, uint8 level, PlayerClassLevelInfo* info) const;
|
||||
|
|
@ -782,7 +782,7 @@ class ObjectMgr
|
|||
GameObjectQuestItemMap::const_iterator itr = _gameObjectQuestItemStore.find(id);
|
||||
if (itr != _gameObjectQuestItemStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
GameObjectQuestItemMap const* GetGameObjectQuestItemMap() const { return &_gameObjectQuestItemStore; }
|
||||
|
||||
|
|
@ -791,13 +791,13 @@ class ObjectMgr
|
|||
CreatureQuestItemMap::const_iterator itr = _creatureQuestItemStore.find(id);
|
||||
if (itr != _creatureQuestItemStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
CreatureQuestItemMap const* GetCreatureQuestItemMap() const { return &_creatureQuestItemStore; }
|
||||
|
||||
Quest const* GetQuestTemplate(uint32 quest_id) const
|
||||
{
|
||||
return quest_id < _questTemplatesFast.size() ? _questTemplatesFast[quest_id] : NULL;
|
||||
return quest_id < _questTemplatesFast.size() ? _questTemplatesFast[quest_id] : nullptr;
|
||||
}
|
||||
|
||||
QuestMap const& GetQuestTemplates() const { return _questTemplates; }
|
||||
|
|
@ -822,7 +822,7 @@ class ObjectMgr
|
|||
AreaTriggerContainer::const_iterator itr = _areaTriggerStore.find(trigger);
|
||||
if (itr != _areaTriggerStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AreaTriggerTeleport const* GetAreaTriggerTeleport(uint32 trigger) const
|
||||
|
|
@ -830,7 +830,7 @@ class ObjectMgr
|
|||
AreaTriggerTeleportContainer::const_iterator itr = _areaTriggerTeleportStore.find(trigger);
|
||||
if (itr != _areaTriggerTeleportStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AccessRequirement const* GetAccessRequirement(uint32 mapid, Difficulty difficulty) const
|
||||
|
|
@ -838,7 +838,7 @@ class ObjectMgr
|
|||
AccessRequirementContainer::const_iterator itr = _accessRequirementStore.find(MAKE_PAIR32(mapid, difficulty));
|
||||
if (itr != _accessRequirementStore.end())
|
||||
return itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AreaTriggerTeleport const* GetGoBackTrigger(uint32 Map) const;
|
||||
|
|
@ -853,7 +853,7 @@ class ObjectMgr
|
|||
if (itr != _repRewardRateStore.end())
|
||||
return &itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ReputationOnKillEntry const* GetReputationOnKilEntry(uint32 id) const
|
||||
|
|
@ -861,7 +861,7 @@ class ObjectMgr
|
|||
RepOnKillContainer::const_iterator itr = _repOnKillStore.find(id);
|
||||
if (itr != _repOnKillStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int32 GetBaseReputationOf(FactionEntry const* factionEntry, uint8 race, uint8 playerClass);
|
||||
|
|
@ -872,7 +872,7 @@ class ObjectMgr
|
|||
if (itr != _repSpilloverTemplateStore.end())
|
||||
return &itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PointOfInterest const* GetPointOfInterest(uint32 id) const
|
||||
|
|
@ -880,7 +880,7 @@ class ObjectMgr
|
|||
PointOfInterestContainer::const_iterator itr = _pointsOfInterestStore.find(id);
|
||||
if (itr != _pointsOfInterestStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QuestPOIVector const* GetQuestPOIVector(uint32 questId)
|
||||
|
|
@ -888,7 +888,7 @@ class ObjectMgr
|
|||
QuestPOIContainer::const_iterator itr = _questPOIStore.find(questId);
|
||||
if (itr != _questPOIStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
VehicleAccessoryList const* GetVehicleAccessoryList(Vehicle* veh) const;
|
||||
|
|
@ -898,7 +898,7 @@ class ObjectMgr
|
|||
std::unordered_map<uint32, DungeonEncounterList>::const_iterator itr = _dungeonEncounterStore.find(MAKE_PAIR32(mapId, difficulty));
|
||||
if (itr != _dungeonEncounterStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void LoadQuests();
|
||||
|
|
@ -1074,13 +1074,13 @@ class ObjectMgr
|
|||
{
|
||||
MailLevelRewardContainer::const_iterator map_itr = _mailLevelRewardStore.find(level);
|
||||
if (map_itr == _mailLevelRewardStore.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
for (MailLevelRewardList::const_iterator set_itr = map_itr->second.begin(); set_itr != map_itr->second.end(); ++set_itr)
|
||||
if (set_itr->raceMask & raceMask)
|
||||
return &*set_itr;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CellObjectGuids const& GetCellObjectGuids(uint16 mapid, uint8 spawnMode, uint32 cell_id)
|
||||
|
|
@ -1118,7 +1118,7 @@ class ObjectMgr
|
|||
if (itr != _tempSummonDataStore.end())
|
||||
return &itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
BroadcastText const* GetBroadcastText(uint32 id) const
|
||||
|
|
@ -1131,7 +1131,7 @@ class ObjectMgr
|
|||
CreatureData const* GetCreatureData(uint32 guid) const
|
||||
{
|
||||
CreatureDataContainer::const_iterator itr = _creatureDataStore.find(guid);
|
||||
if (itr == _creatureDataStore.end()) return NULL;
|
||||
if (itr == _creatureDataStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
CreatureData& NewOrExistCreatureData(uint32 guid) { return _creatureDataStore[guid]; }
|
||||
|
|
@ -1146,55 +1146,55 @@ class ObjectMgr
|
|||
GameObjectData const* GetGOData(uint32 guid) const
|
||||
{
|
||||
GameObjectDataContainer::const_iterator itr = _gameObjectDataStore.find(guid);
|
||||
if (itr == _gameObjectDataStore.end()) return NULL;
|
||||
if (itr == _gameObjectDataStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
CreatureLocale const* GetCreatureLocale(uint32 entry) const
|
||||
{
|
||||
CreatureLocaleContainer::const_iterator itr = _creatureLocaleStore.find(entry);
|
||||
if (itr == _creatureLocaleStore.end()) return NULL;
|
||||
if (itr == _creatureLocaleStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
GameObjectLocale const* GetGameObjectLocale(uint32 entry) const
|
||||
{
|
||||
GameObjectLocaleContainer::const_iterator itr = _gameObjectLocaleStore.find(entry);
|
||||
if (itr == _gameObjectLocaleStore.end()) return NULL;
|
||||
if (itr == _gameObjectLocaleStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
ItemLocale const* GetItemLocale(uint32 entry) const
|
||||
{
|
||||
ItemLocaleContainer::const_iterator itr = _itemLocaleStore.find(entry);
|
||||
if (itr == _itemLocaleStore.end()) return NULL;
|
||||
if (itr == _itemLocaleStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
ItemSetNameLocale const* GetItemSetNameLocale(uint32 entry) const
|
||||
{
|
||||
ItemSetNameLocaleContainer::const_iterator itr = _itemSetNameLocaleStore.find(entry);
|
||||
if (itr == _itemSetNameLocaleStore.end())return NULL;
|
||||
if (itr == _itemSetNameLocaleStore.end())return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
PageTextLocale const* GetPageTextLocale(uint32 entry) const
|
||||
{
|
||||
PageTextLocaleContainer::const_iterator itr = _pageTextLocaleStore.find(entry);
|
||||
if (itr == _pageTextLocaleStore.end()) return NULL;
|
||||
if (itr == _pageTextLocaleStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
QuestLocale const* GetQuestLocale(uint32 entry) const
|
||||
{
|
||||
QuestLocaleContainer::const_iterator itr = _questLocaleStore.find(entry);
|
||||
if (itr == _questLocaleStore.end()) return NULL;
|
||||
if (itr == _questLocaleStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
GossipMenuItemsLocale const* GetGossipMenuItemsLocale(uint32 entry) const
|
||||
{
|
||||
GossipMenuItemsLocaleContainer::const_iterator itr = _gossipMenuItemsLocaleStore.find(entry);
|
||||
if (itr == _gossipMenuItemsLocaleStore.end()) return NULL;
|
||||
if (itr == _gossipMenuItemsLocaleStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
PointOfInterestLocale const* GetPointOfInterestLocale(uint32 poi_id) const
|
||||
{
|
||||
PointOfInterestLocaleContainer::const_iterator itr = _pointOfInterestLocaleStore.find(poi_id);
|
||||
if (itr == _pointOfInterestLocaleStore.end()) return NULL;
|
||||
if (itr == _pointOfInterestLocaleStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
QuestOfferRewardLocale const* GetQuestOfferRewardLocale(uint32 entry) const
|
||||
|
|
@ -1212,7 +1212,7 @@ class ObjectMgr
|
|||
NpcTextLocale const* GetNpcTextLocale(uint32 entry) const
|
||||
{
|
||||
NpcTextLocaleContainer::const_iterator itr = _npcTextLocaleStore.find(entry);
|
||||
if (itr == _npcTextLocaleStore.end()) return NULL;
|
||||
if (itr == _npcTextLocaleStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
GameObjectData& NewGOData(uint32 guid) { return _gameObjectDataStore[guid]; }
|
||||
|
|
@ -1222,7 +1222,7 @@ class ObjectMgr
|
|||
{
|
||||
AcoreStringContainer::const_iterator itr = _acoreStringStore.find(entry);
|
||||
if (itr == _acoreStringStore.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return &itr->second;
|
||||
}
|
||||
|
|
@ -1258,7 +1258,7 @@ class ObjectMgr
|
|||
GameTele const* GetGameTele(uint32 id) const
|
||||
{
|
||||
GameTeleContainer::const_iterator itr = _gameTeleStore.find(id);
|
||||
if (itr == _gameTeleStore.end()) return NULL;
|
||||
if (itr == _gameTeleStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
GameTele const* GetGameTele(std::string const& name) const;
|
||||
|
|
@ -1270,7 +1270,7 @@ class ObjectMgr
|
|||
{
|
||||
CacheTrainerSpellContainer::const_iterator iter = _cacheTrainerSpellStore.find(entry);
|
||||
if (iter == _cacheTrainerSpellStore.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return &iter->second;
|
||||
}
|
||||
|
|
@ -1279,7 +1279,7 @@ class ObjectMgr
|
|||
{
|
||||
CacheVendorItemContainer::const_iterator iter = _cacheVendorItemStore.find(entry);
|
||||
if (iter == _cacheVendorItemStore.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return &iter->second;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ class GridRefManager : public RefManager<GridRefManager<OBJECT>, OBJECT>
|
|||
GridReference<OBJECT>* getLast() { return (GridReference<OBJECT>*)RefManager<GridRefManager<OBJECT>, OBJECT>::getLast(); }
|
||||
|
||||
iterator begin() { return iterator(getFirst()); }
|
||||
iterator end() { return iterator(NULL); }
|
||||
iterator end() { return iterator(nullptr); }
|
||||
iterator rbegin() { return iterator(getLast()); }
|
||||
iterator rend() { return iterator(NULL); }
|
||||
iterator rend() { return iterator(nullptr); }
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace acore
|
|||
float i_distSq;
|
||||
TeamId teamId;
|
||||
Player const* skipped_receiver;
|
||||
MessageDistDeliverer(WorldObject* src, WorldPacket* msg, float dist, bool own_team_only = false, Player const* skipped = NULL)
|
||||
MessageDistDeliverer(WorldObject* src, WorldPacket* msg, float dist, bool own_team_only = false, Player const* skipped = nullptr)
|
||||
: i_source(src), i_message(msg), i_phaseMask(src->GetPhaseMask()), i_distSq(dist * dist)
|
||||
, teamId((own_team_only && src->GetTypeId() == TYPEID_PLAYER) ? src->ToPlayer()->GetTeamId() : TEAM_NEUTRAL)
|
||||
, skipped_receiver(skipped)
|
||||
|
|
@ -581,7 +581,7 @@ namespace acore
|
|||
{
|
||||
public:
|
||||
AnyDeadUnitSpellTargetInRangeCheck(Unit* searchObj, float range, SpellInfo const* spellInfo, SpellTargetCheckTypes check)
|
||||
: AnyDeadUnitObjectInRangeCheck(searchObj, range), i_spellInfo(spellInfo), i_check(searchObj, searchObj, spellInfo, check, NULL)
|
||||
: AnyDeadUnitObjectInRangeCheck(searchObj, range), i_spellInfo(spellInfo), i_check(searchObj, searchObj, spellInfo, check, nullptr)
|
||||
{}
|
||||
bool operator()(Player* u);
|
||||
bool operator()(Corpse* u);
|
||||
|
|
@ -977,7 +977,7 @@ namespace acore
|
|||
{
|
||||
public:
|
||||
AnyAoETargetUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range)
|
||||
: i_obj(obj), i_funit(funit), _spellInfo(NULL), i_range(range)
|
||||
: i_obj(obj), i_funit(funit), _spellInfo(nullptr), i_range(range)
|
||||
{
|
||||
Unit const* check = i_funit;
|
||||
Unit const* owner = i_funit->GetOwner();
|
||||
|
|
@ -993,7 +993,7 @@ namespace acore
|
|||
if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->IsTotem())
|
||||
return false;
|
||||
|
||||
if (i_funit->_IsValidAttackTarget(u, _spellInfo,i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT ? i_obj : NULL) && i_obj->IsWithinDistInMap(u, i_range))
|
||||
if (i_funit->_IsValidAttackTarget(u, _spellInfo,i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT ? i_obj : nullptr) && i_obj->IsWithinDistInMap(u, i_range))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -53,8 +53,8 @@ Loot* Roll::getLoot()
|
|||
|
||||
Group::Group() : m_leaderGuid(0), m_leaderName(""), m_groupType(GROUPTYPE_NORMAL),
|
||||
m_dungeonDifficulty(DUNGEON_DIFFICULTY_NORMAL), m_raidDifficulty(RAID_DIFFICULTY_10MAN_NORMAL),
|
||||
m_bfGroup(NULL), m_bgGroup(NULL), m_lootMethod(FREE_FOR_ALL), m_lootThreshold(ITEM_QUALITY_UNCOMMON), m_looterGuid(0),
|
||||
m_masterLooterGuid(0), m_subGroupsCounts(NULL), m_guid(0), m_counter(0), m_maxEnchantingLevel(0), _difficultyChangePreventionTime(0),
|
||||
m_bfGroup(nullptr), m_bgGroup(nullptr), m_lootMethod(FREE_FOR_ALL), m_lootThreshold(ITEM_QUALITY_UNCOMMON), m_looterGuid(0),
|
||||
m_masterLooterGuid(0), m_subGroupsCounts(nullptr), m_guid(0), m_counter(0), m_maxEnchantingLevel(0), _difficultyChangePreventionTime(0),
|
||||
_difficultyChangePreventionType(DIFFICULTY_PREVENTION_CHANGE_NONE)
|
||||
{
|
||||
for (uint8 i = 0; i < TARGETICONCOUNT; ++i)
|
||||
|
|
@ -68,8 +68,8 @@ Group::~Group()
|
|||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Group::~Group: battleground group being deleted.");
|
||||
#endif
|
||||
if (m_bgGroup->GetBgRaid(TEAM_ALLIANCE) == this) m_bgGroup->SetBgRaid(TEAM_ALLIANCE, NULL);
|
||||
else if (m_bgGroup->GetBgRaid(TEAM_HORDE) == this) m_bgGroup->SetBgRaid(TEAM_HORDE, NULL);
|
||||
if (m_bgGroup->GetBgRaid(TEAM_ALLIANCE) == this) m_bgGroup->SetBgRaid(TEAM_ALLIANCE, nullptr);
|
||||
else if (m_bgGroup->GetBgRaid(TEAM_HORDE) == this) m_bgGroup->SetBgRaid(TEAM_HORDE, nullptr);
|
||||
else sLog->outError("Group::~Group: battleground group is not linked to the correct battleground.");
|
||||
}
|
||||
Rolls::iterator itr;
|
||||
|
|
@ -314,7 +314,7 @@ void Group::RemoveInvite(Player* player)
|
|||
{
|
||||
if (!m_invitees.empty())
|
||||
m_invitees.erase(player);
|
||||
player->SetGroupInvite(NULL);
|
||||
player->SetGroupInvite(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -322,7 +322,7 @@ void Group::RemoveAllInvites()
|
|||
{
|
||||
for (InvitesList::iterator itr=m_invitees.begin(); itr != m_invitees.end(); ++itr)
|
||||
if (*itr)
|
||||
(*itr)->SetGroupInvite(NULL);
|
||||
(*itr)->SetGroupInvite(nullptr);
|
||||
|
||||
m_invitees.clear();
|
||||
}
|
||||
|
|
@ -334,7 +334,7 @@ Player* Group::GetInvited(uint64 guid) const
|
|||
if ((*itr) && (*itr)->GetGUID() == guid)
|
||||
return (*itr);
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Player* Group::GetInvited(const std::string& name) const
|
||||
|
|
@ -344,7 +344,7 @@ Player* Group::GetInvited(const std::string& name) const
|
|||
if ((*itr) && (*itr)->GetName() == name)
|
||||
return (*itr);
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool Group::AddMember(Player* player)
|
||||
|
|
@ -382,7 +382,7 @@ bool Group::AddMember(Player* player)
|
|||
|
||||
SubGroupCounterIncrease(subGroup);
|
||||
|
||||
player->SetGroupInvite(NULL);
|
||||
player->SetGroupInvite(nullptr);
|
||||
if (player->GetGroup())
|
||||
{
|
||||
if (isBGGroup() || isBFGroup()) // if player is in group and he is being added to BG raid group, then call SetBattlegroundRaid()
|
||||
|
|
@ -454,7 +454,7 @@ bool Group::AddMember(Player* player)
|
|||
WorldPacket groupDataPacket;
|
||||
|
||||
// Broadcast group members' fields to player
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
if (itr->GetSource() == player) // pussywizard: no check same map, adding members is single threaded
|
||||
continue;
|
||||
|
|
@ -522,9 +522,9 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
|
|||
// Regular group
|
||||
{
|
||||
if (player->GetOriginalGroup() == this)
|
||||
player->SetOriginalGroup(NULL);
|
||||
player->SetOriginalGroup(nullptr);
|
||||
else
|
||||
player->SetGroup(NULL);
|
||||
player->SetGroup(nullptr);
|
||||
|
||||
// quest related GO state dependent from raid membership
|
||||
player->UpdateForQuestWorldObjects();
|
||||
|
|
@ -727,9 +727,9 @@ void Group::Disband(bool hideDestroy /* = false */)
|
|||
{
|
||||
//we can remove player who is in battleground from his original group
|
||||
if (player->GetOriginalGroup() == this)
|
||||
player->SetOriginalGroup(NULL);
|
||||
player->SetOriginalGroup(nullptr);
|
||||
else
|
||||
player->SetGroup(NULL);
|
||||
player->SetGroup(nullptr);
|
||||
}
|
||||
|
||||
// quest related GO state dependent from raid membership
|
||||
|
|
@ -947,7 +947,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
|
|||
Roll* r = new Roll(newitemGUID, *i);
|
||||
|
||||
//a vector is filled with only near party members
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* member = itr->GetSource();
|
||||
if (!member)
|
||||
|
|
@ -1031,7 +1031,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
|
|||
Roll* r = new Roll(newitemGUID, *i);
|
||||
|
||||
//a vector is filled with only near party members
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* member = itr->GetSource();
|
||||
if (!member)
|
||||
|
|
@ -1091,7 +1091,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
|
|||
uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM);
|
||||
Roll* r = new Roll(newitemGUID, *i);
|
||||
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* playerToRoll = itr->GetSource();
|
||||
if (!playerToRoll)
|
||||
|
|
@ -1165,7 +1165,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
|
|||
uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM);
|
||||
Roll* r = new Roll(newitemGUID, *i);
|
||||
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* playerToRoll = itr->GetSource();
|
||||
if (!playerToRoll)
|
||||
|
|
@ -1243,7 +1243,7 @@ void Group::MasterLoot(Loot* loot, WorldObject* pLootedObject)
|
|||
WorldPacket data(SMSG_LOOT_MASTER_LIST, 330);
|
||||
data << (uint8)GetMembersCount();
|
||||
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* looter = itr->GetSource();
|
||||
if (!looter->IsInWorld())
|
||||
|
|
@ -1258,7 +1258,7 @@ void Group::MasterLoot(Loot* loot, WorldObject* pLootedObject)
|
|||
|
||||
data.put<uint8>(0, real_count);
|
||||
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* looter = itr->GetSource();
|
||||
if (looter->IsAtGroupRewardDistance(pLootedObject))
|
||||
|
|
@ -1310,7 +1310,7 @@ bool Group::CountRollVote(uint64 playerGUID, uint64 Guid, uint8 Choice)
|
|||
|
||||
if (roll->totalPass + roll->totalNeed + roll->totalGreed >= roll->totalPlayersRolling)
|
||||
{
|
||||
CountTheRoll(rollI, NULL);
|
||||
CountTheRoll(rollI, nullptr);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -1347,7 +1347,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
|||
{
|
||||
uint8 maxresul = 0;
|
||||
uint64 maxguid = 0; // pussywizard: start with 0 >_>
|
||||
Player* player = NULL;
|
||||
Player* player = nullptr;
|
||||
|
||||
for (Roll::PlayerVote::const_iterator itr=roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr)
|
||||
{
|
||||
|
|
@ -1395,7 +1395,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
|||
{
|
||||
item->is_blocked = false;
|
||||
item->rollWinnerGUID = player->GetGUID();
|
||||
player->SendEquipError(msg, NULL, NULL, roll->itemid);
|
||||
player->SendEquipError(msg, nullptr, nullptr, roll->itemid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1409,7 +1409,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
|||
{
|
||||
uint8 maxresul = 0;
|
||||
uint64 maxguid = 0; // pussywizard: start with 0
|
||||
Player* player = NULL;
|
||||
Player* player = nullptr;
|
||||
RollVote rollvote = NOT_VALID;
|
||||
|
||||
Roll::PlayerVote::iterator itr;
|
||||
|
|
@ -1463,7 +1463,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
|||
{
|
||||
item->is_blocked = false;
|
||||
item->rollWinnerGUID = player->GetGUID();
|
||||
player->SendEquipError(msg, NULL, NULL, roll->itemid);
|
||||
player->SendEquipError(msg, nullptr, nullptr, roll->itemid);
|
||||
}
|
||||
}
|
||||
else if (rollvote == DISENCHANT)
|
||||
|
|
@ -1621,7 +1621,7 @@ void Group::UpdatePlayerOutOfRange(Player* player)
|
|||
player->GetSession()->BuildPartyMemberStatsChangedPacket(player, &data);
|
||||
|
||||
Player* member;
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
member = itr->GetSource();
|
||||
if (member && (!member->IsInMap(player) || !member->IsWithinDist(player, member->GetSightRange(player), false)))
|
||||
|
|
@ -1631,7 +1631,7 @@ void Group::UpdatePlayerOutOfRange(Player* player)
|
|||
|
||||
void Group::BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group, uint64 ignore)
|
||||
{
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->GetSource();
|
||||
if (!player || (ignore != 0 && player->GetGUID() == ignore) || (ignorePlayersInBGRaid && player->GetGroup() != this))
|
||||
|
|
@ -1644,7 +1644,7 @@ void Group::BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int
|
|||
|
||||
void Group::BroadcastReadyCheck(WorldPacket* packet)
|
||||
{
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->GetSource();
|
||||
if (player)
|
||||
|
|
@ -1762,7 +1762,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed)
|
|||
}
|
||||
|
||||
// search next after current
|
||||
Player* pNewLooter = NULL;
|
||||
Player* pNewLooter = nullptr;
|
||||
for (member_citerator itr = guid_itr; itr != m_memberSlots.end(); ++itr)
|
||||
{
|
||||
if (Player* player = ObjectAccessor::FindPlayer(itr->guid))
|
||||
|
|
@ -1832,7 +1832,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
|
|||
|
||||
// check every member of the group to be able to join
|
||||
uint32 memberscount = 0;
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next(), ++memberscount)
|
||||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next(), ++memberscount)
|
||||
{
|
||||
Player* member = itr->GetSource();
|
||||
|
||||
|
|
@ -1912,7 +1912,7 @@ void Group::SetDungeonDifficulty(Difficulty difficulty)
|
|||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->GetSource();
|
||||
player->SetDungeonDifficulty(difficulty);
|
||||
|
|
@ -1933,7 +1933,7 @@ void Group::SetRaidDifficulty(Difficulty difficulty)
|
|||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->GetSource();
|
||||
player->SetRaidDifficulty(difficulty);
|
||||
|
|
@ -2038,7 +2038,7 @@ void Group::BroadcastGroupUpdate(void)
|
|||
void Group::ResetMaxEnchantingLevel()
|
||||
{
|
||||
m_maxEnchantingLevel = 0;
|
||||
Player* pMember = NULL;
|
||||
Player* pMember = nullptr;
|
||||
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
{
|
||||
pMember = ObjectAccessor::FindPlayer(citr->guid);
|
||||
|
|
@ -2094,12 +2094,12 @@ bool Group::isRaidGroup() const
|
|||
|
||||
bool Group::isBGGroup() const
|
||||
{
|
||||
return m_bgGroup != NULL;
|
||||
return m_bgGroup != nullptr;
|
||||
}
|
||||
|
||||
bool Group::isBFGroup() const
|
||||
{
|
||||
return m_bfGroup != NULL;
|
||||
return m_bfGroup != nullptr;
|
||||
}
|
||||
|
||||
bool Group::IsCreated() const
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ class Group
|
|||
void RemoveAllInvites();
|
||||
bool AddLeaderInvite(Player* player);
|
||||
bool AddMember(Player* player);
|
||||
bool RemoveMember(uint64 guid, const RemoveMethod &method = GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker = 0, const char* reason = NULL);
|
||||
bool RemoveMember(uint64 guid, const RemoveMethod &method = GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker = 0, const char* reason = nullptr);
|
||||
void ChangeLeader(uint64 guid);
|
||||
void SetLootMethod(LootMethod method);
|
||||
void SetLooterGuid(uint64 guid);
|
||||
|
|
@ -256,7 +256,7 @@ class Group
|
|||
//void SendInit(WorldSession* session);
|
||||
void SendTargetIconList(WorldSession* session);
|
||||
void SendUpdate();
|
||||
void SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot = NULL);
|
||||
void SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot = nullptr);
|
||||
void UpdatePlayerOutOfRange(Player* player);
|
||||
// ignore: GUID of player that will be ignored
|
||||
void BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group=-1, uint64 ignore=0);
|
||||
|
|
@ -299,11 +299,11 @@ class Group
|
|||
bool IsLfgHeroic() const { return isLFGGroup() && (m_lfgGroupFlags & GROUP_LFG_FLAG_IS_HEROIC); }
|
||||
|
||||
// Difficulty Change
|
||||
uint32 GetDifficultyChangePreventionTime() const { return _difficultyChangePreventionTime > time(NULL) ? _difficultyChangePreventionTime - time(NULL) : 0; }
|
||||
uint32 GetDifficultyChangePreventionTime() const { return _difficultyChangePreventionTime > time(nullptr) ? _difficultyChangePreventionTime - time(nullptr) : 0; }
|
||||
DifficultyPreventionChangeType GetDifficultyChangePreventionReason() const { return _difficultyChangePreventionType; }
|
||||
void SetDifficultyChangePrevention(DifficultyPreventionChangeType type)
|
||||
{
|
||||
_difficultyChangePreventionTime = time(NULL) + MINUTE;
|
||||
_difficultyChangePreventionTime = time(nullptr) + MINUTE;
|
||||
_difficultyChangePreventionType = type;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ Group* GroupMgr::GetGroupByGUID(uint32 groupId) const
|
|||
if (itr != GroupStore.end())
|
||||
return itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void GroupMgr::AddGroup(Group* group)
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ void Guild::EventLogEntry::WritePacket(WorldPacket& data) const
|
|||
if (m_eventType == GUILD_EVENT_LOG_PROMOTE_PLAYER || m_eventType == GUILD_EVENT_LOG_DEMOTE_PLAYER)
|
||||
data << uint8(m_newRank);
|
||||
// Event timestamp
|
||||
data << uint32(::time(NULL) - m_timestamp);
|
||||
data << uint32(::time(nullptr) - m_timestamp);
|
||||
}
|
||||
|
||||
// BankEventLogEntry
|
||||
|
|
@ -243,7 +243,7 @@ void Guild::BankEventLogEntry::WritePacket(WorldPacket& data) const
|
|||
data << uint32(m_itemOrMoney);
|
||||
}
|
||||
|
||||
data << uint32(time(NULL) - m_timestamp);
|
||||
data << uint32(time(nullptr) - m_timestamp);
|
||||
}
|
||||
|
||||
// RankInfo
|
||||
|
|
@ -431,7 +431,7 @@ void Guild::BankTab::Delete(SQLTransaction& trans, bool removeItemsFromDB)
|
|||
if (removeItemsFromDB)
|
||||
pItem->DeleteFromDB(trans);
|
||||
delete pItem;
|
||||
pItem = NULL;
|
||||
pItem = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -708,7 +708,7 @@ void Guild::Member::WritePacket(WorldPacket& data, bool sendOfficerNote) const
|
|||
<< uint32(m_zoneId);
|
||||
|
||||
if (!m_flags)
|
||||
data << float(float(::time(NULL) - m_logoutTime) / DAY);
|
||||
data << float(float(::time(nullptr) - m_logoutTime) / DAY);
|
||||
|
||||
data << m_publicNote;
|
||||
|
||||
|
|
@ -847,16 +847,16 @@ bool Guild::PlayerMoveItemData::InitItem()
|
|||
if (m_pItem->IsNotEmptyBag())
|
||||
{
|
||||
m_pPlayer->SendEquipError(EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS, m_pItem);
|
||||
m_pItem = NULL;
|
||||
m_pItem = nullptr;
|
||||
}
|
||||
// Bound items cannot be put into bank.
|
||||
else if (!m_pItem->CanBeTraded())
|
||||
{
|
||||
m_pPlayer->SendEquipError(EQUIP_ERR_ITEMS_CANT_BE_SWAPPED, m_pItem);
|
||||
m_pItem = NULL;
|
||||
m_pItem = nullptr;
|
||||
}
|
||||
}
|
||||
return (m_pItem != NULL);
|
||||
return (m_pItem != nullptr);
|
||||
}
|
||||
|
||||
void Guild::PlayerMoveItemData::RemoveItem(SQLTransaction& trans, MoveItemData* /*pOther*/, uint32 splitedAmount)
|
||||
|
|
@ -871,7 +871,7 @@ void Guild::PlayerMoveItemData::RemoveItem(SQLTransaction& trans, MoveItemData*
|
|||
{
|
||||
m_pPlayer->MoveItemFromInventory(m_container, m_slotId, true);
|
||||
m_pItem->DeleteFromInventoryDB(trans);
|
||||
m_pItem = NULL;
|
||||
m_pItem = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -900,7 +900,7 @@ inline InventoryResult Guild::PlayerMoveItemData::CanStore(Item* pItem, bool swa
|
|||
bool Guild::BankMoveItemData::InitItem()
|
||||
{
|
||||
m_pItem = m_pGuild->_GetItem(m_container, m_slotId);
|
||||
return (m_pItem != NULL);
|
||||
return (m_pItem != nullptr);
|
||||
}
|
||||
|
||||
bool Guild::BankMoveItemData::HasStoreRights(MoveItemData* pOther) const
|
||||
|
|
@ -938,7 +938,7 @@ void Guild::BankMoveItemData::RemoveItem(SQLTransaction& trans, MoveItemData* pO
|
|||
else
|
||||
{
|
||||
m_pGuild->_RemoveItem(trans, m_container, m_slotId);
|
||||
m_pItem = NULL;
|
||||
m_pItem = nullptr;
|
||||
}
|
||||
// Decrease amount of player's remaining items (if item is moved to different tab or to player)
|
||||
if (!pOther->IsBank() || pOther->GetContainer() != m_container)
|
||||
|
|
@ -948,11 +948,11 @@ void Guild::BankMoveItemData::RemoveItem(SQLTransaction& trans, MoveItemData* pO
|
|||
Item* Guild::BankMoveItemData::StoreItem(SQLTransaction& trans, Item* pItem)
|
||||
{
|
||||
if (!pItem)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
BankTab* pTab = m_pGuild->GetBankTab(m_container);
|
||||
if (!pTab)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
Item* pLastItem = pItem;
|
||||
for (ItemPosCountVec::const_iterator itr = m_vec.begin(); itr != m_vec.end(); )
|
||||
|
|
@ -1013,7 +1013,7 @@ Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab,
|
|||
if (pItem && pTab->SetItem(trans, slotId, pItem))
|
||||
return pItem;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Tries to reserve space for source item.
|
||||
|
|
@ -1053,10 +1053,10 @@ void Guild::BankMoveItemData::CanStoreItemInTab(Item* pItem, uint8 skipSlotId, b
|
|||
|
||||
Item* pItemDest = m_pGuild->_GetItem(m_container, slotId);
|
||||
if (pItemDest == pItem)
|
||||
pItemDest = NULL;
|
||||
pItemDest = nullptr;
|
||||
|
||||
// If merge skip empty, if not merge skip non-empty
|
||||
if ((pItemDest != NULL) != merge)
|
||||
if ((pItemDest != nullptr) != merge)
|
||||
continue;
|
||||
|
||||
_ReserveSpace(slotId, pItem, pItemDest, count);
|
||||
|
|
@ -1084,7 +1084,7 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap)
|
|||
Item* pItemDest = m_pGuild->_GetItem(m_container, m_slotId);
|
||||
// Ignore swapped item (this slot will be empty after move)
|
||||
if ((pItemDest == pItem) || swap)
|
||||
pItemDest = NULL;
|
||||
pItemDest = nullptr;
|
||||
|
||||
if (!_ReserveSpace(m_slotId, pItem, pItemDest, count))
|
||||
return EQUIP_ERR_ITEM_CANT_STACK;
|
||||
|
|
@ -1117,30 +1117,30 @@ Guild::Guild():
|
|||
m_createdDate(0),
|
||||
m_accountsNumber(0),
|
||||
m_bankMoney(0),
|
||||
m_eventLog(NULL)
|
||||
m_eventLog(nullptr)
|
||||
{
|
||||
memset(&m_bankEventLog, 0, (GUILD_BANK_MAX_TABS + 1) * sizeof(LogHolder*));
|
||||
}
|
||||
|
||||
Guild::~Guild()
|
||||
{
|
||||
SQLTransaction temp(NULL);
|
||||
SQLTransaction temp(nullptr);
|
||||
_DeleteBankItems(temp);
|
||||
|
||||
// Cleanup
|
||||
delete m_eventLog;
|
||||
m_eventLog = NULL;
|
||||
m_eventLog = nullptr;
|
||||
|
||||
for (uint8 tabId = 0; tabId <= GUILD_BANK_MAX_TABS; ++tabId)
|
||||
{
|
||||
delete m_bankEventLog[tabId];
|
||||
m_bankEventLog[tabId] = NULL;
|
||||
m_bankEventLog[tabId] = nullptr;
|
||||
}
|
||||
|
||||
for (Members::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
{
|
||||
delete itr->second;
|
||||
itr->second = NULL;
|
||||
itr->second = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2264,7 +2264,7 @@ bool Guild::AddMember(uint64 guid, uint8 rankId)
|
|||
sWorld->UpdateGlobalPlayerGuild(lowguid, m_id);
|
||||
}
|
||||
|
||||
SQLTransaction trans(NULL);
|
||||
SQLTransaction trans(nullptr);
|
||||
member->SaveToDB(trans);
|
||||
|
||||
_UpdateAccountsNumber();
|
||||
|
|
@ -2286,8 +2286,8 @@ void Guild::DeleteMember(uint64 guid, bool isDisbanding, bool isKicked, bool can
|
|||
// or when he is removed from guild by gm command
|
||||
if (m_leaderGuid == guid && !isDisbanding)
|
||||
{
|
||||
Member* oldLeader = NULL;
|
||||
Member* newLeader = NULL;
|
||||
Member* oldLeader = nullptr;
|
||||
Member* newLeader = nullptr;
|
||||
for (Guild::Members::iterator i = m_members.begin(); i != m_members.end(); ++i)
|
||||
{
|
||||
if (i->first == lowguid)
|
||||
|
|
@ -2386,7 +2386,7 @@ void Guild::SetBankTabText(uint8 tabId, std::string const& text)
|
|||
if (BankTab* pTab = GetBankTab(tabId))
|
||||
{
|
||||
pTab->SetText(text);
|
||||
pTab->SendText(this, NULL);
|
||||
pTab->SendText(this, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2487,7 +2487,7 @@ void Guild::_DeleteBankItems(SQLTransaction& trans, bool removeItemsFromDB)
|
|||
{
|
||||
m_bankTabs[tabId]->Delete(trans, removeItemsFromDB);
|
||||
delete m_bankTabs[tabId];
|
||||
m_bankTabs[tabId] = NULL;
|
||||
m_bankTabs[tabId] = nullptr;
|
||||
}
|
||||
m_bankTabs.clear();
|
||||
}
|
||||
|
|
@ -2670,13 +2670,13 @@ inline Item* Guild::_GetItem(uint8 tabId, uint8 slotId) const
|
|||
{
|
||||
if (const BankTab* tab = GetBankTab(tabId))
|
||||
return tab->GetItem(slotId);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
inline void Guild::_RemoveItem(SQLTransaction& trans, uint8 tabId, uint8 slotId)
|
||||
{
|
||||
if (BankTab* pTab = GetBankTab(tabId))
|
||||
pTab->SetItem(trans, slotId, NULL);
|
||||
pTab->SetItem(trans, slotId, nullptr);
|
||||
}
|
||||
|
||||
void Guild::_MoveItems(MoveItemData* pSrc, MoveItemData* pDest, uint32 splitedAmount)
|
||||
|
|
@ -2717,7 +2717,7 @@ void Guild::_MoveItems(MoveItemData* pSrc, MoveItemData* pDest, uint32 splitedAm
|
|||
}
|
||||
else // 6. No split
|
||||
{
|
||||
// 6.1. Try to merge items in destination (pDest->GetItem() == NULL)
|
||||
// 6.1. Try to merge items in destination (pDest->GetItem() == nullptr)
|
||||
if (!_DoItemsMove(pSrc, pDest, false)) // Item could not be merged
|
||||
{
|
||||
// 6.2. Try to swap items
|
||||
|
|
@ -2732,7 +2732,7 @@ void Guild::_MoveItems(MoveItemData* pSrc, MoveItemData* pDest, uint32 splitedAm
|
|||
if (!pDest->HasWithdrawRights(pSrc))
|
||||
return; // Player has no rights to withdraw item from destination (opposite direction)
|
||||
|
||||
// 6.2.3. Swap items (pDest->GetItem() != NULL)
|
||||
// 6.2.3. Swap items (pDest->GetItem() != nullptr)
|
||||
_DoItemsMove(pSrc, pDest, true);
|
||||
}
|
||||
}
|
||||
|
|
@ -2743,7 +2743,7 @@ void Guild::_MoveItems(MoveItemData* pSrc, MoveItemData* pDest, uint32 splitedAm
|
|||
bool Guild::_DoItemsMove(MoveItemData* pSrc, MoveItemData* pDest, bool sendError, uint32 splitedAmount)
|
||||
{
|
||||
Item* pDestItem = pDest->GetItem();
|
||||
bool swap = (pDestItem != NULL);
|
||||
bool swap = (pDestItem != nullptr);
|
||||
|
||||
Item* pSrcItem = pSrc->GetItem(splitedAmount);
|
||||
// 1. Can store source item in destination
|
||||
|
|
@ -2832,7 +2832,7 @@ void Guild::_SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) cons
|
|||
|
||||
void Guild::_SendBankContentUpdate(uint8 tabId, SlotIds slots) const
|
||||
{
|
||||
_SendBankList(NULL, tabId, false, &slots);
|
||||
_SendBankList(nullptr, tabId, false, &slots);
|
||||
}
|
||||
|
||||
void Guild::_BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* param1, const char* param2, const char* param3) const
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ public: // pussywizard: public class Member
|
|||
m_level(0),
|
||||
m_class(0),
|
||||
m_flags(GUILDMEMBER_STATUS_NONE),
|
||||
m_logoutTime(::time(NULL)),
|
||||
m_logoutTime(::time(nullptr)),
|
||||
m_accountId(0),
|
||||
m_rankId(rankId)
|
||||
{
|
||||
|
|
@ -320,7 +320,7 @@ public: // pussywizard: public class Member
|
|||
|
||||
void ChangeRank(uint8 newRank);
|
||||
|
||||
inline void UpdateLogoutTime() { m_logoutTime = ::time(NULL); }
|
||||
inline void UpdateLogoutTime() { m_logoutTime = ::time(nullptr); }
|
||||
inline bool IsRank(uint8 rankId) const { return m_rankId == rankId; }
|
||||
inline bool IsRankNotLower(uint8 rankId) const { return m_rankId <= rankId; }
|
||||
inline bool IsSamePlayer(uint64 guid) const { return m_guid == guid; }
|
||||
|
|
@ -354,12 +354,12 @@ public: // pussywizard: public class Member
|
|||
inline const Member* GetMember(uint64 guid) const
|
||||
{
|
||||
Members::const_iterator itr = m_members.find(GUID_LOPART(guid));
|
||||
return itr != m_members.end() ? itr->second : NULL;
|
||||
return itr != m_members.end() ? itr->second : nullptr;
|
||||
}
|
||||
inline Member* GetMember(uint64 guid)
|
||||
{
|
||||
Members::iterator itr = m_members.find(GUID_LOPART(guid));
|
||||
return itr != m_members.end() ? itr->second : NULL;
|
||||
return itr != m_members.end() ? itr->second : nullptr;
|
||||
}
|
||||
inline Member* GetMember(std::string const& name)
|
||||
{
|
||||
|
|
@ -367,7 +367,7 @@ public: // pussywizard: public class Member
|
|||
if (itr->second->GetName() == name)
|
||||
return itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
@ -375,7 +375,7 @@ private:
|
|||
class LogEntry
|
||||
{
|
||||
public:
|
||||
LogEntry(uint32 guildId, uint32 guid) : m_guildId(guildId), m_guid(guid), m_timestamp(::time(NULL)) { }
|
||||
LogEntry(uint32 guildId, uint32 guid) : m_guildId(guildId), m_guid(guid), m_timestamp(::time(nullptr)) { }
|
||||
LogEntry(uint32 guildId, uint32 guid, time_t timestamp) : m_guildId(guildId), m_guid(guid), m_timestamp(timestamp) { }
|
||||
virtual ~LogEntry() { }
|
||||
|
||||
|
|
@ -548,7 +548,7 @@ private:
|
|||
void SetText(std::string const& text);
|
||||
void SendText(const Guild* guild, WorldSession* session) const;
|
||||
|
||||
inline Item* GetItem(uint8 slotId) const { return slotId < GUILD_BANK_MAX_SLOTS ? m_items[slotId] : NULL; }
|
||||
inline Item* GetItem(uint8 slotId) const { return slotId < GUILD_BANK_MAX_SLOTS ? m_items[slotId] : nullptr; }
|
||||
bool SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem);
|
||||
|
||||
private:
|
||||
|
|
@ -566,7 +566,7 @@ private:
|
|||
{
|
||||
public:
|
||||
MoveItemData(Guild* guild, Player* player, uint8 container, uint8 slotId) : m_pGuild(guild), m_pPlayer(player),
|
||||
m_container(container), m_slotId(slotId), m_pItem(NULL), m_pClonedItem(NULL) { }
|
||||
m_container(container), m_slotId(slotId), m_pItem(nullptr), m_pClonedItem(nullptr) { }
|
||||
virtual ~MoveItemData() { }
|
||||
|
||||
virtual bool IsBank() const = 0;
|
||||
|
|
@ -726,7 +726,7 @@ public:
|
|||
void MassInviteToEvent(WorldSession* session, uint32 minLevel, uint32 maxLevel, uint32 minRank);
|
||||
|
||||
template<class Do>
|
||||
void BroadcastWorker(Do& _do, Player* except = NULL)
|
||||
void BroadcastWorker(Do& _do, Player* except = nullptr)
|
||||
{
|
||||
for (Members::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
if (Player* player = itr->second->FindPlayer())
|
||||
|
|
@ -776,8 +776,8 @@ protected:
|
|||
|
||||
private:
|
||||
inline uint8 _GetRanksSize() const { return uint8(m_ranks.size()); }
|
||||
inline const RankInfo* GetRankInfo(uint8 rankId) const { return rankId < _GetRanksSize() ? &m_ranks[rankId] : NULL; }
|
||||
inline RankInfo* GetRankInfo(uint8 rankId) { return rankId < _GetRanksSize() ? &m_ranks[rankId] : NULL; }
|
||||
inline const RankInfo* GetRankInfo(uint8 rankId) const { return rankId < _GetRanksSize() ? &m_ranks[rankId] : nullptr; }
|
||||
inline RankInfo* GetRankInfo(uint8 rankId) { return rankId < _GetRanksSize() ? &m_ranks[rankId] : nullptr; }
|
||||
inline bool _HasRankRight(Player* player, uint32 right) const
|
||||
{
|
||||
if (player)
|
||||
|
|
@ -789,8 +789,8 @@ private:
|
|||
inline uint8 _GetLowestRankId() const { return uint8(m_ranks.size() - 1); }
|
||||
|
||||
inline uint8 _GetPurchasedTabsSize() const { return uint8(m_bankTabs.size()); }
|
||||
inline BankTab* GetBankTab(uint8 tabId) { return tabId < m_bankTabs.size() ? m_bankTabs[tabId] : NULL; }
|
||||
inline const BankTab* GetBankTab(uint8 tabId) const { return tabId < m_bankTabs.size() ? m_bankTabs[tabId] : NULL; }
|
||||
inline BankTab* GetBankTab(uint8 tabId) { return tabId < m_bankTabs.size() ? m_bankTabs[tabId] : nullptr; }
|
||||
inline const BankTab* GetBankTab(uint8 tabId) const { return tabId < m_bankTabs.size() ? m_bankTabs[tabId] : nullptr; }
|
||||
|
||||
inline void _DeleteMemberFromDB(uint32 lowguid) const
|
||||
{
|
||||
|
|
@ -839,8 +839,8 @@ private:
|
|||
void _SendBankMoneyUpdate(WorldSession* session) const;
|
||||
void _SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) const;
|
||||
void _SendBankContentUpdate(uint8 tabId, SlotIds slots) const;
|
||||
void _SendBankList(WorldSession* session = NULL, uint8 tabId = 0, bool sendFullSlots = false, SlotIds *slots = NULL) const;
|
||||
void _SendBankList(WorldSession* session = NULL, uint8 tabId = 0, bool sendFullSlots = false, SlotIds *slots = nullptr) const;
|
||||
|
||||
void _BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* param1 = NULL, const char* param2 = NULL, const char* param3 = NULL) const;
|
||||
void _BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* param1 = NULL, const char* param2 = NULL, const char* param3 = nullptr) const;
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ Guild* GuildMgr::GetGuildById(uint32 guildId) const
|
|||
if (itr != GuildStore.end())
|
||||
return itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Guild* GuildMgr::GetGuildByName(const std::string& guildName) const
|
||||
|
|
@ -63,7 +63,7 @@ Guild* GuildMgr::GetGuildByName(const std::string& guildName) const
|
|||
if (search == gname)
|
||||
return itr->second;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::string GuildMgr::GetGuildNameById(uint32 guildId) const
|
||||
|
|
@ -80,7 +80,7 @@ Guild* GuildMgr::GetGuildByLeader(uint64 guid) const
|
|||
if (itr->second->GetLeaderGUID() == guid)
|
||||
return itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void GuildMgr::LoadGuilds()
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue