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

@@ -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);
}