Skip to content

Commit

Permalink
Add SendMail hook
Browse files Browse the repository at this point in the history
-Update Eluna submodule

Co-Authored-By: Foereaper <[email protected]>
  • Loading branch information
Niam5 and Foereaper committed Oct 13, 2023
1 parent fccfac9 commit 31fd967
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/game/LuaEngine
11 changes: 11 additions & 0 deletions src/game/Mails/MailHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
#include "Server/WorldSession.h"
#include "Server/Opcodes.h"
#include "Chat/Chat.h"
#ifdef BUILD_ELUNA
#include "LuaEngine/LuaEngine.h"
#endif

bool WorldSession::CheckMailBox(ObjectGuid guid)
{
Expand Down Expand Up @@ -289,6 +292,14 @@ void WorldSession::HandleSendMail(WorldPacket& recv_data)
items[i] = item;
}

#ifdef BUILD_ELUNA
if (!sEluna->OnSendMail(pl, rc))
{
pl->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_CANT_DO_RIGHT_NOW);
return;
}
#endif

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

pl->ModifyMoney(-int64(reqmoney));
Expand Down

0 comments on commit 31fd967

Please sign in to comment.