more stealing cause I know nothing

This commit is contained in:
Flerp 2025-10-25 00:51:38 -07:00
parent 6014ef5d46
commit 56a76bf9c2
2 changed files with 8 additions and 20 deletions

View File

@ -1,10 +1,6 @@
/* // src/loader.cpp
* AzerothCore module loader for mod-teleport-to-node
*/
void AddSC_telenode_commandscript(); void AddSC_telenode_commandscript();
// Called by the module system; name can be anything, just referenced in CMake
void Addmod_teleport_to_nodeScripts() void Addmod_teleport_to_nodeScripts()
{ {
AddSC_telenode_commandscript(); AddSC_telenode_commandscript();

View File

@ -1,19 +1,16 @@
/* /*
* MIT-style module command following AzerothCore boilerplate * MIT-style module command following AzerothCore boilerplate (std::vector<ChatCommand>)
*/ */
#include "ScriptMgr.h" #include "ScriptMgr.h"
#include "CommandScript.h" #include "CommandScript.h"
#include "Chat.h" #include "Chat.h"
#include "ChatCommand.h"
#include "Player.h" #include "Player.h"
#include "GameObject.h" #include "GameObject.h"
#include <vector> #include <vector>
#include <limits> #include <limits>
using namespace Acore::ChatCommands;
namespace namespace
{ {
// === CONFIG === // === CONFIG ===
@ -84,22 +81,17 @@ class telenode_commandscript : public CommandScript
public: public:
telenode_commandscript() : CommandScript("telenode_commandscript") { } telenode_commandscript() : CommandScript("telenode_commandscript") { }
// EXACTLY like the AzerothCore boilerplate: a ChatCommandTable + static handler fn // EXACTLY like the AzerothCore boilerplate: std::vector<ChatCommand>
ChatCommandTable GetCommands() const override std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommandTable commandTable = static std::vector<ChatCommand> commandTable =
{ {
// .telenode // { name, security, allowConsole, handler, help }
{ "telenode", { "telenode", SEC_PLAYER, false, &HandleTeleNode, "" },
SEC_PLAYER, // security (adjust via DB if you want)
Console::No, // no console by default
&HandleTeleNode, // function pointer (NOT a lambda)
"" } // help text (optional)
}; };
return commandTable; return commandTable;
} }
// Boilerplate-compatible handler signature
static bool HandleTeleNode(ChatHandler* handler, char const* /*args*/) static bool HandleTeleNode(ChatHandler* handler, char const* /*args*/)
{ {
if (!handler) if (!handler)
@ -120,7 +112,7 @@ public:
} }
}; };
// Boilerplate-style exported symbol that your loader will call // Export symbol called by your loader.cpp
void AddSC_telenode_commandscript() void AddSC_telenode_commandscript()
{ {
new telenode_commandscript(); new telenode_commandscript();