mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
Core/Phases: Get rid of IsInSamePhase
This commit is contained in:
@@ -2752,12 +2752,6 @@ bool WorldObject::IsInPhase(WorldObject const* obj) const
|
||||
return Trinity::Containers::Intersects(_phases.begin(), _phases.end(), obj->GetPhases().begin(), obj->GetPhases().end());
|
||||
}
|
||||
|
||||
bool WorldObject::InSamePhase(WorldObject const* obj) const
|
||||
{
|
||||
return IsInPhase(obj);
|
||||
// return InSamePhase(obj->GetPhaseMask());
|
||||
}
|
||||
|
||||
void WorldObject::PlayDistanceSound(uint32 sound_id, Player* target /*= NULL*/)
|
||||
{
|
||||
WorldPacket data(SMSG_PLAY_OBJECT_SOUND, 4 + 8);
|
||||
|
||||
@@ -595,8 +595,6 @@ class WorldObject : public Object, public WorldLocation
|
||||
virtual void SetInPhase(uint32 id, bool update, bool apply);
|
||||
void RebuildTerrainSwaps();
|
||||
uint32 GetPhaseMask() const { return m_phaseMask; }
|
||||
bool InSamePhase(WorldObject const* obj) const;
|
||||
bool InSamePhase(uint32 phasemask) const { return (GetPhaseMask() & phasemask) != 0; }
|
||||
bool IsInPhase(uint32 phase) const { return _phases.find(phase) != _phases.end(); }
|
||||
bool IsInPhase(WorldObject const* obj) const;
|
||||
bool IsInTerrainSwap(uint32 terrainSwap) const { return _terrainSwaps.find(terrainSwap) != _terrainSwaps.end(); }
|
||||
|
||||
@@ -3668,7 +3668,7 @@ void Unit::RemoveNotOwnSingleTargetAuras(uint32 newPhase, bool phaseid)
|
||||
else
|
||||
{
|
||||
Unit* caster = aura->GetCaster();
|
||||
if (!caster || (newPhase && !caster->InSamePhase(newPhase)) || (!newPhase && !caster->IsInPhase(this)))
|
||||
if (!caster || (newPhase && !caster->IsInPhase(newPhase)) || (!newPhase && !caster->IsInPhase(this)))
|
||||
RemoveAura(iter);
|
||||
else
|
||||
++iter;
|
||||
@@ -3683,7 +3683,7 @@ void Unit::RemoveNotOwnSingleTargetAuras(uint32 newPhase, bool phaseid)
|
||||
for (AuraList::iterator iter = scAuras.begin(); iter != scAuras.end();)
|
||||
{
|
||||
Aura* aura = *iter;
|
||||
if (aura->GetUnitOwner() != this && !aura->GetUnitOwner()->InSamePhase(newPhase))
|
||||
if (aura->GetUnitOwner() != this && !aura->GetUnitOwner()->IsInPhase(newPhase))
|
||||
{
|
||||
aura->Remove();
|
||||
iter = scAuras.begin();
|
||||
|
||||
Reference in New Issue
Block a user