-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: command to disable checking for cheat cmds when viewing the demo #473
base: master
Are you sure you want to change the base?
Conversation
So what does this do exactly? |
When playbacking demos that recorded in multiplayer, protected cvars would give the 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
To fix that, simply don't call that function, but it contains also the updating of changed |
eeba4c9
to
eba65c6
Compare
{ | ||
state = reinterpret_cast<int*>(cls); | ||
orig_state = *state; | ||
*state = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cls.state is kind of an important variable. If you set it to 1, do commands like disconnect, changelevel, etc. still work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a fair point. It would be more rationally to replace it with set cl.maxclients
to 1 instead.
I just didn’t want to make offsets for find that new variable through other functions before, but now I looked at the Cvar_Command
code in more detail, and it actually calls a function for which the cls.state values will affect its code (Cvar_DirectSet
)
In the case of cl.maxplayers
I can't tell at first glance, but even if it may turn out to be the case later, it will be less harmful than changing cls.state
No description provided.