fix(Core/GridNotifiers): increased visibility for large creatures, part 2 (#2378)

This commit is contained in:
Stoabrogga
2019-11-14 08:04:41 +01:00
committed by GitHub
parent 23b77c1303
commit fae7ae95a3
6 changed files with 37 additions and 13 deletions

View File

@@ -23,6 +23,8 @@ void VisibleNotifier::Visit(GameObjectMapType &m)
{
for (GameObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
if (i_largeOnly != iter->GetSource()->IsVisibilityOverridden())
continue;
vis_guids.erase(iter->GetSource()->GetGUID());
i_player.UpdateVisibilityOf(iter->GetSource(), i_data, i_visibleNow);
}
@@ -35,6 +37,9 @@ void VisibleNotifier::SendToSelf()
if (Transport* transport = i_player.GetTransport())
for (Transport::PassengerSet::const_iterator itr = transport->GetPassengers().begin(); itr != transport->GetPassengers().end();++itr)
{
if (i_largeOnly != (*itr)->IsVisibilityOverridden())
continue;
if (vis_guids.find((*itr)->GetGUID()) != vis_guids.end())
{
vis_guids.erase((*itr)->GetGUID());
@@ -59,6 +64,9 @@ void VisibleNotifier::SendToSelf()
for (Player::ClientGUIDs::const_iterator it = vis_guids.begin();it != vis_guids.end(); ++it)
{
if (i_largeOnly != ObjectAccessor::GetWorldObject(i_player, *it)->IsVisibilityOverridden())
continue;
// pussywizard: static transports are removed only in RemovePlayerFromMap and here if can no longer detect (eg. phase changed)
if (IS_TRANSPORT_GUID(*it))
if (GameObject* staticTrans = i_player.GetMap()->GetGameObject(*it))
@@ -84,7 +92,11 @@ void VisibleNotifier::SendToSelf()
i_player.GetSession()->SendPacket(&packet);
for (std::vector<Unit*>::const_iterator it = i_visibleNow.begin(); it != i_visibleNow.end(); ++it)
{
if (i_largeOnly != (*it)->IsVisibilityOverridden())
continue;
i_player.GetInitialVisiblePackets(*it);
}
}
void VisibleChangesNotifier::Visit(PlayerMapType &m)