fix(Core/Chat): add missing Eluna chat api (#8821)
This commit is contained in:
parent
9e144a49c6
commit
67b3ac442a
1 changed files with 18 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue