From 56a76bf9c2cbecb8d9840cede2d02a74688a8e06 Mon Sep 17 00:00:00 2001 From: Flerp Date: Sat, 25 Oct 2025 00:51:38 -0700 Subject: [PATCH] more stealing cause I know nothing --- src/loader.cpp | 6 +----- src/teleport-to-node.cpp | 22 +++++++--------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/loader.cpp b/src/loader.cpp index 36d2912..6ec3c12 100644 --- a/src/loader.cpp +++ b/src/loader.cpp @@ -1,10 +1,6 @@ -/* - * AzerothCore module loader for mod-teleport-to-node - */ - +// src/loader.cpp void AddSC_telenode_commandscript(); -// Called by the module system; name can be anything, just referenced in CMake void Addmod_teleport_to_nodeScripts() { AddSC_telenode_commandscript(); diff --git a/src/teleport-to-node.cpp b/src/teleport-to-node.cpp index 7bf759f..7f6b30c 100644 --- a/src/teleport-to-node.cpp +++ b/src/teleport-to-node.cpp @@ -1,19 +1,16 @@ /* - * MIT-style module command following AzerothCore boilerplate + * MIT-style module command following AzerothCore boilerplate (std::vector) */ #include "ScriptMgr.h" #include "CommandScript.h" #include "Chat.h" -#include "ChatCommand.h" #include "Player.h" #include "GameObject.h" #include #include -using namespace Acore::ChatCommands; - namespace { // === CONFIG === @@ -84,22 +81,17 @@ class telenode_commandscript : public CommandScript public: telenode_commandscript() : CommandScript("telenode_commandscript") { } - // EXACTLY like the AzerothCore boilerplate: a ChatCommandTable + static handler fn - ChatCommandTable GetCommands() const override + // EXACTLY like the AzerothCore boilerplate: std::vector + std::vector GetCommands() const override { - static ChatCommandTable commandTable = + static std::vector commandTable = { - // .telenode - { "telenode", - SEC_PLAYER, // security (adjust via DB if you want) - Console::No, // no console by default - &HandleTeleNode, // function pointer (NOT a lambda) - "" } // help text (optional) + // { name, security, allowConsole, handler, help } + { "telenode", SEC_PLAYER, false, &HandleTeleNode, "" }, }; return commandTable; } - // Boilerplate-compatible handler signature static bool HandleTeleNode(ChatHandler* handler, char const* /*args*/) { 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() { new telenode_commandscript();