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.
This commit is contained in:
Kawe Mazidjatari 2024-12-05 15:57:48 +01:00
parent 3d8d0b37a6
commit 9939d963ef

View File

@ -25,6 +25,8 @@
#include <ebisusdk/EbisuSDK.h>
#include <engine/cmd.h>
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
)
{