From 67136f0171f799e2189a13035a7d100df9a77d42 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 15 Oct 2015 08:44:47 +1000 Subject: [PATCH] Disable the server's ability to adjust the client's view model alignment --- defaultXonotic.cfg | 1 - qcsrc/server/autocvars.qh | 1 - qcsrc/server/miscfunctions.qc | 35 ++++++++++------------------------- 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 3735e5534..74b8541b4 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -410,7 +410,6 @@ pausable 0 set g_spawnshieldtime 1 "number of seconds you are invincible after you spawned, this shield is lost after you fire" set g_antilag 2 "AntiLag (0 = no AntiLag, 1 = verified client side hit scan, 2 = server side hit scan in the past, 3 = unverified client side hit scan)" set g_antilag_nudge 0 "don't touch" -set g_shootfromclient 2 "let client decide if it has the gun left or right; if set to 2, center handedness is allowed; see also cl_gunalign" set g_shootfromeye 0 "shots are fired from your eye/crosshair; visual gun position can still be influenced by cl_gunalign 1 and 2" set g_shootfromcenter 0 "weapon gets moved to the center, shots still come from the barrel of your weapon; visual gun position can still be influenced by cl_gunalign 1 and 2" set g_shootfromfixedorigin "" "if set to a string like 0 y z, the gun is moved to the given y and z coordinates. If set to a string like x y z, the whole shot origin is used" diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index affd9437e..dbdf4fd5c 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -461,7 +461,6 @@ float autocvar_g_respawn_ghosts_speed; int autocvar_g_respawn_waves; bool autocvar_g_running_guns; bool autocvar_g_shootfromcenter; -int autocvar_g_shootfromclient; bool autocvar_g_shootfromeye; string autocvar_g_shootfromfixedorigin; int autocvar_g_showweaponspawns; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 43036b409..74eb09f5e 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -1566,40 +1566,25 @@ vector shotorg_adjustfromclient(vector vecs, float y_is_right, float allowcenter vector shotorg_adjust_values(vector vecs, float y_is_right, float visual, float algn) { string s; - vector v; - if (autocvar_g_shootfromeye) - { - if (visual) - { - if (autocvar_g_shootfromclient) { vecs = shotorg_adjustfromclient(vecs, y_is_right, (autocvar_g_shootfromclient >= 2), algn); } - else { vecs.y = 0; vecs.z -= 2; } - } - else - { - vecs.y = 0; - vecs.z = 0; - } - } - else if (autocvar_g_shootfromcenter) + if(visual) + vecs = shotorg_adjustfromclient(vecs, y_is_right, true, algn); + else if(autocvar_g_shootfromeye) + vecs.y = vecs.z = 0; + else if(autocvar_g_shootfromcenter) { vecs.y = 0; vecs.z -= 2; } - else if ((s = autocvar_g_shootfromfixedorigin) != "") + else if((s = autocvar_g_shootfromfixedorigin) != "") { - v = stov(s); - if (y_is_right) - v.y = -v.y; - if (v.x != 0) - vecs.x = v.x; + vector v = stov(s); + if(y_is_right) { v.y = -v.y; } + if(v.x != 0) { vecs.x = v.x; } vecs.y = v.y; vecs.z = v.z; } - else if (autocvar_g_shootfromclient) - { - vecs = shotorg_adjustfromclient(vecs, y_is_right, (autocvar_g_shootfromclient >= 2), algn); - } + return vecs; } -- 2.39.2