mirror of
https://github.com/azerothcore/azerothcore-wotlk.git
synced 2025-12-06 02:30:26 -08:00
fix(Core/Visibility): Fix sentry totem visibility not toggling (#23228)
This commit is contained in:
parent
e867443c4e
commit
f661f57f67
2 changed files with 3 additions and 5 deletions
|
|
@ -1776,6 +1776,8 @@ bool WorldObject::CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
|
|||
WorldObject const* viewpoint = this;
|
||||
if (Player const* thisPlayer = ToPlayer())
|
||||
{
|
||||
viewpoint = thisPlayer->GetSeer();
|
||||
|
||||
if (Creature const* creature = obj->ToCreature())
|
||||
{
|
||||
if (TempSummon const* tempSummon = creature->ToTempSummon())
|
||||
|
|
@ -1815,13 +1817,8 @@ bool WorldObject::CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
|
|||
return false;
|
||||
}
|
||||
|
||||
if (thisPlayer->GetViewpoint())
|
||||
viewpoint = thisPlayer->GetViewpoint();
|
||||
|
||||
if (thisPlayer->GetFarSightDistance() && !thisPlayer->isInFront(obj))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 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 SetSeer(WorldObject* target) { m_seer = target; }
|
||||
WorldObject* GetSeer() const { return m_seer; }
|
||||
void SetViewpoint(WorldObject* target, bool apply);
|
||||
[[nodiscard]] WorldObject* GetViewpoint() const;
|
||||
void StopCastingCharm(Aura* except = nullptr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue