diff options
author | Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> | 2022-08-03 01:47:29 +0200 |
---|---|---|
committer | Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> | 2022-08-03 01:47:29 +0200 |
commit | 8f9e668225fda2775d6556a66b687c3acc299f62 (patch) | |
tree | 7bb7754639a5fc5a42fbd01722f6fcb7f49ad857 | |
parent | 566d3dc33b9c8be39efe429f8ca848f3ff7580ea (diff) | |
download | NorthstarLauncher-8f9e668225fda2775d6556a66b687c3acc299f62.tar.gz NorthstarLauncher-8f9e668225fda2775d6556a66b687c3acc299f62.zip |
Only set a ConVar (ignoring ConCommand) if SERVERDATA_REQUEST_SETVALUE is submitted
-rw-r--r-- | NorthstarDedicatedTest/sv_rcon.cpp | 11 |
1 files 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 "<val>". + else // Execute command with "<val>". { Cbuf_AddText(Cbuf_GetCurrentPlayer(), cl_request.requestbuf().c_str(), cmd_source_t::kCommandSrcCode); Cbuf_Execute(); |