Skip to content

Commit

Permalink
-Debug mail feature: Using 'cdebug mail <param>' now allows bots to a…
Browse files Browse the repository at this point in the history
…ccess mailboxes when they are not near one.
  • Loading branch information
mostlikely4r committed Sep 25, 2024
1 parent 25d0b62 commit f3a9f23
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions playerbot/strategy/actions/DebugAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,17 @@ bool DebugAction::Execute(Event& event)

return true;
}
else if (text.find("mail") == 0)
{
std::string param = "";
if (text.length() > 5)
{
param = text.substr(6);
}

bool doAction = ai->DoSpecificAction("mail", Event("debug", param.empty() ? "?" : param), true);
return doAction;
}
else if (text.find("poi ") == 0)
{
WorldPosition botPos = WorldPosition(bot);
Expand Down
2 changes: 1 addition & 1 deletion playerbot/strategy/actions/MailAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ bool MailAction::Execute(Event& event)
if (!requester && event.getSource() != "rpg action")
return false;

if (!MailProcessor::FindMailbox(ai))
if (!MailProcessor::FindMailbox(ai) && event.getSource() != "debug")
{
ai->TellError(requester, "There is no mailbox nearby");
return false;
Expand Down

0 comments on commit f3a9f23

Please sign in to comment.