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 (https://github.com/TrinityCore/TrinityCore/commit/c6cd272505cdca5d21935ba346df82b8c767fb13) 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:
@@ -11586,7 +11586,6 @@ void Player::SendInitialPacketsAfterAddToMap()
|
|||||||
SendMessageToSet(&data2, true);
|
SendMessageToSet(&data2, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetAurasForTarget(this);
|
|
||||||
SendEnchantmentDurations(); // must be after add to map
|
SendEnchantmentDurations(); // must be after add to map
|
||||||
SendItemDurations(); // must be after add to map
|
SendItemDurations(); // must be after add to map
|
||||||
SendQuestGiverStatusMultiple();
|
SendQuestGiverStatusMultiple();
|
||||||
@@ -11967,9 +11966,9 @@ void Player::learnSkillRewardedSpells(uint32 skill_id, uint32 skill_value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::GetAurasForTarget(Unit* target) // pussywizard: contact before changing ANYTHING!
|
void Player::GetAurasForTarget(Unit* target, bool force /*= false*/)
|
||||||
{
|
{
|
||||||
if (!target/* || target->GetVisibleAuras()->empty()*/) // speedup things
|
if (!target || (!force && target->GetVisibleAuras()->empty())) // speedup things
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/*! Blizz sends certain movement packets sometimes even before CreateObject
|
/*! Blizz sends certain movement packets sometimes even before CreateObject
|
||||||
|
|||||||
@@ -2183,7 +2183,7 @@ public:
|
|||||||
void SendBGWeekendWorldStates();
|
void SendBGWeekendWorldStates();
|
||||||
void SendBattlefieldWorldStates();
|
void SendBattlefieldWorldStates();
|
||||||
|
|
||||||
void GetAurasForTarget(Unit* target);
|
void GetAurasForTarget(Unit* target, bool force = false);
|
||||||
|
|
||||||
PlayerMenu* PlayerTalkClass;
|
PlayerMenu* PlayerTalkClass;
|
||||||
std::vector<ItemSetEffect*> ItemSetEff;
|
std::vector<ItemSetEffect*> ItemSetEff;
|
||||||
|
|||||||
@@ -2525,6 +2525,7 @@ void Map::SendInitSelf(Player* player)
|
|||||||
{
|
{
|
||||||
LOG_DEBUG("maps", "Creating player data for himself {}", player->GetGUID().ToString());
|
LOG_DEBUG("maps", "Creating player data for himself {}", player->GetGUID().ToString());
|
||||||
|
|
||||||
|
WorldPacket packet;
|
||||||
UpdateData data;
|
UpdateData data;
|
||||||
|
|
||||||
// attach to player data current transport 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)
|
// build data for self presence in world at own client (one time for map)
|
||||||
player->BuildCreateUpdateBlockForPlayer(&data, player);
|
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
|
// 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())
|
if (Transport* transport = player->GetTransport())
|
||||||
for (Transport::PassengerSet::const_iterator itr = transport->GetPassengers().begin(); itr != transport->GetPassengers().end(); ++itr)
|
for (Transport::PassengerSet::const_iterator itr = transport->GetPassengers().begin(); itr != transport->GetPassengers().end(); ++itr)
|
||||||
if (player != (*itr) && player->HaveAtClient(*itr))
|
if (player != (*itr) && player->HaveAtClient(*itr))
|
||||||
(*itr)->BuildCreateUpdateBlockForPlayer(&data, player);
|
(*itr)->BuildCreateUpdateBlockForPlayer(&data, player);
|
||||||
|
|
||||||
WorldPacket packet;
|
|
||||||
data.BuildPacket(&packet);
|
data.BuildPacket(&packet);
|
||||||
player->GetSession()->SendPacket(&packet);
|
player->SendDirectMessage(&packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Map::SendInitTransports(Player* player)
|
void Map::SendInitTransports(Player* player)
|
||||||
|
|||||||
Reference in New Issue
Block a user