diff options
| author | Mikhail Redko <ovitnez@gmail.com> | 2023-02-25 15:18:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-25 14:18:23 +0100 |
| commit | c6cd272505cdca5d21935ba346df82b8c767fb13 (patch) | |
| tree | 114fb0a53b6bf3b9f874ec8193fa278c9216ab3a /src/server/game/Maps/Map.cpp | |
| parent | e11613eeb5dcad16f5908c9c7dd8109baabe9272 (diff) | |
Core/Misc: Sending player's own auras before all visible objects. (#28450)
* Core/Misc: Sending player's own auras before all visible objects.
This should finally solve the problem of naked characters.
Closes #15159
Many thanks to xvwyh for explaining cause of this bug
* Core/Misc: Force send update auras packet to player when he added to map
Diffstat (limited to 'src/server/game/Maps/Map.cpp')
| -rw-r--r-- | src/server/game/Maps/Map.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 58dcc7e6607..1fc947a43c2 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -2939,6 +2939,7 @@ void Map::SendInitSelf(Player* player) { TC_LOG_DEBUG("maps", "Creating player data for himself %s", player->GetGUID().ToString().c_str()); + WorldPacket packet; UpdateData data; // attach to player data current transport data @@ -2950,13 +2951,23 @@ 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->SendAurasForTarget(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->SendDirectMessage(&packet); } |
