engine: common: cmd: consider filtered buffer privileged when we're running local singleplayer game

This commit is contained in:
Alibek Omarov 2024-12-20 05:48:33 +03:00
parent ce06b1d3d7
commit e751092555

View file

@ -263,10 +263,16 @@ Cbuf_Execute
void Cbuf_Execute( void ) void Cbuf_Execute( void )
{ {
Cbuf_ExecuteCommandsFromBuffer( &cmd_text, true, -1 ); Cbuf_ExecuteCommandsFromBuffer( &cmd_text, true, -1 );
// a1ba: unlimited commands for filtered buffer per frame
// a1ba: goldsrc limits unprivileged commands per frame to 1 here
// I don't see any sense in restricting that at this moment // I don't see any sense in restricting that at this moment
// but in future we may limit this // but in future we may limit this
Cbuf_ExecuteCommandsFromBuffer( &filteredcmd_text, false, -1 );
// a1ba: there is little to no sense limit privileged commands in
// local game, as client runs server code anyway
// do this for singleplayer only though, to make it easier to catch
// possible bugs during local multiplayer testing
Cbuf_ExecuteCommandsFromBuffer( &filteredcmd_text, SV_Active() && SV_GetMaxClients() == 1, -1 );
} }
/* /*