Creature/CreatureAI:
- Default range for DoZoneInCombat: 50.0f -> 250.0f. - Add optional second arg to SummonList::DoZoneInCombat to specify range. - Also a bunch of random NULL -> nullptr cleanup.
This commit is contained in:
1 parent
d69137b6c7
commit
dbd1d58f9d
5 files changed
+34
-34
No files matched your search
@@ -34,7 +34,7 @@
|
||||
#include "Transport.h"
|
||||
|
||||
GameObject::GameObject() : WorldObject(false), MapObject(),
|
||||
m_model(NULL), m_goValue(), m_AI(NULL)
|
||||
m_model(nullptr), m_goValue(), m_AI(nullptr)
|
||||
{
|
||||
m_objectType |= TYPEMASK_GAMEOBJECT;
|
||||
m_objectTypeId = TYPEID_GAMEOBJECT;
|
||||
@@ -49,8 +49,8 @@ GameObject::GameObject() : WorldObject(false), MapObject(),
|
||||
m_usetimes = 0;
|
||||
m_spellId = 0;
|
||||
m_cooldownTime = 0;
|
||||
m_goInfo = NULL;
|
||||
m_goData = NULL;
|
||||
m_goInfo = nullptr;
|
||||
m_goData = nullptr;
|
||||
|
||||
m_spawnId = 0;
|
||||
m_rotation = 0;
|
||||
@@ -520,7 +520,7 @@ void GameObject::Update(uint32 diff)
|
||||
radius = goInfo->trap.diameter / 2.f;
|
||||
|
||||
// Pointer to appropriate target if found any
|
||||
Unit* target = NULL;
|
||||
Unit* target = nullptr;
|
||||
|
||||
/// @todo this hack with search required until GO casting not implemented
|
||||
if (Unit* owner = GetOwner())
|
||||
@@ -535,7 +535,7 @@ void GameObject::Update(uint32 diff)
|
||||
else
|
||||
{
|
||||
// Environmental trap: Any player
|
||||
Player* player = NULL;
|
||||
Player* player = nullptr;
|
||||
Trinity::AnyPlayerInObjectRangeCheck checker(this, radius);
|
||||
Trinity::PlayerSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(this, player, checker);
|
||||
VisitNearbyWorldObject(radius, searcher);
|
||||
@@ -595,8 +595,8 @@ void GameObject::Update(uint32 diff)
|
||||
GameObjectTemplate const* goInfo = GetGOInfo();
|
||||
if (goInfo->trap.type == 2 && goInfo->trap.spellId)
|
||||
{
|
||||
/// @todo NULL target won't work for target type 1
|
||||
CastSpell(NULL, goInfo->trap.spellId);
|
||||
/// @todo nullptr target won't work for target type 1
|
||||
CastSpell(nullptr, goInfo->trap.spellId);
|
||||
SetLootState(GO_JUST_DEACTIVATED);
|
||||
}
|
||||
else if (Unit* target = ObjectAccessor::GetUnit(*this, m_lootStateUnitGUID))
|
||||
@@ -1126,7 +1126,7 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target)
|
||||
float range = float(target->GetSpellMaxRangeForTarget(GetOwner(), trapSpell));
|
||||
|
||||
// search nearest linked GO
|
||||
GameObject* trapGO = NULL;
|
||||
GameObject* trapGO = nullptr;
|
||||
{
|
||||
// using original GO distance
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
@@ -1146,7 +1146,7 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target)
|
||||
|
||||
GameObject* GameObject::LookupFishingHoleAround(float range)
|
||||
{
|
||||
GameObject* ok = NULL;
|
||||
GameObject* ok = nullptr;
|
||||
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
@@ -1169,7 +1169,7 @@ void GameObject::ResetDoorOrButton()
|
||||
m_cooldownTime = 0;
|
||||
}
|
||||
|
||||
void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = false */, Unit* user /*=NULL*/)
|
||||
void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = false */, Unit* user /*=nullptr*/)
|
||||
{
|
||||
if (m_lootState != GO_READY)
|
||||
return;
|
||||
@@ -1193,7 +1193,7 @@ void GameObject::SetGoArtKit(uint8 kit)
|
||||
|
||||
void GameObject::SetGoArtKit(uint8 artkit, GameObject* go, ObjectGuid::LowType lowguid)
|
||||
{
|
||||
const GameObjectData* data = NULL;
|
||||
const GameObjectData* data = nullptr;
|
||||
if (go)
|
||||
{
|
||||
go->SetGoArtKit(artkit);
|
||||
@@ -1419,7 +1419,7 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
// cast this spell later if provided
|
||||
spellId = info->goober.spellId;
|
||||
spellCaster = NULL;
|
||||
spellCaster = nullptr;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1538,7 +1538,7 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
GameObjectTemplate const* info = GetGOInfo();
|
||||
|
||||
Player* m_ritualOwner = NULL;
|
||||
Player* m_ritualOwner = nullptr;
|
||||
if (m_ritualOwnerGUID)
|
||||
m_ritualOwner = ObjectAccessor::FindPlayer(m_ritualOwnerGUID);
|
||||
|
||||
@@ -1902,7 +1902,7 @@ bool GameObject::IsInRange(float x, float y, float z, float radius) const
|
||||
&& dz < info->maxZ + radius && dz > info->minZ - radius;
|
||||
}
|
||||
|
||||
void GameObject::EventInform(uint32 eventId, WorldObject* invoker /*= NULL*/)
|
||||
void GameObject::EventInform(uint32 eventId, WorldObject* invoker /*= nullptr*/)
|
||||
{
|
||||
if (!eventId)
|
||||
return;
|
||||
@@ -1962,7 +1962,7 @@ void GameObject::UpdateRotationFields(float rotation2 /*=0.0f*/, float rotation3
|
||||
SetFloatValue(GAMEOBJECT_PARENTROTATION+3, rotation3);
|
||||
}
|
||||
|
||||
void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= NULL*/, uint32 spellId /*= 0*/)
|
||||
void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= nullptr*/, uint32 spellId /*= 0*/)
|
||||
{
|
||||
if (!m_goValue.Building.MaxHealth || !change)
|
||||
return;
|
||||
@@ -1981,7 +1981,7 @@ void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= NULL*/, u
|
||||
// Set the health bar, value = 255 * healthPct;
|
||||
SetGoAnimProgress(m_goValue.Building.Health * 255 / m_goValue.Building.MaxHealth);
|
||||
|
||||
Player* player = attackerOrHealer ? attackerOrHealer->GetCharmerOrOwnerPlayerOrPlayerItself() : NULL;
|
||||
Player* player = attackerOrHealer ? attackerOrHealer->GetCharmerOrOwnerPlayerOrPlayerItself() : nullptr;
|
||||
|
||||
// dealing damage, send packet
|
||||
if (player)
|
||||
@@ -2012,7 +2012,7 @@ void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= NULL*/, u
|
||||
SetDestructibleState(newState, player, false);
|
||||
}
|
||||
|
||||
void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* eventInvoker /*= NULL*/, bool setHealth /*= false*/)
|
||||
void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player* eventInvoker /*= nullptr*/, bool setHealth /*= false*/)
|
||||
{
|
||||
// the user calling this must know he is already operating on destructible gameobject
|
||||
ASSERT(GetGoType() == GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING);
|
||||
@@ -2221,14 +2221,14 @@ void GameObject::UpdateModel()
|
||||
Player* GameObject::GetLootRecipient() const
|
||||
{
|
||||
if (!m_lootRecipient)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return ObjectAccessor::FindConnectedPlayer(m_lootRecipient);
|
||||
}
|
||||
|
||||
Group* GameObject::GetLootRecipientGroup() const
|
||||
{
|
||||
if (!m_lootRecipientGroup)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return sGroupMgr->GetGroupByGUID(m_lootRecipientGroup);
|
||||
}
|
||||
|
||||
@@ -2236,7 +2236,7 @@ void GameObject::SetLootRecipient(Unit* unit)
|
||||
{
|
||||
// set the player whose group should receive the right
|
||||
// to loot the creature after it dies
|
||||
// should be set to NULL after the loot disappears
|
||||
// should be set to nullptr after the loot disappears
|
||||
|
||||
if (!unit)
|
||||
{
|
||||
@@ -2382,7 +2382,7 @@ void GameObject::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* t
|
||||
data->append(fieldBuffer);
|
||||
}
|
||||
|
||||
void GameObject::GetRespawnPosition(float &x, float &y, float &z, float* ori /* = NULL*/) const
|
||||
void GameObject::GetRespawnPosition(float &x, float &y, float &z, float* ori /* = 0.0f*/) const
|
||||
{
|
||||
if (m_spawnId)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user