fix(Core/Commands): partially fix an issue with mails sent from console never showing up the 'Customer Support' sender in-game (#8064)

This commit is contained in:
Skjalf
2021-10-04 10:44:04 -03:00
committed by GitHub
parent 085fc0a1a7
commit c55c5e668f

View File

@@ -2691,8 +2691,10 @@ public:
std::string subject = msgSubject;
std::string text = msgText;
// from console show not existed sender
MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUID().GetCounter() : 0, MAIL_STATIONERY_GM);
ObjectGuid::LowType senderGuid;
// If the message is sent from console, set it as sent by the target itself, like the other Customer Support mails.
senderGuid = handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUID().GetCounter() : targetGuid.GetCounter();
MailSender sender(MAIL_NORMAL, senderGuid, MAIL_STATIONERY_GM);
//- TODO: Fix poor design
CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
@@ -2789,8 +2791,10 @@ public:
}
}
// from console show not existed sender
MailSender sender(MAIL_NORMAL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUID().GetCounter() : 0, MAIL_STATIONERY_GM);
ObjectGuid::LowType senderGuid;
// If the message is sent from console, set it as sent by the target itself, like the other Customer Support mails.
senderGuid = handler->GetSession() ? handler->GetSession()->GetPlayer()->GetGUID().GetCounter() : receiverGuid.GetCounter();
MailSender sender(MAIL_NORMAL, senderGuid, MAIL_STATIONERY_GM);
// fill mail
MailDraft draft(subject, text);