fix(Core/Visibility): Fix visibility crash (#22704)
This commit is contained in:
@@ -1696,7 +1696,7 @@ bool WorldObject::CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
|
|||||||
if (this == obj)
|
if (this == obj)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (obj->IsNeverVisible() || CanNeverSee(obj))
|
if (CanNeverSee(obj))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (obj->IsAlwaysVisibleFor(this) || CanAlwaysSee(obj))
|
if (obj->IsAlwaysVisibleFor(this) || CanAlwaysSee(obj))
|
||||||
@@ -1840,6 +1840,12 @@ bool WorldObject::CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
|
|||||||
|
|
||||||
bool WorldObject::CanNeverSee(WorldObject const* obj) const
|
bool WorldObject::CanNeverSee(WorldObject const* obj) const
|
||||||
{
|
{
|
||||||
|
if (!IsInWorld())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (obj->IsNeverVisible())
|
||||||
|
return true;
|
||||||
|
|
||||||
if (IsCreature() && obj->IsCreature())
|
if (IsCreature() && obj->IsCreature())
|
||||||
return GetMap() != obj->GetMap() || (!InSamePhase(obj) && ToUnit()->GetVehicleBase() != obj && this != obj->ToUnit()->GetVehicleBase());
|
return GetMap() != obj->GetMap() || (!InSamePhase(obj) && ToUnit()->GetVehicleBase() != obj && this != obj->ToUnit()->GetVehicleBase());
|
||||||
return GetMap() != obj->GetMap() || !InSamePhase(obj);
|
return GetMap() != obj->GetMap() || !InSamePhase(obj);
|
||||||
|
|||||||
Reference in New Issue
Block a user