BunnymodXT icon indicating copy to clipboard operation
BunnymodXT copied to clipboard

feature: command to disable checking for cheat cmds when viewing the demo

Open SmileyAG opened this issue 2 years ago • 2 comments

SmileyAG avatar Nov 30 '23 05:11 SmileyAG

So what does this do exactly?

YaLTeR avatar Nov 30 '23 06:11 YaLTeR

So what does this do exactly?

When playbacking demos that recorded in multiplayer, protected cvars would give the Can't set %s in multiplayer console message To fix that, we have to fake our cls.state to pass through the Cvar_Command function and after we can restore it to original state

          if ((((*(byte *)&pcVar4->flags & 0x40) != 0) && (ca_disconnected < cls.state)) &&
             (1 < cl.maxclients)) {
            Con_Printf("Can\'t set %s in multiplayer\n",pcVar4->name);
            return 1;
          }

And, there is R_ForceCvars function which calling only if 1 < cl.maxclients and that forcing values to default for specific list of cvars:

r_lightmap
gl_clear
r_novis
r_fullbright
snd_show
chase_active
lambert
gl_monolights
gl_wireframe
r_dynamic
gl_alphamin
gl_max_size
gl_polyoffset
r_drawentities
lightgamma

To fix that, simply don't call that function, but it contains also the updating of changed gl_monolights in real-time, so you have to call GL_BuildLightmaps function for that reason

SmileyAG avatar Nov 30 '23 06:11 SmileyAG