From 9939d963efa13332a1b9c2cf0d53bd90bc772ed1 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Thu, 5 Dec 2024 15:57:48 +0100 Subject: [PATCH] Engine: properly detect if we are in single player mode This check is meant to drop the restrictions if we are in single player mode, we should however properly check in this by checking the actual game mode rather than if the listen server is running. --- src/engine/client/clientstate.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/engine/client/clientstate.cpp b/src/engine/client/clientstate.cpp index dacb028e..d32d80b7 100644 --- a/src/engine/client/clientstate.cpp +++ b/src/engine/client/clientstate.cpp @@ -25,6 +25,8 @@ #include #include +extern CGlobalVarsBase* gpGlobals; + //------------------------------------------------------------------------------ // Purpose: console command callbacks //------------------------------------------------------------------------------ @@ -234,7 +236,8 @@ bool CClientState::_ProcessStringCmd(CClientState* thisptr, NET_StringCmd* msg) if (thisptr_ADJ->m_bRestrictServerCommands #ifndef CLIENT_DLL - && !g_pServer->IsActive() + // Don't restrict commands from the server in single player + && gpGlobals->gameMode != GameMode_t::SP_MODE #endif // !CLIENT_DLL ) {