From c0e19dddfd7e7a4b7203423f381b7b096dda18fd Mon Sep 17 00:00:00 2001 From: FutureRave Date: Thu, 10 Mar 2022 20:16:57 +0000 Subject: [PATCH] I don't think it is necessary to clear the commands. S1x does not do it --- src/module/command.cpp | 11 ----------- src/module/command.hpp | 1 - 2 files changed, 12 deletions(-) diff --git a/src/module/command.cpp b/src/module/command.cpp index 6cf152e..540e65e 100644 --- a/src/module/command.cpp +++ b/src/module/command.cpp @@ -174,15 +174,4 @@ void command::post_load() } } -void command::pre_destroy() -{ - for (const auto& [key, val] : command::handlers) - { - game::native::Cmd_RemoveCommand(key.data()); - handlers.erase(key); - } - - command::allocator_.clear(); -} - REGISTER_MODULE(command); diff --git a/src/module/command.hpp b/src/module/command.hpp index f7ec1a4..3720d64 100644 --- a/src/module/command.hpp +++ b/src/module/command.hpp @@ -51,7 +51,6 @@ public: static void add_sv(const char* name, std::function callback); void post_load() override; - void pre_destroy() override; private: static utils::memory::allocator allocator_;