From 51d33687ba98772fc8bda2383812e566fc0b41e4 Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Sun, 2 Jan 2022 23:51:20 +0100 Subject: [PATCH] Notify console command --- src/client/component/game_console.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/client/component/game_console.cpp b/src/client/component/game_console.cpp index f1888d96..eb840124 100644 --- a/src/client/component/game_console.cpp +++ b/src/client/component/game_console.cpp @@ -497,6 +497,15 @@ namespace game_console void execute(const char* cmd) { + if (game::CL_IsCgameInitialized()) + { + std::string cmd_ = cmd; + scheduler::once([cmd_]() + { + scripting::notify(*game::levelEntityId, "console_command", {cmd_}); + }, scheduler::pipeline::server); + } + game::Cbuf_AddText(0, utils::string::va("%s \n", cmd)); }