fix(Core/Chat): add missing Eluna chat api (#8821)
This commit is contained in:
@@ -21,13 +21,16 @@
|
|||||||
#include "DBCStores.h"
|
#include "DBCStores.h"
|
||||||
#include "DatabaseEnv.h"
|
#include "DatabaseEnv.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "Map.h"
|
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
#include "StringFormat.h"
|
#include "StringFormat.h"
|
||||||
#include "Tokenize.h"
|
#include "Tokenize.h"
|
||||||
#include "WorldSession.h"
|
#include "WorldSession.h"
|
||||||
|
|
||||||
|
#ifdef ELUNA
|
||||||
|
#include "LuaEngine.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
using ChatSubCommandMap = std::map<std::string_view, Acore::Impl::ChatCommands::ChatCommandNode, StringCompareLessI_T>;
|
using ChatSubCommandMap = std::map<std::string_view, Acore::Impl::ChatCommands::ChatCommandNode, StringCompareLessI_T>;
|
||||||
|
|
||||||
void Acore::Impl::ChatCommands::ChatCommandNode::LoadFromBuilder(ChatCommandBuilder const& builder)
|
void Acore::Impl::ChatCommands::ChatCommandNode::LoadFromBuilder(ChatCommandBuilder const& builder)
|
||||||
@@ -333,12 +336,26 @@ namespace Acore::Impl::ChatCommands
|
|||||||
}
|
}
|
||||||
else if (!handler.HasSentErrorMessage())
|
else if (!handler.HasSentErrorMessage())
|
||||||
{ /* invocation failed, we should show usage */
|
{ /* 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);
|
cmd->SendCommandHelp(handler);
|
||||||
handler.SetSentErrorMessage(true);
|
handler.SetSentErrorMessage(true);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ELUNA
|
||||||
|
if (!sEluna->OnCommand(handler.IsConsole() ? nullptr : handler.GetSession()->GetPlayer(), std::string(cmdStr).c_str()))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user