fix(Core/Chat): add missing Eluna chat api (#8821)

This commit is contained in:
Kargatum
2021-10-30 00:38:06 +07:00
committed by GitHub
parent 9e144a49c6
commit 67b3ac442a

View File

@@ -21,13 +21,16 @@
#include "DBCStores.h"
#include "DatabaseEnv.h"
#include "Log.h"
#include "Map.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "StringFormat.h"
#include "Tokenize.h"
#include "WorldSession.h"
#ifdef ELUNA
#include "LuaEngine.h"
#endif
using ChatSubCommandMap = std::map<std::string_view, Acore::Impl::ChatCommands::ChatCommandNode, StringCompareLessI_T>;
void Acore::Impl::ChatCommands::ChatCommandNode::LoadFromBuilder(ChatCommandBuilder const& builder)
@@ -333,12 +336,26 @@ namespace Acore::Impl::ChatCommands
}
else if (!handler.HasSentErrorMessage())
{ /* invocation failed, we should show usage */
#ifdef ELUNA
if (!sEluna->OnCommand(handler.IsConsole() ? nullptr : handler.GetSession()->GetPlayer(), std::string(cmdStr).c_str()))
{
return true;
}
#endif
cmd->SendCommandHelp(handler);
handler.SetSentErrorMessage(true);
}
return true;
}
#ifdef ELUNA
if (!sEluna->OnCommand(handler.IsConsole() ? nullptr : handler.GetSession()->GetPlayer(), std::string(cmdStr).c_str()))
{
return true;
}
#endif
return false;
}