mirror of
https://github.com/mangosfour/server.git
synced 2025-12-26 07:37:02 +00:00
Fixed some additional found nullptrs
This commit is contained in:
parent
2e925eddd5
commit
2d960a4b1c
36 changed files with 303 additions and 303 deletions
|
|
@ -1451,7 +1451,7 @@ bool WorldObject::isInBack(WorldObject const* target, float distance, float arc)
|
|||
return IsWithinDist(target, distance) && !HasInArc(2 * M_PI_F - arc, target);
|
||||
}
|
||||
|
||||
void WorldObject::GetRandomPoint(float x, float y, float z, float distance, float& rand_x, float& rand_y, float& rand_z, float minDist /*=0.0f*/, float const* ori /*=nullptr*/) const
|
||||
void WorldObject::GetRandomPoint(float x, float y, float z, float distance, float& rand_x, float& rand_y, float& rand_z, float minDist /*=0.0f*/, float const* ori /*=NULL*/) const
|
||||
{
|
||||
if (distance == 0)
|
||||
{
|
||||
|
|
@ -1490,7 +1490,7 @@ void WorldObject::UpdateGroundPositionZ(float x, float y, float& z) const
|
|||
{ z = new_z + 0.05f; } // just to be sure that we are not a few pixel under the surface
|
||||
}
|
||||
|
||||
void WorldObject::UpdateAllowedPositionZ(float x, float y, float& z, Map* atMap /*=nullptr*/) const
|
||||
void WorldObject::UpdateAllowedPositionZ(float x, float y, float& z, Map* atMap /*=NULL*/) const
|
||||
{
|
||||
if (!atMap)
|
||||
atMap = GetMap();
|
||||
|
|
@ -1761,7 +1761,7 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa
|
|||
if (!cinfo)
|
||||
{
|
||||
sLog.outErrorDb("WorldObject::SummonCreature: Creature (Entry: %u) not existed for summoner: %s. ", id, GetGuidStr().c_str());
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TemporarySummon* pCreature = new TemporarySummon(GetObjectGuid());
|
||||
|
|
@ -1778,7 +1778,7 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa
|
|||
if (!pCreature->Create(GetMap()->GenerateLocalLowGuid(cinfo->GetHighGuid()), pos, cinfo, team))
|
||||
{
|
||||
delete pCreature;
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pCreature->SetRespawnCoord(pos);
|
||||
|
|
|
|||
|
|
@ -545,9 +545,9 @@ class WorldObject : public Object
|
|||
|
||||
bool IsPositionValid() const;
|
||||
void UpdateGroundPositionZ(float x, float y, float& z) const;
|
||||
void UpdateAllowedPositionZ(float x, float y, float& z, Map* atMap = nullptr) const;
|
||||
void UpdateAllowedPositionZ(float x, float y, float& z, Map* atMap = NULL) const;
|
||||
|
||||
void GetRandomPoint(float x, float y, float z, float distance, float& rand_x, float& rand_y, float& rand_z, float minDist = 0.0f, float const* ori = nullptr) const;
|
||||
void GetRandomPoint(float x, float y, float z, float distance, float& rand_x, float& rand_y, float& rand_z, float minDist = 0.0f, float const* ori = NULL) const;
|
||||
|
||||
uint32 GetMapId() const { return m_mapId; }
|
||||
uint32 GetInstanceId() const { return m_InstanceId; }
|
||||
|
|
|
|||
|
|
@ -9544,7 +9544,7 @@ void ObjectMgr::LoadActiveEntities(Map* _map)
|
|||
{
|
||||
_map = sMapMgr.FindMap(continents[i]);
|
||||
if (!_map)
|
||||
_map = sMapMgr.CreateMap(continents[i], nullptr);
|
||||
_map = sMapMgr.CreateMap(continents[i], NULL);
|
||||
|
||||
if (_map)
|
||||
LoadActiveEntities(_map);
|
||||
|
|
|
|||
|
|
@ -832,7 +832,7 @@ class ObjectMgr
|
|||
void LoadTrainerTemplates();
|
||||
void LoadTrainers() { LoadTrainers("npc_trainer", false); }
|
||||
|
||||
/// @param _map Map* of the map for which to load active entities. If nullptr active entities on continents are loaded
|
||||
/// @param _map Map* of the map for which to load active entities. If NULL active entities on continents are loaded
|
||||
void LoadActiveEntities(Map* _map);
|
||||
|
||||
void LoadVehicleAccessory();
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ void PetAI::UpdateAI(const uint32 diff)
|
|||
return;
|
||||
|
||||
Unit* owner = m_creature->GetCharmerOrOwner();
|
||||
Unit* victim = nullptr;
|
||||
Unit* victim = NULL;
|
||||
|
||||
if (!((Pet*)m_creature)->isControlled())
|
||||
m_creature->SelectHostileTarget();
|
||||
|
|
|
|||
|
|
@ -4140,14 +4140,14 @@ void Player::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
|
|||
{
|
||||
for (int i = 0; i < EQUIPMENT_SLOT_END; ++i)
|
||||
{
|
||||
if (m_items[i] == nullptr)
|
||||
if (m_items[i] == NULL)
|
||||
continue;
|
||||
|
||||
m_items[i]->BuildCreateUpdateBlockForPlayer(data, target);
|
||||
}
|
||||
for (int i = INVENTORY_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i)
|
||||
{
|
||||
if (m_items[i] == nullptr)
|
||||
if (m_items[i] == NULL)
|
||||
continue;
|
||||
|
||||
m_items[i]->BuildCreateUpdateBlockForPlayer(data, target);
|
||||
|
|
@ -6321,7 +6321,7 @@ void Player::CheckAreaExploreAndOutdoor()
|
|||
|
||||
if (!shapeShift || (shapeShift->Stances || shapeShift->StancesNot) && !IsNeedCastSpellAtFormApply(spellInfo, GetShapeshiftForm()))
|
||||
continue;
|
||||
CastSpell(this, itr->first, true, nullptr);
|
||||
CastSpell(this, itr->first, true, NULL);
|
||||
}
|
||||
}
|
||||
else if (sWorld.getConfig(CONFIG_BOOL_VMAP_INDOOR_CHECK) && !isGameMaster())
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ SpellSpecific GetSpellSpecific(uint32 spellId);
|
|||
|
||||
// Different spell properties
|
||||
inline float GetSpellRadius(SpellRadiusEntry const* radius) { return (radius ? radius->Radius : 0); }
|
||||
uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell = nullptr);
|
||||
uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell = NULL);
|
||||
uint32 GetSpellCastTimeForBonus(SpellEntry const* spellProto, DamageEffectType damagetype);
|
||||
float CalculateDefaultCoefficient(SpellEntry const* spellProto, DamageEffectType const damagetype);
|
||||
inline float GetSpellMinRange(SpellRangeEntry const* range, bool friendly = false)
|
||||
|
|
|
|||
|
|
@ -981,8 +981,8 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa
|
|||
{
|
||||
SpellEntry const* shareSpell = (*itr)->GetSpellProto();
|
||||
uint32 shareDamage = uint32(damage*(*itr)->GetModifier()->m_amount / 100.0f);
|
||||
DealDamageMods(shareTarget, shareDamage, nullptr);
|
||||
DealDamage(shareTarget, shareDamage, nullptr, damagetype, GetSpellSchoolMask(shareSpell), shareSpell, false);
|
||||
DealDamageMods(shareTarget, shareDamage, NULL);
|
||||
DealDamage(shareTarget, shareDamage, NULL, damagetype, GetSpellSchoolMask(shareSpell), shareSpell, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -12307,13 +12307,13 @@ Unit* Unit::TakePossessOf(SpellEntry const* spellEntry, SummonPropertiesEntry co
|
|||
if (!cinfo)
|
||||
{
|
||||
sLog.outErrorDb("WorldObject::SummonCreature: Creature (Entry: %u) not existed for summoner: %s. ", creatureEntry, GetGuidStr().c_str());
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (GetCharm())
|
||||
{
|
||||
sLog.outError("Unit::TakePossessOf> There is already a charmed creature for %s its : %s. ", GetGuidStr().c_str(), GetCharm()->GetGuidStr().c_str());
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TemporarySummon* pCreature = new TemporarySummon(GetObjectGuid());
|
||||
|
|
@ -12326,10 +12326,10 @@ Unit* Unit::TakePossessOf(SpellEntry const* spellEntry, SummonPropertiesEntry co
|
|||
if (!pCreature->Create(GetMap()->GenerateLocalLowGuid(cinfo->GetHighGuid()), pos, cinfo))
|
||||
{
|
||||
delete pCreature;
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Player* player = GetTypeId() == TYPEID_PLAYER ? static_cast<Player*>(this): nullptr;
|
||||
Player* player = GetTypeId() == TYPEID_PLAYER ? static_cast<Player*>(this): NULL;
|
||||
|
||||
pCreature->setFaction(getFaction()); // set same faction than player
|
||||
pCreature->SetRespawnCoord(pos); // set spawn coord
|
||||
|
|
@ -12383,7 +12383,7 @@ Unit* Unit::TakePossessOf(SpellEntry const* spellEntry, SummonPropertiesEntry co
|
|||
|
||||
bool Unit::TakePossessOf(Unit* possessed)
|
||||
{
|
||||
Player* player = nullptr;
|
||||
Player* player = NULL;
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
player = static_cast<Player *>(this);
|
||||
|
||||
|
|
@ -12394,7 +12394,7 @@ bool Unit::TakePossessOf(Unit* possessed)
|
|||
|
||||
SetCharm(possessed);
|
||||
|
||||
Creature* possessedCreature = nullptr;
|
||||
Creature* possessedCreature = NULL;
|
||||
if (possessed->GetTypeId() == TYPEID_UNIT)
|
||||
possessedCreature = static_cast<Creature *>(possessed);
|
||||
|
||||
|
|
@ -12438,7 +12438,7 @@ bool Unit::TakePossessOf(Unit* possessed)
|
|||
|
||||
void Unit::ResetControlState(bool attackCharmer /*= true*/)
|
||||
{
|
||||
Player* player = nullptr;
|
||||
Player* player = NULL;
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
player = static_cast<Player *>(this);
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class ThreatRefStatusChangeEvent : public UnitBaseEvent
|
|||
ThreatManager* iThreatManager;
|
||||
public:
|
||||
ThreatRefStatusChangeEvent(uint32 pType) : UnitBaseEvent(pType), iThreatManager(NULL)
|
||||
{ iHostileReference = nullptr; }
|
||||
{ iHostileReference = NULL; }
|
||||
|
||||
ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference) : UnitBaseEvent(pType), iThreatManager(NULL)
|
||||
{ iHostileReference = pHostileReference; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue