feat(Core/Grids): Remove WorldObject separation in grid containers (#22595)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user