mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
fix(Core/Player): Send player's own auras before all visible objects (#15445)
* fix(Core/Player): Send player's own auras before all visible objects
* cherry-pick commit (c6cd272505)
Co-Authored-By: Mikhail Redko <13364438+r4d1sh@users.noreply.github.com>
* Update Map.cpp
* Update src/server/game/Entities/Player/Player.cpp
* Update src/server/game/Entities/Player/Player.cpp
* Update src/server/game/Maps/Map.cpp
---------
Co-authored-by: Mikhail Redko <13364438+r4d1sh@users.noreply.github.com>
This commit is contained in:
@@ -2525,6 +2525,7 @@ void Map::SendInitSelf(Player* player)
|
||||
{
|
||||
LOG_DEBUG("maps", "Creating player data for himself {}", player->GetGUID().ToString());
|
||||
|
||||
WorldPacket packet;
|
||||
UpdateData data;
|
||||
|
||||
// attach to player data current transport data
|
||||
@@ -2534,15 +2535,25 @@ void Map::SendInitSelf(Player* player)
|
||||
// build data for self presence in world at own client (one time for map)
|
||||
player->BuildCreateUpdateBlockForPlayer(&data, player);
|
||||
|
||||
// build and send self update packet before sending to player his own auras
|
||||
data.BuildPacket(&packet);
|
||||
player->SendDirectMessage(&packet);
|
||||
|
||||
// send to player his own auras (this is needed here for timely initialization of some fields on client)
|
||||
player->GetAurasForTarget(player, true);
|
||||
|
||||
// clean buffers for further work
|
||||
packet.clear();
|
||||
data.Clear();
|
||||
|
||||
// build other passengers at transport also (they always visible and marked as visible and will not send at visibility update at add to map
|
||||
if (Transport* transport = player->GetTransport())
|
||||
for (Transport::PassengerSet::const_iterator itr = transport->GetPassengers().begin(); itr != transport->GetPassengers().end(); ++itr)
|
||||
if (player != (*itr) && player->HaveAtClient(*itr))
|
||||
(*itr)->BuildCreateUpdateBlockForPlayer(&data, player);
|
||||
|
||||
WorldPacket packet;
|
||||
data.BuildPacket(&packet);
|
||||
player->GetSession()->SendPacket(&packet);
|
||||
player->SendDirectMessage(&packet);
|
||||
}
|
||||
|
||||
void Map::SendInitTransports(Player* player)
|
||||
|
||||
Reference in New Issue
Block a user