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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user