From 8f9e668225fda2775d6556a66b687c3acc299f62 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Wed, 3 Aug 2022 01:47:29 +0200 Subject: Only set a ConVar (ignoring ConCommand) if SERVERDATA_REQUEST_SETVALUE is submitted --- NorthstarDedicatedTest/sv_rcon.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/NorthstarDedicatedTest/sv_rcon.cpp b/NorthstarDedicatedTest/sv_rcon.cpp index ef855af5..a3a3b8f8 100644 --- a/NorthstarDedicatedTest/sv_rcon.cpp +++ b/NorthstarDedicatedTest/sv_rcon.cpp @@ -477,12 +477,15 @@ void CRConServer::ProcessMessage(const cl_rcon::request& cl_request) //----------------------------------------------------------------------------- void CRConServer::Execute(const cl_rcon::request& cl_request, bool bConVar) const { - ConVar* pConVar = g_pCVar->FindVar(cl_request.requestbuf().c_str()); - if (pConVar) // Set value without running the callback. + if (bConVar) { - pConVar->SetValue(cl_request.requestval().c_str()); + ConVar* pConVar = g_pCVar->FindVar(cl_request.requestbuf().c_str()); + if (pConVar) // Set value without running the callback. + { + pConVar->SetValue(cl_request.requestval().c_str()); + } } - else if (!bConVar) // Execute command with "". + else // Execute command with "". { Cbuf_AddText(Cbuf_GetCurrentPlayer(), cl_request.requestbuf().c_str(), cmd_source_t::kCommandSrcCode); Cbuf_Execute(); -- cgit v1.2.3