Notify console command

This commit is contained in:
Federico Cecchetto 2022-01-02 23:51:20 +01:00
parent 0407c0c059
commit 51d33687ba

View File

@ -497,6 +497,15 @@ namespace game_console
void execute(const char* cmd) 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)); game::Cbuf_AddText(0, utils::string::va("%s \n", cmd));
} }