Rearrange the offset cheat prevention.

Rather than (expensively) setting the cvars to 0 every frame, just ignore
their values in multiplayer mode.
This commit is contained in:
Bill Currie 2012-05-21 22:08:54 +09:00
parent e7c3ae911f
commit 65bb35509f

View file

@ -649,10 +649,13 @@ V_CalcRefdef (void)
AngleVectors (angles, forward, right, up);
for (i = 0; i < 3; i++) {
r_data->refdef->vieworg[i] += scr_ofsx->value * forward[i] +
scr_ofsy->value * right[i] +
scr_ofsz->value * up[i];
// don't allow cheats in multiplayer
if (cl.maxclients == 1) {
for (i = 0; i < 3; i++) {
r_data->refdef->vieworg[i] += scr_ofsx->value * forward[i] +
scr_ofsy->value * right[i] +
scr_ofsz->value * up[i];
}
}
V_BoundOffsets ();
@ -729,13 +732,6 @@ V_RenderView (void)
if (cls.state != ca_active)
return;
// don't allow cheats in multiplayer
if (cl.maxclients > 1) {
Cvar_Set (scr_ofsx, "0");
Cvar_Set (scr_ofsy, "0");
Cvar_Set (scr_ofsz, "0");
}
if (cl.intermission) { // intermission / finale rendering
V_CalcIntermissionRefdef ();
} else {