Skip to content

Commit

Permalink
Add SendMail hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Foereaper committed Oct 13, 2023
1 parent 08e6e2d commit 768b05e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/server/game/Handlers/MailHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
#include "Player.h"
#include "World.h"
#include "WorldPacket.h"
#ifdef ELUNA
#include "LuaEngine.h"
#endif

bool WorldSession::CanOpenMailBox(ObjectGuid guid)
{
Expand Down Expand Up @@ -225,6 +228,14 @@ void WorldSession::HandleSendMail(WorldPackets::Mail::SendMail& sendMail)
items.push_back(item);
}

#ifdef ELUNA
if (!sEluna->OnSendMail(player, receiverGuid))
{
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_CANT_DO_RIGHT_NOW);
return;
}
#endif

player->SendMailResult(0, MAIL_SEND, MAIL_OK);

player->ModifyMoney(-int32(reqmoney));
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/LuaEngine

0 comments on commit 768b05e

Please sign in to comment.