From 7fb3f4104b679396e737edda6efe7eede71db4a2 Mon Sep 17 00:00:00 2001 From: Niam5 Date: Fri, 13 Oct 2023 17:51:41 -0500 Subject: [PATCH] Add SendMail hook -Update Eluna submodule Co-Authored-By: Foereaper <2131987+foereaper@users.noreply.github.com> --- src/game/LuaEngine | 2 +- src/game/Mails/MailHandler.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/game/LuaEngine b/src/game/LuaEngine index 3b9cf46747..752db0d85e 160000 --- a/src/game/LuaEngine +++ b/src/game/LuaEngine @@ -1 +1 @@ -Subproject commit 3b9cf46747b5d7003c915a8074f9e26f8ca070a0 +Subproject commit 752db0d85e016e8b948f51a07454a5824a97f8ec diff --git a/src/game/Mails/MailHandler.cpp b/src/game/Mails/MailHandler.cpp index 0a86c9fce5..2ae2433fa5 100644 --- a/src/game/Mails/MailHandler.cpp +++ b/src/game/Mails/MailHandler.cpp @@ -38,6 +38,9 @@ #include "Server/Opcodes.h" #include "Chat/Chat.h" #include "Anticheat/Anticheat.hpp" +#ifdef BUILD_ELUNA +#include "LuaEngine/LuaEngine.h" +#endif #define MAX_INBOX_CLIENT_UI_CAPACITY 50 @@ -210,6 +213,14 @@ void WorldSession::HandleSendMail(WorldPacket& recv_data) } } +#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 + m_anticheat->Mail(subject, body, rc); pl->SendMailResult(0, MAIL_SEND, MAIL_OK);