Skip to content

Commit

Permalink
-Crash fix: When a non-randombot sends back items it sent to itself.
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlikely4r committed Dec 14, 2023
1 parent 1acae60 commit 457b19a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion playerbot/strategy/actions/CheckMailAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ bool CheckMailAction::Execute(Event& event)
bot->GetSession()->HandleQueryNextMailTime(p);

list<uint32> ids;

PlayerMails mails;

//Fetch mails first and then loop over them to prevent needing to check mails sent to self.
for (PlayerMails::iterator i = bot->GetMailBegin(); i != bot->GetMailEnd(); ++i)
{
Mail* mail = *i;
mails.push_back(*i);
}

for (auto & mail : mails)
{
if (!mail || mail->state == MAIL_STATE_DELETED)
continue;

Expand Down

0 comments on commit 457b19a

Please sign in to comment.