Skip to content

Commit

Permalink
Fix NPC name in new mail notification when receiving mails from NPCs
Browse files Browse the repository at this point in the history
If a player received a mail from a NPC with the same id as an existing character's guid, the mail notification would show the player's name instead.
  • Loading branch information
Karth-Xyver authored and cyberium committed Feb 1, 2024
1 parent eff384a commit a3186b3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/game/Mails/MailHandler.cpp
Expand Up @@ -824,20 +824,22 @@ void WorldSession::HandleQueryNextMailTime(WorldPacket& /**recv_data*/)
if (now < m->deliver_time)
continue;

data << ObjectGuid(HIGHGUID_PLAYER, m->sender); // sender guid
HighGuid guidType = HIGHGUID_PLAYER;

switch (m->messageType)
{
case MAIL_AUCTION:
data << uint32(m->sender); // auction house id
data << uint32(MAIL_AUCTION); // message type
case MAIL_CREATURE:
guidType = HIGHGUID_UNIT;
break;
default:
data << uint32(0);
data << uint32(0);
case MAIL_GAMEOBJECT:
guidType = HIGHGUID_GAMEOBJECT;
break;
}

data << ObjectGuid(guidType, m->sender); // sender guid
data << static_cast<uint32>(m->sender); // sender id
data << static_cast<uint32>(m->messageType); // message type

data << uint32(m->stationery);
data << uint32(0xC6000000); // float unk, time or something

Expand Down

0 comments on commit a3186b3

Please sign in to comment.