mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Core/Visibility): Fix sentry totem visibility not toggling (#23228)
This commit is contained in:
@@ -1776,6 +1776,8 @@ bool WorldObject::CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
|
|||||||
WorldObject const* viewpoint = this;
|
WorldObject const* viewpoint = this;
|
||||||
if (Player const* thisPlayer = ToPlayer())
|
if (Player const* thisPlayer = ToPlayer())
|
||||||
{
|
{
|
||||||
|
viewpoint = thisPlayer->GetSeer();
|
||||||
|
|
||||||
if (Creature const* creature = obj->ToCreature())
|
if (Creature const* creature = obj->ToCreature())
|
||||||
{
|
{
|
||||||
if (TempSummon const* tempSummon = creature->ToTempSummon())
|
if (TempSummon const* tempSummon = creature->ToTempSummon())
|
||||||
@@ -1815,13 +1817,8 @@ bool WorldObject::CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thisPlayer->GetViewpoint())
|
|
||||||
viewpoint = thisPlayer->GetViewpoint();
|
|
||||||
|
|
||||||
if (thisPlayer->GetFarSightDistance() && !thisPlayer->isInFront(obj))
|
if (thisPlayer->GetFarSightDistance() && !thisPlayer->isInFront(obj))
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Xinef: check reversely obj vs viewpoint, object could be a gameObject which overrides _IsWithinDist function to include gameobject size
|
// Xinef: check reversely obj vs viewpoint, object could be a gameObject which overrides _IsWithinDist function to include gameobject size
|
||||||
|
|||||||
@@ -2351,6 +2351,7 @@ public:
|
|||||||
void SetMover(Unit* target);
|
void SetMover(Unit* target);
|
||||||
|
|
||||||
void SetSeer(WorldObject* target) { m_seer = target; }
|
void SetSeer(WorldObject* target) { m_seer = target; }
|
||||||
|
WorldObject* GetSeer() const { return m_seer; }
|
||||||
void SetViewpoint(WorldObject* target, bool apply);
|
void SetViewpoint(WorldObject* target, bool apply);
|
||||||
[[nodiscard]] WorldObject* GetViewpoint() const;
|
[[nodiscard]] WorldObject* GetViewpoint() const;
|
||||||
void StopCastingCharm(Aura* except = nullptr);
|
void StopCastingCharm(Aura* except = nullptr);
|
||||||
|
|||||||
Reference in New Issue
Block a user