diff options
| author | Shauren <shauren.trinity@gmail.com> | 2020-08-14 17:06:03 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2020-08-14 17:06:03 +0200 |
| commit | 1c52d5fff738aa01bd27fd117076ac33515acef5 (patch) | |
| tree | ff7d2113e023a0fd47fbdde8ea94c0fe4bb9a804 /src/server/scripts/World | |
| parent | 02fd3a1f15840203d8515dae12920d9b66655076 (diff) | |
Core/Misc: Replace NULL with nullptr
Diffstat (limited to 'src/server/scripts/World')
| -rw-r--r-- | src/server/scripts/World/boss_emerald_dragons.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/World/guards.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/World/item_scripts.cpp | 18 | ||||
| -rw-r--r-- | src/server/scripts/World/mob_generic_creature.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/World/npc_professions.cpp | 4 | ||||
| -rw-r--r-- | src/server/scripts/World/npcs_special.cpp | 20 |
6 files changed, 26 insertions, 26 deletions
diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index 887ac065b8e..698554344a1 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -396,7 +396,7 @@ class boss_lethon : public CreatureScript switch (eventId) { case EVENT_SHADOW_BOLT_WHIRL: - me->CastSpell((Unit*)NULL, SPELL_SHADOW_BOLT_WHIRL, false); + me->CastSpell(nullptr, SPELL_SHADOW_BOLT_WHIRL, false); events.ScheduleEvent(EVENT_SHADOW_BOLT_WHIRL, urand(15000, 30000)); break; default: @@ -436,7 +436,7 @@ class npc_spirit_shade : public CreatureScript { if (moveType == FOLLOW_MOTION_TYPE && data == _summonerGuid.GetCounter()) { - me->CastSpell((Unit*)NULL, SPELL_DARK_OFFERING, false); + me->CastSpell(nullptr, SPELL_DARK_OFFERING, false); me->DespawnOrUnsummon(1000); } } diff --git a/src/server/scripts/World/guards.cpp b/src/server/scripts/World/guards.cpp index be2eae2e239..d060aacd786 100644 --- a/src/server/scripts/World/guards.cpp +++ b/src/server/scripts/World/guards.cpp @@ -121,7 +121,7 @@ public: if (me->IsWithinMeleeRange(me->GetVictim())) { bool healing = false; - SpellInfo const* info = NULL; + SpellInfo const* info = nullptr; //Select a healing spell if less than 30% hp if (me->HealthBelowPct(30)) @@ -157,7 +157,7 @@ public: if (!me->IsNonMeleeSpellCast(false)) { bool healing = false; - SpellInfo const* info = NULL; + SpellInfo const* info = nullptr; //Select a healing spell if less than 30% hp ONLY 33% of the time if (me->HealthBelowPct(30) && 33 > urand(0, 99)) diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index 7e11fda4382..dbe38683c3e 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -80,7 +80,7 @@ public: return false; // error - player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL); + player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, nullptr); return true; } }; @@ -123,7 +123,7 @@ public: targets.GetUnitTarget()->GetEntry() == 20748 && !targets.GetUnitTarget()->HasAura(32578)) return false; - player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL); + player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, nullptr); return true; } }; @@ -143,7 +143,7 @@ public: return false; else { - player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, nullptr); return true; } } @@ -229,7 +229,7 @@ public: bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const& /*targets*/, ObjectGuid /*castId*/) override { - GameObject* go = NULL; + GameObject* go = nullptr; for (uint8 i = 0; i < CaribouTrapsNum; ++i) { go = player->FindNearestGameObject(CaribouTraps[i], 5.0f); @@ -345,7 +345,7 @@ public: if (!pMammoth) return false; - GameObject* pTrap = NULL; + GameObject* pTrap = nullptr; for (uint8 i = 0; i < MammothTrapsNum; ++i) { pTrap = player->FindNearestGameObject(MammothTraps[i], 11.0f); @@ -381,9 +381,9 @@ public: pLeviroth->AI()->AttackStart(player); return false; } else - player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, nullptr); } else - player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL); + player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, nullptr); return true; } }; @@ -406,10 +406,10 @@ public: if (player->FindNearestCreature(NPC_VANIRAS_SENTRY_TOTEM, 10.0f)) return false; else - player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL); + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, nullptr); } else - player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, NULL); + player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, item, nullptr); return true; } }; diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp index bc313e70eda..840161f8f9a 100644 --- a/src/server/scripts/World/mob_generic_creature.cpp +++ b/src/server/scripts/World/mob_generic_creature.cpp @@ -30,7 +30,7 @@ public: { trigger_periodicAI(Creature* creature) : NullCreatureAI(creature) { - spell = me->m_spells[0] ? sSpellMgr->GetSpellInfo(me->m_spells[0], me->GetMap()->GetDifficultyID()) : NULL; + spell = me->m_spells[0] ? sSpellMgr->GetSpellInfo(me->m_spells[0], me->GetMap()->GetDifficultyID()) : nullptr; interval = me->GetBaseAttackTime(BASE_ATTACK); timer = interval; } diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index 1fd6ce702a9..c7635efcef3 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -295,7 +295,7 @@ bool EquippedOk(Player* player, uint32 spellId) if (!reqSpell) continue; - Item* item = NULL; + Item* item = nullptr; for (uint8 j = EQUIPMENT_SLOT_START; j < EQUIPMENT_SLOT_END; ++j) { item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, j); @@ -419,7 +419,7 @@ void ProcessUnlearnAction(Player* player, Creature* creature, uint32 spellId, ui player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, creature, 0, 0); } else - player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, NULL, NULL); + player->SendEquipError(EQUIP_ERR_CLIENT_LOCKED_OUT, nullptr, nullptr); CloseGossipMenuFor(player); } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 3c98e5ba766..b6a003f3a80 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -106,7 +106,7 @@ public: { npc_air_force_botsAI(Creature* creature) : ScriptedAI(creature) { - SpawnAssoc = NULL; + SpawnAssoc = nullptr; SpawnedGUID.Clear(); // find the correct spawnhandling @@ -130,7 +130,7 @@ public: if (!spawnedTemplate) { TC_LOG_ERROR("sql.sql", "TCSR: Creature template entry %u does not exist in DB, which is required by npc_air_force_bots", SpawnAssoc->spawnedCreatureEntry); - SpawnAssoc = NULL; + SpawnAssoc = nullptr; return; } } @@ -150,7 +150,7 @@ public: else { TC_LOG_ERROR("sql.sql", "TCSR: npc_air_force_bots: wasn't able to spawn Creature %u", SpawnAssoc->spawnedCreatureEntry); - SpawnAssoc = NULL; + SpawnAssoc = nullptr; } return summoned; @@ -163,7 +163,7 @@ public: if (creature && creature->IsAlive()) return creature; - return NULL; + return nullptr; } void MoveInLineOfSight(Unit* who) override @@ -179,7 +179,7 @@ public: if (!playerTarget) return; - Creature* lastSpawnedGuard = SpawnedGUID.IsEmpty() ? NULL : GetSummonedGuard(); + Creature* lastSpawnedGuard = SpawnedGUID.IsEmpty() ? nullptr : GetSummonedGuard(); // prevent calling Unit::GetUnit at next MoveInLineOfSight call - speedup if (!lastSpawnedGuard) @@ -842,7 +842,7 @@ public: void Initialize() { DoctorGUID.Clear(); - Coord = NULL; + Coord = nullptr; } ObjectGuid DoctorGUID; @@ -1598,7 +1598,7 @@ enum TournamentPennantSpells if (apply) { _pennantSpellId = GetPennantSpellId(player); - player->CastSpell((Unit*)nullptr, _pennantSpellId, true); + player->CastSpell(nullptr, _pennantSpellId, true); } else player->RemoveAurasDueToSpell(_pennantSpellId); @@ -1806,7 +1806,7 @@ public: void DamageTaken(Unit* doneBy, uint32& damage) override { AddThreat(doneBy, float(damage)); // just to create threat reference - _damageTimes[doneBy->GetGUID()] = time(NULL); + _damageTimes[doneBy->GetGUID()] = time(nullptr); damage = 0; } @@ -1826,7 +1826,7 @@ public: { case EVENT_TD_CHECK_COMBAT: { - time_t now = time(NULL); + time_t now = time(nullptr); for (std::unordered_map<ObjectGuid, time_t>::iterator itr = _damageTimes.begin(); itr != _damageTimes.end();) { // If unit has not dealt damage to training dummy for 5 seconds, remove him from combat @@ -2140,7 +2140,7 @@ public: GameObject* FindNearestLauncher() { - GameObject* launcher = NULL; + GameObject* launcher = nullptr; if (isCluster()) { |
