]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
client setting to control whether or not they use noclip movement while spectating..
authorSamual <samual@xonotic.org>
Thu, 12 May 2011 23:55:53 +0000 (19:55 -0400)
committerSamual <samual@xonotic.org>
Thu, 12 May 2011 23:55:53 +0000 (19:55 -0400)
only problem is that putobserverinserver is run BEFORE getcvars can be completed, thus upon first join whatever setting you choose it doesn't matter :( There really is no way to fix this I think as it will always take time to get the cvars.. This is still a lesser evil than ONLY having a server side option, but..

defaultXonotic.cfg
qcsrc/server/cl_client.qc
qcsrc/server/defs.qh
qcsrc/server/miscfunctions.qc

index 65a6554e0a282854f0bc839930a4023077d375c5..3e7a16d3127e9afad7579f03c9fd1a63d00ec786 100644 (file)
@@ -1680,6 +1680,8 @@ set sv_clones 0   "number of clones a player may make (reset by the \"kill\" comma
 
 set cl_handicap 1      "the higher, the more damage you will receive (client setting)"
 
+seta cl_noclipspectating 0 "noclip for spectators so that you can pass through walls and such. (client setting)" 
+
 // must be at the bottom of this file:
 // alias for switching the teamselect menu
 alias menu_showteamselect "menu_cmd directmenu TeamSelect"
index 8a3aea874bb867084483958b808c27ff6d843449..2f6e4858f9a0114b1f7d8bf5f9698f5bafc2d177 100644 (file)
@@ -653,13 +653,13 @@ void PutObserverInServer (void)
        accuracy_resend(self);
 
        self.spectatortime = time;
-
+       
        self.classname = "observer";
        self.iscreature = FALSE;
        self.health = -666;
        self.takedamage = DAMAGE_NO;
        self.solid = SOLID_NOT;
-       self.movetype = MOVETYPE_FLY;
+       self.movetype = (self.cvar_cl_noclipspectating ? MOVETYPE_NOCLIP : MOVETYPE_FLY);
        self.flags = FL_CLIENT | FL_NOTARGET;
        self.armorvalue = 666;
        self.effects = 0;
index cf13fee2c67cc944407e4921e3ee79af2f225cc8..ca530a991837d2668627ee83bd78a8fbcb455cbb 100644 (file)
@@ -311,6 +311,7 @@ float default_weapon_alpha;
 .float cvar_cl_playerdetailreduction;
 .float cvar_scr_centertime;
 .float cvar_cl_shownames;
+.float cvar_cl_noclipspectating;
 .string cvar_g_xonoticversion;
 .string cvar_cl_weaponpriority;
 .string cvar_cl_weaponpriorities[10];
index 0c8162b54464275c9df9537dd1aad11d4f9af682..d599c259cd97b0688900d7fbaa6c57ad567ab708 100644 (file)
@@ -588,6 +588,7 @@ void GetCvars(float f)
        GetCvars_handleFloat(s, f, cvar_cl_shownames, "cl_shownames");
        GetCvars_handleString(s, f, cvar_g_xonoticversion, "g_xonoticversion");
        GetCvars_handleFloat(s, f, cvar_cl_handicap, "cl_handicap");
+       GetCvars_handleFloat(s, f, cvar_cl_noclipspectating, "cl_noclipspectating");
        GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriority, "cl_weaponpriority", W_FixWeaponOrder_ForceComplete_AndBuildImpulseList);
        GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriorities[0], "cl_weaponpriority0", W_FixWeaponOrder_AllowIncomplete);
        GetCvars_handleString_Fixup(s, f, cvar_cl_weaponpriorities[1], "cl_weaponpriority1", W_FixWeaponOrder_AllowIncomplete);