feat(Core/Grids): Remove WorldObject separation in grid containers (#22595)

This commit is contained in:
Takenbacon
2025-08-08 21:36:24 -07:00
committed by GitHub
parent c97cee1e4f
commit 73317b2706
63 changed files with 160 additions and 313 deletions

View File

@@ -26,7 +26,7 @@
#include "UpdateMask.h"
#include "World.h"
Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES), m_type(type)
Corpse::Corpse(CorpseType type) : WorldObject(), m_type(type)
{
m_objectType |= TYPEMASK_CORPSE;
m_objectTypeId = TYPEID_CORPSE;

View File

@@ -269,7 +269,7 @@ bool TemporaryThreatModifierEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
return true;
}
Creature::Creature(bool isWorldObject): Unit(isWorldObject), MovableMapObject(), m_groupLootTimer(0), lootingGroupLowGUID(0), m_lootRecipientGroup(0),
Creature::Creature(): Unit(), MovableMapObject(), m_groupLootTimer(0), lootingGroupLowGUID(0), m_lootRecipientGroup(0),
m_corpseRemoveTime(0), m_respawnTime(0), m_respawnDelay(300), m_corpseDelay(60), m_wanderDistance(0.0f), m_boundaryCheckTime(2500),
m_transportCheckTimer(1000), lootPickPocketRestoreTime(0), m_combatPulseTime(0), m_combatPulseDelay(0), m_reactState(REACT_AGGRESSIVE), m_defaultMovementType(IDLE_MOTION_TYPE),
m_spawnId(0), m_equipmentId(0), m_originalEquipmentId(0), m_AlreadyCallAssistance(false),
@@ -1079,7 +1079,7 @@ void Creature::DoFleeToGetAssistance()
Acore::NearestAssistCreatureInCreatureRangeCheck u_check(this, GetVictim(), radius);
Acore::CreatureLastSearcher<Acore::NearestAssistCreatureInCreatureRangeCheck> searcher(this, creature, u_check);
Cell::VisitGridObjects(this, searcher, radius);
Cell::VisitObjects(this, searcher, radius);
SetNoSearchAssistance(true);
UpdateSpeed(MOVE_RUN, false);
@@ -2400,7 +2400,7 @@ Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) c
Acore::NearestHostileUnitCheck u_check(this, dist, playerOnly);
Acore::UnitLastSearcher<Acore::NearestHostileUnitCheck> searcher(this, target, u_check);
Cell::VisitAllObjects(this, searcher, dist);
Cell::VisitObjects(this, searcher, dist);
return target;
}
@@ -2417,7 +2417,7 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
Unit* target = nullptr;
Acore::NearestHostileUnitInAttackDistanceCheck u_check(this, dist);
Acore::UnitLastSearcher<Acore::NearestHostileUnitInAttackDistanceCheck> searcher(this, target, u_check);
Cell::VisitAllObjects(this, searcher, std::max(dist, ATTACK_DISTANCE));
Cell::VisitObjects(this, searcher, std::max(dist, ATTACK_DISTANCE));
return target;
}
@@ -2453,7 +2453,7 @@ void Creature::CallAssistance(Unit* target /*= nullptr*/)
Acore::AnyAssistCreatureInRangeCheck u_check(this, target, radius);
Acore::CreatureListSearcher<Acore::AnyAssistCreatureInRangeCheck> searcher(this, assistList, u_check);
Cell::VisitGridObjects(this, searcher, radius);
Cell::VisitObjects(this, searcher, radius);
if (!assistList.empty())
{
@@ -2489,7 +2489,7 @@ void Creature::CallForHelp(float radius, Unit* target /*= nullptr*/)
Acore::CallOfHelpCreatureInRangeDo u_do(this, target, radius);
Acore::CreatureWorker<Acore::CallOfHelpCreatureInRangeDo> worker(this, u_do);
Cell::VisitGridObjects(this, worker, radius);
Cell::VisitObjects(this, worker, radius);
}
bool Creature::CanAssistTo(Unit const* u, Unit const* enemy, bool checkfaction /*= true*/) const

View File

@@ -42,7 +42,7 @@ class CreatureGroup;
class Creature : public Unit, public GridObject<Creature>, public MovableMapObject, public UpdatableMapObject
{
public:
explicit Creature(bool isWorldObject = false);
explicit Creature();
~Creature() override;
void AddToWorld() override;

View File

@@ -24,8 +24,8 @@
#include "Player.h"
#include "ScriptMgr.h"
TempSummon::TempSummon(SummonPropertiesEntry const* properties, ObjectGuid owner, bool isWorldObject) :
Creature(isWorldObject), m_Properties(properties), m_type(TEMPSUMMON_MANUAL_DESPAWN),
TempSummon::TempSummon(SummonPropertiesEntry const* properties, ObjectGuid owner) :
Creature(), m_Properties(properties), m_type(TEMPSUMMON_MANUAL_DESPAWN),
m_timer(0), m_lifetime(0), _visibleBySummonerOnly(false)
{
if (owner)
@@ -350,7 +350,7 @@ std::string TempSummon::GetDebugInfo() const
return sstr.str();
}
Minion::Minion(SummonPropertiesEntry const* properties, ObjectGuid owner, bool isWorldObject) : TempSummon(properties, owner, isWorldObject)
Minion::Minion(SummonPropertiesEntry const* properties, ObjectGuid owner) : TempSummon(properties, owner)
, m_owner(owner)
{
ASSERT(m_owner);
@@ -417,7 +417,7 @@ std::string Minion::GetDebugInfo() const
return sstr.str();
}
Guardian::Guardian(SummonPropertiesEntry const* properties, ObjectGuid owner, bool isWorldObject) : Minion(properties, owner, isWorldObject)
Guardian::Guardian(SummonPropertiesEntry const* properties, ObjectGuid owner) : Minion(properties, owner)
{
m_unitTypeMask |= UNIT_MASK_GUARDIAN;
if (properties && (properties->Type == SUMMON_TYPE_PET || properties->Category == SUMMON_CATEGORY_PET))
@@ -462,7 +462,7 @@ std::string Guardian::GetDebugInfo() const
return sstr.str();
}
Puppet::Puppet(SummonPropertiesEntry const* properties, ObjectGuid owner) : Minion(properties, owner, false), m_owner(owner) //maybe true?
Puppet::Puppet(SummonPropertiesEntry const* properties, ObjectGuid owner) : Minion(properties, owner), m_owner(owner)
{
ASSERT(owner.IsPlayer());
m_unitTypeMask |= UNIT_MASK_PUPPET;

View File

@@ -39,7 +39,7 @@ struct TempSummonData
class TempSummon : public Creature
{
public:
explicit TempSummon(SummonPropertiesEntry const* properties, ObjectGuid owner, bool isWorldObject);
explicit TempSummon(SummonPropertiesEntry const* properties, ObjectGuid owner);
~TempSummon() override = default;
void Update(uint32 time) override;
virtual void InitStats(uint32 lifetime);
@@ -76,7 +76,7 @@ private:
class Minion : public TempSummon
{
public:
Minion(SummonPropertiesEntry const* properties, ObjectGuid owner, bool isWorldObject);
Minion(SummonPropertiesEntry const* properties, ObjectGuid owner);
void InitStats(uint32 duration) override;
void RemoveFromWorld() override;
[[nodiscard]] Unit* GetOwner() const;
@@ -95,7 +95,7 @@ protected:
class Guardian : public Minion
{
public:
Guardian(SummonPropertiesEntry const* properties, ObjectGuid owner, bool isWorldObject);
Guardian(SummonPropertiesEntry const* properties, ObjectGuid owner);
void InitStats(uint32 duration) override;
bool InitStatsForLevel(uint8 level);
void InitSummon() override;

View File

@@ -22,7 +22,7 @@
#include "SpellAuraEffects.h"
#include "Transport.h"
DynamicObject::DynamicObject(bool isWorldObject) : WorldObject(isWorldObject), MovableMapObject(),
DynamicObject::DynamicObject() : WorldObject(), MovableMapObject(),
_aura(nullptr), _removedAura(nullptr), _caster(nullptr), _duration(0), _isViewpoint(false), _updateViewerVisibilityTimer(0)
{
m_objectType |= TYPEMASK_DYNAMICOBJECT;
@@ -128,11 +128,6 @@ bool DynamicObject::CreateDynamicObject(ObjectGuid::LowType guidlow, Unit* caste
return false;
}
if (IsWorldObject())
{
setActive(true);
}
return true;
}

View File

@@ -34,7 +34,7 @@ enum DynamicObjectType
class DynamicObject : public WorldObject, public GridObject<DynamicObject>, public MovableMapObject, public UpdatableMapObject
{
public:
DynamicObject(bool isWorldObject);
DynamicObject();
~DynamicObject() override;
void AddToWorld() override;

View File

@@ -38,7 +38,7 @@
#include <G3D/CoordinateFrame.h>
#include <G3D/Quat.h>
GameObject::GameObject() : WorldObject(false), MovableMapObject(),
GameObject::GameObject() : WorldObject(), MovableMapObject(),
m_model(nullptr), m_goValue(), m_AI(nullptr)
{
m_objectType |= TYPEMASK_GAMEOBJECT;
@@ -721,7 +721,7 @@ void GameObject::Update(uint32 diff)
{
Acore::NearestAttackableNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
Acore::UnitSearcher<Acore::NearestAttackableNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
Cell::VisitAllObjects(this, searcher, radius);
Cell::VisitObjects(this, searcher, radius);
}
else // environmental trap
{
@@ -730,7 +730,7 @@ void GameObject::Update(uint32 diff)
Player* player = nullptr;
Acore::AnyPlayerInObjectRangeCheck checker(this, radius, true, true);
Acore::PlayerSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(this, player, checker);
Cell::VisitWorldObjects(this, searcher, radius);
Cell::VisitObjects(this, searcher, radius);
target = player;
}
@@ -1397,7 +1397,7 @@ GameObject* GameObject::LookupFishingHoleAround(float range)
Acore::NearestGameObjectFishingHole u_check(*this, range);
Acore::GameObjectSearcher<Acore::NearestGameObjectFishingHole> checker(this, ok, u_check);
Cell::VisitGridObjects(this, checker, range);
Cell::VisitObjects(this, checker, range);
return ok;
}

View File

@@ -86,17 +86,6 @@ Object::Object() : m_PackGUID(sizeof(uint64) + 1)
WorldObject::~WorldObject()
{
sScriptMgr->OnWorldObjectDestroy(this);
// this may happen because there are many !create/delete
if (IsWorldObject() && m_currMap)
{
if (IsCorpse())
{
LOG_FATAL("entities.object", "Object::~Object Corpse {}, type={} deleted but still in map!!", GetGUID().ToString(), ((Corpse*)this)->GetType());
ABORT();
}
ResetMap();
}
}
Object::~Object()
@@ -1047,8 +1036,8 @@ void MovementInfo::OutDebug()
LOG_INFO("movement", "splineElevation: {}", splineElevation);
}
WorldObject::WorldObject(bool isWorldObject) : WorldLocation(),
LastUsedScriptID(0), m_name(""), m_isActive(false), m_visibilityDistanceOverride(), m_isWorldObject(isWorldObject), m_zoneScript(nullptr),
WorldObject::WorldObject() : WorldLocation(),
LastUsedScriptID(0), m_name(""), m_isActive(false), m_visibilityDistanceOverride(), m_zoneScript(nullptr),
_zoneId(0), _areaId(0), _floorZ(INVALID_HEIGHT), _outdoors(false), _liquidData(), _updatePositionData(false), m_transport(nullptr),
m_currMap(nullptr), _heartbeatTimer(HEARTBEAT_INTERVAL), m_InstanceId(0), m_phaseMask(PHASEMASK_NORMAL), m_useCombinedPhases(true),
m_notifyflags(0), m_executed_notifies(0), _objectVisibilityContainer(this)
@@ -2102,9 +2091,6 @@ void WorldObject::SetMap(Map* map)
m_InstanceId = map->GetInstanceId();
sScriptMgr->OnWorldObjectSetMap(this, map);
if (IsWorldObject())
m_currMap->AddWorldObject(this);
}
void WorldObject::ResetMap()
@@ -2112,11 +2098,6 @@ void WorldObject::ResetMap()
ASSERT(m_currMap);
ASSERT(!IsInWorld());
if (IsWorldObject())
{
m_currMap->RemoveWorldObject(this);
}
sScriptMgr->OnWorldObjectResetMap(this);
m_currMap = nullptr;
@@ -2198,10 +2179,10 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
switch (mask)
{
case UNIT_MASK_SUMMON:
summon = new TempSummon(properties, summoner ? summoner->GetGUID() : ObjectGuid::Empty, false);
summon = new TempSummon(properties, summoner ? summoner->GetGUID() : ObjectGuid::Empty);
break;
case UNIT_MASK_GUARDIAN:
summon = new Guardian(properties, summoner ? summoner->GetGUID() : ObjectGuid::Empty, false);
summon = new Guardian(properties, summoner ? summoner->GetGUID() : ObjectGuid::Empty);
break;
case UNIT_MASK_PUPPET:
summon = new Puppet(properties, summoner ? summoner->GetGUID() : ObjectGuid::Empty);
@@ -2210,7 +2191,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
summon = new Totem(properties, summoner ? summoner->GetGUID() : ObjectGuid::Empty);
break;
case UNIT_MASK_MINION:
summon = new Minion(properties, summoner ? summoner->GetGUID() : ObjectGuid::Empty, false);
summon = new Minion(properties, summoner ? summoner->GetGUID() : ObjectGuid::Empty);
break;
default:
return nullptr;
@@ -2244,7 +2225,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
// call MoveInLineOfSight for nearby creatures
Acore::AIRelocationNotifier notifier(*summon);
Cell::VisitAllObjects(summon, notifier, GetVisibilityRange());
Cell::VisitObjects(summon, notifier, GetVisibilityRange());
return summon;
}
@@ -2429,7 +2410,7 @@ Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive
Creature* creature = nullptr;
Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
Acore::CreatureLastSearcher<Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(this, creature, checker);
Cell::VisitAllObjects(this, searcher, range);
Cell::VisitObjects(this, searcher, range);
return creature;
}
@@ -2438,7 +2419,7 @@ GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range, bool o
GameObject* go = nullptr;
Acore::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range, onlySpawned);
Acore::GameObjectLastSearcher<Acore::NearestGameObjectEntryInObjectRangeCheck> searcher(this, go, checker);
Cell::VisitGridObjects(this, searcher, range);
Cell::VisitObjects(this, searcher, range);
return go;
}
@@ -2447,7 +2428,7 @@ GameObject* WorldObject::FindNearestGameObjectOfType(GameobjectTypes type, float
GameObject* go = nullptr;
Acore::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range);
Acore::GameObjectLastSearcher<Acore::NearestGameObjectTypeInObjectRangeCheck> searcher(this, go, checker);
Cell::VisitGridObjects(this, searcher, range);
Cell::VisitObjects(this, searcher, range);
return go;
}
@@ -2457,7 +2438,7 @@ Player* WorldObject::SelectNearestPlayer(float distance) const
Acore::NearestPlayerInObjectRangeCheck checker(this, distance);
Acore::PlayerLastSearcher<Acore::NearestPlayerInObjectRangeCheck> searcher(this, target, checker);
Cell::VisitWorldObjects(this, searcher, distance);
Cell::VisitObjects(this, searcher, distance);
return target;
}
@@ -2475,35 +2456,35 @@ void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& gameo
{
Acore::AllGameObjectsWithEntryInRange check(this, entry, maxSearchRange);
Acore::GameObjectListSearcher<Acore::AllGameObjectsWithEntryInRange> searcher(this, gameobjectList, check);
Cell::VisitGridObjects(this, searcher, maxSearchRange);
Cell::VisitObjects(this, searcher, maxSearchRange);
}
void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& gameobjectList, std::vector<uint32> const& entries, float maxSearchRange) const
{
Acore::AllGameObjectsMatchingOneEntryInRange check(this, entries, maxSearchRange);
Acore::GameObjectListSearcher searcher(this, gameobjectList, check);
Cell::VisitGridObjects(this, searcher, maxSearchRange);
Cell::VisitObjects(this, searcher, maxSearchRange);
}
void WorldObject::GetCreatureListWithEntryInGrid(std::list<Creature*>& creatureList, uint32 entry, float maxSearchRange) const
{
Acore::AllCreaturesOfEntryInRange check(this, entry, maxSearchRange);
Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
Cell::VisitGridObjects(this, searcher, maxSearchRange);
Cell::VisitObjects(this, searcher, maxSearchRange);
}
void WorldObject::GetCreatureListWithEntryInGrid(std::list<Creature*>& creatureList, std::vector<uint32> const& entries, float maxSearchRange) const
{
Acore::AllCreaturesMatchingOneEntryInRange check(this, entries, maxSearchRange);
Acore::CreatureListSearcher searcher(this, creatureList, check);
Cell::VisitGridObjects(this, searcher, maxSearchRange);
Cell::VisitObjects(this, searcher, maxSearchRange);
}
void WorldObject::GetDeadCreatureListInGrid(std::list<Creature*>& creaturedeadList, float maxSearchRange, bool alive /*= false*/) const
{
Acore::AllDeadCreaturesInRange check(this, maxSearchRange, alive);
Acore::CreatureListSearcher<Acore::AllDeadCreaturesInRange> searcher(this, creaturedeadList, check);
Cell::VisitGridObjects(this, searcher, maxSearchRange);
Cell::VisitObjects(this, searcher, maxSearchRange);
}
/*
@@ -2895,7 +2876,7 @@ void WorldObject::PlayRadiusSound(uint32 sound_id, float radius)
std::vector<Player*> targets;
Acore::AnyPlayerInObjectRangeCheck check(this, radius, false);
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(this, targets, check);
Cell::VisitWorldObjects(this, searcher, radius);
Cell::VisitObjects(this, searcher, radius);
for (Player* player : targets)
player->SendDirectMessage(WorldPackets::Misc::Playsound(sound_id).Write());
@@ -2914,7 +2895,7 @@ void WorldObject::PlayRadiusMusic(uint32 music_id, float radius)
std::vector<Player*> targets;
Acore::AnyPlayerInObjectRangeCheck check(this, radius, false);
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(this, targets, check);
Cell::VisitWorldObjects(this, searcher, radius);
Cell::VisitObjects(this, searcher, radius);
for (Player* player : targets)
player->SendDirectMessage(WorldPackets::Misc::PlayMusic(music_id).Write());
@@ -2942,7 +2923,7 @@ void WorldObject::UpdateObjectVisibility(bool /*forced*/, bool /*fromUpdate*/)
{
//updates object's visibility for nearby players
Acore::VisibleChangesNotifier notifier(*this);
Cell::VisitWorldObjects(this, notifier, GetVisibilityRange());
Cell::VisitObjects(this, notifier, GetVisibilityRange());
}
void WorldObject::AddToNotify(uint16 f)
@@ -2990,7 +2971,7 @@ void WorldObject::GetCreaturesWithEntryInRange(std::list<Creature*>& creatureLis
{
Acore::AllCreaturesOfEntryInRange check(this, entry, radius);
Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
Cell::VisitAllObjects(this, searcher, radius);
Cell::VisitObjects(this, searcher, radius);
}
void WorldObject::AddToObjectUpdate()

View File

@@ -460,7 +460,7 @@ private:
class WorldObject : public Object, public WorldLocation
{
protected:
explicit WorldObject(bool isWorldObject); //note: here it means if it is in grid object list or world object list
explicit WorldObject();
public:
~WorldObject() override;
@@ -657,7 +657,6 @@ public:
[[nodiscard]] bool IsFarVisible() const { return m_isFarVisible; }
[[nodiscard]] bool IsVisibilityOverridden() const { return m_visibilityDistanceOverride.has_value(); }
void SetVisibilityDistanceOverride(VisibilityDistanceType type);
[[nodiscard]] bool IsWorldObject() const { return m_isWorldObject; }
[[nodiscard]] bool IsInWintergrasp() const
{
@@ -722,7 +721,6 @@ protected:
bool m_isActive;
bool m_isFarVisible;
Optional<float> m_visibilityDistanceOverride;
const bool m_isWorldObject;
ZoneScript* m_zoneScript;
virtual void ProcessPositionDataChanged(PositionFullTerrainStatus const& data);

View File

@@ -38,7 +38,7 @@
#include "WorldPacket.h"
#include "WorldSession.h"
Pet::Pet(Player* owner, PetType type) : Guardian(nullptr, owner ? owner->GetGUID() : ObjectGuid::Empty, true),
Pet::Pet(Player* owner, PetType type) : Guardian(nullptr, owner ? owner->GetGUID() : ObjectGuid::Empty),
m_usedTalentCount(0),
m_removed(false),
m_owner(owner),
@@ -75,7 +75,7 @@ void Pet::AddToWorld()
if (!IsInWorld())
{
///- Register the pet for guid lookup
GetMap()->GetObjectsStore().Insert<Pet>(GetGUID(), this);
GetMap()->GetObjectsStore().Insert<Creature>(GetGUID(), this);
Unit::AddToWorld();
Motion_Initialize();
AIM_Initialize();
@@ -126,7 +126,7 @@ void Pet::RemoveFromWorld()
{
///- Don't call the function for Creature, normal mobs + totems go in a different storage
Unit::RemoveFromWorld();
GetMap()->GetObjectsStore().Remove<Pet>(GetGUID());
GetMap()->GetObjectsStore().Remove<Creature>(GetGUID());
}
}

View File

@@ -149,7 +149,7 @@ static uint32 copseReclaimDelay[MAX_DEATH_COUNT] = { 30, 60, 120 };
#ifdef _MSC_VER
#pragma warning(disable:4355)
#endif
Player::Player(WorldSession* session): Unit(true), m_mover(this)
Player::Player(WorldSession* session): Unit(), m_mover(this)
{
#ifdef _MSC_VER
#pragma warning(default:4355)
@@ -9381,7 +9381,7 @@ void Player::Say(std::string_view text, Language language, WorldObject const* /*
// Special handling for messages, do not use visibility map for stealthed units
Acore::MessageDistDeliverer notifier(this, &data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), false, nullptr, true);
Cell::VisitWorldObjects(this, notifier, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
Cell::VisitObjects(this, notifier, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
}
void Player::Say(uint32 textId, WorldObject const* target /*= nullptr*/)
@@ -9407,7 +9407,7 @@ void Player::Yell(std::string_view text, Language language, WorldObject const* /
// Special handling for messages, do not use visibility map for stealthed units
Acore::MessageDistDeliverer notifier(this, &data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), false, nullptr, true);
Cell::VisitWorldObjects(this, notifier, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
Cell::VisitObjects(this, notifier, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
}
void Player::Yell(uint32 textId, WorldObject const* target /*= nullptr*/)
@@ -9433,7 +9433,7 @@ void Player::TextEmote(std::string_view text, WorldObject const* /*= nullptr*/,
// Special handling for messages, do not use visibility map for stealthed units
Acore::MessageDistDeliverer notifier(this, &data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_EMOTE), nullptr, true);
Cell::VisitWorldObjects(this, notifier, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
Cell::VisitObjects(this, notifier, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
}
void Player::TextEmote(uint32 textId, WorldObject const* target /*= nullptr*/, bool /*isBossEmote = false*/)

View File

@@ -1601,13 +1601,13 @@ void Player::UpdateVisibilityForPlayer(bool mapChange)
Acore::VisibleNotifier notifierNoLarge(
*this, mapChange,
false); // visit only objects which are not large; default distance
Cell::VisitAllObjects(m_seer, notifierNoLarge,
Cell::VisitObjects(m_seer, notifierNoLarge,
GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS);
notifierNoLarge.SendToSelf();
Acore::VisibleNotifier notifierLarge(
*this, mapChange, true); // visit only large objects; maximum distance
Cell::VisitAllObjects(m_seer, notifierLarge, GetSightRange());
Cell::VisitObjects(m_seer, notifierLarge, GetSightRange());
notifierLarge.SendToSelf();
if (mapChange)

View File

@@ -24,7 +24,7 @@
#include "SpellMgr.h"
#include "TotemPackets.h"
Totem::Totem(SummonPropertiesEntry const* properties, ObjectGuid owner) : Minion(properties, owner, false)
Totem::Totem(SummonPropertiesEntry const* properties, ObjectGuid owner) : Minion(properties, owner)
{
m_unitTypeMask |= UNIT_MASK_TOTEM;
m_duration = 0;

View File

@@ -201,7 +201,7 @@ SpellInfo const* ProcEventInfo::GetSpellInfo() const
#ifdef _MSC_VER
#pragma warning(disable:4355)
#endif
Unit::Unit(bool isWorldObject) : WorldObject(isWorldObject),
Unit::Unit() : WorldObject(),
m_movedByPlayer(nullptr),
m_lastSanctuaryTime(0),
IsAIEnabled(false),
@@ -17060,7 +17060,7 @@ Unit* Unit::SelectNearbyTarget(Unit* exclude, float dist) const
std::list<Unit*> targets;
Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist);
Acore::UnitListSearcher<Acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(this, targets, u_check);
Cell::VisitAllObjects(this, searcher, dist);
Cell::VisitObjects(this, searcher, dist);
// remove current target
if (GetVictim())
@@ -17095,7 +17095,7 @@ Unit* Unit::SelectNearbyNoTotemTarget(Unit* exclude, float dist) const
std::list<Unit*> targets;
Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck u_check(this, this, dist);
Acore::UnitListSearcher<Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, targets, u_check);
Cell::VisitAllObjects(this, searcher, dist);
Cell::VisitObjects(this, searcher, dist);
// remove current target
if (GetVictim())
@@ -17332,7 +17332,7 @@ void Unit::SetContestedPvP(Player* attackedPlayer, bool lookForNearContestedGuar
std::list<Unit*> targets;
Acore::NearestVisibleDetectableContestedGuardUnitCheck u_check(this);
Acore::UnitListSearcher<Acore::NearestVisibleDetectableContestedGuardUnitCheck> searcher(this, targets, u_check);
Cell::VisitAllObjects(this, searcher, MAX_AGGRO_RADIUS);
Cell::VisitObjects(this, searcher, MAX_AGGRO_RADIUS);
// return if there are no contested guards found
if (!targets.size())
@@ -19224,7 +19224,7 @@ void Unit::UpdateObjectVisibility(bool forced, bool /*fromUpdate*/)
WorldObject::UpdateObjectVisibility(true);
Acore::AIRelocationNotifier notifier(*this);
float radius = 60.0f;
Cell::VisitAllObjects(this, notifier, radius);
Cell::VisitObjects(this, notifier, radius);
}
}
@@ -20275,10 +20275,10 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
}
Acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
Cell::VisitAllObjects(viewPoint, relocateNoLarge, player->GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS);
Cell::VisitObjects(viewPoint, relocateNoLarge, player->GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS);
relocateNoLarge.SendToSelf();
Acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
Cell::VisitAllObjects(viewPoint, relocateLarge, MAX_VISIBILITY_DISTANCE);
Cell::VisitObjects(viewPoint, relocateLarge, MAX_VISIBILITY_DISTANCE);
relocateLarge.SendToSelf();
}
@@ -20314,13 +20314,13 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
GetMap()->LoadGridsInRange(*player, MAX_VISIBILITY_DISTANCE);
Acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
Cell::VisitAllObjects(viewPoint, relocateNoLarge, player->GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS);
Cell::VisitObjects(viewPoint, relocateNoLarge, player->GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS);
relocateNoLarge.SendToSelf();
if (!player->GetFarSightDistance())
{
Acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
Cell::VisitAllObjects(viewPoint, relocateLarge, MAX_VISIBILITY_DISTANCE);
Cell::VisitObjects(viewPoint, relocateLarge, MAX_VISIBILITY_DISTANCE);
relocateLarge.SendToSelf();
}
@@ -20342,7 +20342,7 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
unit->m_last_notify_position.Relocate(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ());
Acore::CreatureRelocationNotifier relocate(*unit);
Cell::VisitAllObjects(unit, relocate, unit->GetVisibilityRange() + VISIBILITY_COMPENSATION);
Cell::VisitObjects(unit, relocate, unit->GetVisibilityRange() + VISIBILITY_COMPENSATION);
this->AddToNotify(NOTIFY_AI_RELOCATION);
}
@@ -20356,7 +20356,7 @@ void Unit::ExecuteDelayedUnitAINotifyEvent()
Acore::AIRelocationNotifier notifier(*this);
float radius = 60.0f;
Cell::VisitAllObjects(this, notifier, radius);
Cell::VisitObjects(this, notifier, radius);
}
void Unit::SetInFront(WorldObject const* target)
@@ -20992,7 +20992,7 @@ void Unit::Talk(std::string_view text, ChatMsg msgType, Language language, float
Acore::CustomChatTextBuilder builder(this, msgType, text, language, target);
Acore::LocalizedPacketDo<Acore::CustomChatTextBuilder> localizer(builder);
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::CustomChatTextBuilder> > worker(this, textRange, localizer);
Cell::VisitWorldObjects(this, worker, textRange);
Cell::VisitObjects(this, worker, textRange);
}
void Unit::Say(std::string_view text, Language language, WorldObject const* target /*= nullptr*/)
@@ -21050,7 +21050,7 @@ void Unit::Talk(uint32 textId, ChatMsg msgType, float textRange, WorldObject con
Acore::BroadcastTextBuilder builder(this, msgType, textId, getGender(), target);
Acore::LocalizedPacketDo<Acore::BroadcastTextBuilder> localizer(builder);
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::BroadcastTextBuilder> > worker(this, textRange, localizer);
Cell::VisitWorldObjects(this, worker, textRange);
Cell::VisitObjects(this, worker, textRange);
}
void Unit::Say(uint32 textId, WorldObject const* target /*= nullptr*/)

View File

@@ -2029,7 +2029,7 @@ public:
Movement::MoveSpline* movespline;
protected:
explicit Unit (bool isWorldObject);
explicit Unit();
void BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target) override;