Skip to content

Commit

Permalink
[Game] Fix Web API sending mails causing online characters to not rec…
Browse files Browse the repository at this point in the history
…eive notifications of subsequent backpack item changes (AAEmu#1095)
  • Loading branch information
yanlong-li authored Sep 10, 2024
1 parent aa0a8a3 commit 53b196d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions AAEmu.Game/Services/WebApi/Controllers/MailController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public HttpResponse Send(HttpRequest request)

foreach (var expeditionMember in expedition.Members)
{
var character = Character.Load(expeditionMember.CharacterId);
var character = WorldManager.Instance.GetCharacterById(expeditionMember.CharacterId) ??
Character.Load(expeditionMember.CharacterId);
if (character == null || character.DeleteTime > DateTime.MinValue ||
character.DeleteRequestTime > DateTime.MinValue)
{
Expand Down Expand Up @@ -143,7 +144,8 @@ public HttpResponse Send(HttpRequest request)
{
foreach (uint recipient in mailRequest.Recipients)
{
var character = Character.Load(recipient);
var character = WorldManager.Instance.GetCharacterById(recipient) ??
Character.Load(recipient);
if (character == null || character.DeleteTime > DateTime.MinValue ||
character.DeleteRequestTime > DateTime.MinValue)
{
Expand Down

0 comments on commit 53b196d

Please sign in to comment.