mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-15 08:16:08 +00:00
refactor(Core): NULL -> nullptr (#3275)
* NULL to nullptr * NULL to nullptr * NULL to nullptr * NULL to nullptr * NULL to nullptr Co-authored-by: Francesco Borzì <borzifrancesco@gmail.com> Co-authored-by: Stefano Borzì <stefanoborzi32@gmail.com>
This commit is contained in:
@@ -108,7 +108,7 @@ class go_witherbark_totem_bundle : public GameObjectScript
|
||||
_timer += diff;
|
||||
if (_timer > 5000)
|
||||
{
|
||||
go->CastSpell(NULL, 9056);
|
||||
go->CastSpell(nullptr, 9056);
|
||||
go->DestroyForNearbyPlayers();
|
||||
_timer = 0;
|
||||
}
|
||||
@@ -931,7 +931,7 @@ class go_inconspicuous_landmark : public GameObjectScript
|
||||
public:
|
||||
go_inconspicuous_landmark() : GameObjectScript("go_inconspicuous_landmark")
|
||||
{
|
||||
_lastUsedTime = time(NULL);
|
||||
_lastUsedTime = time(nullptr);
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* /*go*/) override
|
||||
@@ -939,10 +939,10 @@ class go_inconspicuous_landmark : public GameObjectScript
|
||||
if (player->HasItemCount(ITEM_CUERGOS_KEY))
|
||||
return true;
|
||||
|
||||
if (_lastUsedTime > time(NULL))
|
||||
if (_lastUsedTime > time(nullptr))
|
||||
return true;
|
||||
|
||||
_lastUsedTime = time(NULL) + MINUTE;
|
||||
_lastUsedTime = time(nullptr) + MINUTE;
|
||||
player->CastSpell(player, SPELL_SUMMON_PIRATES_TREASURE_AND_TRIGGER_MOB, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
return false;
|
||||
|
||||
// error
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, nullptr);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
targets.GetUnitTarget()->GetEntry() == 20748 && !targets.GetUnitTarget()->HasAura(32578))
|
||||
return false;
|
||||
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, nullptr);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -127,7 +127,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;
|
||||
}
|
||||
}
|
||||
@@ -196,7 +196,7 @@ public:
|
||||
|
||||
if (!player->GetTransport() || player->GetAreaId() != AREA_ID_SHATTERED_STRAITS)
|
||||
{
|
||||
player->SendEquipError(EQUIP_ERR_NONE, item, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_NONE, item, nullptr);
|
||||
|
||||
if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB))
|
||||
Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_HERE);
|
||||
@@ -226,10 +226,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_CANT_DO_RIGHT_NOW, item, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, nullptr);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
if (me->isAttackReady() && !me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
bool Healing = false;
|
||||
SpellInfo const* info = NULL;
|
||||
SpellInfo const* info = nullptr;
|
||||
|
||||
//Select a healing spell if less than 30% hp
|
||||
if (HealthBelowPct(30))
|
||||
@@ -115,7 +115,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 (HealthBelowPct(30) && rand() % 3 == 0)
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
{
|
||||
trigger_periodicAI(Creature* creature) : NullCreatureAI(creature)
|
||||
{
|
||||
spell = me->m_spells[0] ? sSpellMgr->GetSpellInfo(me->m_spells[0]) : NULL;
|
||||
spell = me->m_spells[0] ? sSpellMgr->GetSpellInfo(me->m_spells[0]) : nullptr;
|
||||
interval = me->GetAttackTime(BASE_ATTACK);
|
||||
timer = interval;
|
||||
}
|
||||
|
||||
@@ -268,7 +268,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);
|
||||
@@ -416,7 +416,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_CANT_DO_RIGHT_NOW, NULL, NULL);
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, NULL, nullptr);
|
||||
CloseGossipMenuFor(player);
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ public:
|
||||
{
|
||||
case EVENT_CLEARWATER_ANNOUNCE:
|
||||
{
|
||||
time_t curtime = time(NULL);
|
||||
time_t curtime = time(nullptr);
|
||||
tm strdate;
|
||||
ACE_OS::localtime_r(&curtime, &strdate);
|
||||
|
||||
@@ -253,7 +253,7 @@ public:
|
||||
{
|
||||
case EVENT_RIGGLE_ANNOUNCE:
|
||||
{
|
||||
time_t curtime = time(NULL);
|
||||
time_t curtime = time(nullptr);
|
||||
tm strdate;
|
||||
ACE_OS::localtime_r(&curtime, &strdate);
|
||||
if (!startWarning && strdate.tm_hour == 14 && strdate.tm_min == 0)
|
||||
@@ -495,7 +495,7 @@ public:
|
||||
{
|
||||
npc_air_force_botsAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
SpawnAssoc = NULL;
|
||||
SpawnAssoc = nullptr;
|
||||
SpawnedGUID = 0;
|
||||
|
||||
// find the correct spawnhandling
|
||||
@@ -519,7 +519,7 @@ public:
|
||||
if (!spawnedTemplate)
|
||||
{
|
||||
sLog->outErrorDb("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;
|
||||
}
|
||||
}
|
||||
@@ -539,7 +539,7 @@ public:
|
||||
else
|
||||
{
|
||||
sLog->outErrorDb("TCSR: npc_air_force_bots: wasn't able to spawn Creature %u", SpawnAssoc->spawnedCreatureEntry);
|
||||
SpawnAssoc = NULL;
|
||||
SpawnAssoc = nullptr;
|
||||
}
|
||||
|
||||
return summoned;
|
||||
@@ -552,7 +552,7 @@ public:
|
||||
if (creature && creature->IsAlive())
|
||||
return creature;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
@@ -1093,7 +1093,7 @@ public:
|
||||
void Reset()
|
||||
{
|
||||
DoctorGUID = 0;
|
||||
Coord = NULL;
|
||||
Coord = nullptr;
|
||||
|
||||
//no select
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
@@ -2164,7 +2164,7 @@ public:
|
||||
|
||||
GameObject* FindNearestLauncher()
|
||||
{
|
||||
GameObject* launcher = NULL;
|
||||
GameObject* launcher = nullptr;
|
||||
|
||||
if (isCluster())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user