mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-01 14:57:48 +00:00
fix(Core/GridNotifiers): increased visibility for large creatures, part 2 (#2378)
This commit is contained in:
@@ -974,7 +974,7 @@ class WorldObject : public Object, public WorldLocation
|
||||
|
||||
bool isActiveObject() const { return m_isActive; }
|
||||
void setActive(bool isActiveObject);
|
||||
bool IsVisibilityOverridden() const { return m_isVisibilityDistanceOverride; }
|
||||
bool IsVisibilityOverridden() const { return m_isVisibilityDistanceOverride || m_isActive; }
|
||||
void SetVisibilityDistanceOverride(bool isVisibilityDistanceOverride);
|
||||
void SetWorldObject(bool apply);
|
||||
bool IsPermanentWorldObject() const { return m_isWorldObject; }
|
||||
|
||||
@@ -23040,9 +23040,12 @@ void Player::UpdateObjectVisibility(bool forced, bool fromUpdate)
|
||||
|
||||
void Player::UpdateVisibilityForPlayer(bool mapChange)
|
||||
{
|
||||
Trinity::VisibleNotifier notifier(*this, mapChange);
|
||||
m_seer->VisitNearbyObject(GetSightRange()+VISIBILITY_INC_FOR_GOBJECTS, notifier);
|
||||
notifier.SendToSelf();
|
||||
Trinity::VisibleNotifier notifierNoLarge(*this, mapChange, false); // visit only objects which are not large; default distance
|
||||
m_seer->VisitNearbyObject(GetSightRange()+VISIBILITY_INC_FOR_GOBJECTS, notifierNoLarge);
|
||||
notifierNoLarge.SendToSelf();
|
||||
Trinity::VisibleNotifier notifierLarge(*this, mapChange, true); // visit only large objects; maximum distance
|
||||
m_seer->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, notifierLarge);
|
||||
notifierLarge.SendToSelf();
|
||||
|
||||
if (mapChange)
|
||||
m_last_notify_position.Relocate(-5000.0f, -5000.0f, -5000.0f, 0.0f);
|
||||
|
||||
@@ -19040,9 +19040,12 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
||||
//active->m_last_notify_position.Relocate(active->GetPositionX(), active->GetPositionY(), active->GetPositionZ());
|
||||
}
|
||||
|
||||
Trinity::PlayerRelocationNotifier relocate(*player);
|
||||
viewPoint->VisitNearbyObject(player->GetSightRange()+VISIBILITY_INC_FOR_GOBJECTS, relocate);
|
||||
relocate.SendToSelf();
|
||||
Trinity::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
viewPoint->VisitNearbyObject(player->GetSightRange()+VISIBILITY_INC_FOR_GOBJECTS, relocateNoLarge);
|
||||
relocateNoLarge.SendToSelf();
|
||||
Trinity::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
viewPoint->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, relocateLarge);
|
||||
relocateLarge.SendToSelf();
|
||||
}
|
||||
|
||||
if (Player* player = this->ToPlayer())
|
||||
@@ -19071,9 +19074,12 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
||||
active->m_last_notify_position.Relocate(active->GetPositionX(), active->GetPositionY(), active->GetPositionZ());
|
||||
}
|
||||
|
||||
Trinity::PlayerRelocationNotifier relocate(*player);
|
||||
viewPoint->VisitNearbyObject(player->GetSightRange()+VISIBILITY_INC_FOR_GOBJECTS, relocate);
|
||||
relocate.SendToSelf();
|
||||
Trinity::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
viewPoint->VisitNearbyObject(player->GetSightRange()+VISIBILITY_INC_FOR_GOBJECTS, relocateNoLarge);
|
||||
relocateNoLarge.SendToSelf();
|
||||
Trinity::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
viewPoint->VisitNearbyObject(MAX_VISIBILITY_DISTANCE, relocateLarge);
|
||||
relocateLarge.SendToSelf();
|
||||
|
||||
this->AddToNotify(NOTIFY_AI_RELOCATION);
|
||||
}
|
||||
@@ -19093,7 +19099,7 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
||||
unit->m_last_notify_position.Relocate(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ());
|
||||
|
||||
Trinity::CreatureRelocationNotifier relocate(*unit);
|
||||
unit->VisitNearbyObject(unit->GetMap()->GetVisibilityRange(), relocate);
|
||||
unit->VisitNearbyObject(unit->GetVisibilityRange()+VISIBILITY_COMPENSATION, relocate);
|
||||
|
||||
this->AddToNotify(NOTIFY_AI_RELOCATION);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user