]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a check to ObserverThink() function to automatically change the movetype of the...
authorSamual <samual@xonotic.org>
Mon, 16 May 2011 17:37:44 +0000 (13:37 -0400)
committerSamual <samual@xonotic.org>
Mon, 16 May 2011 17:37:44 +0000 (13:37 -0400)
defaultXonotic.cfg
qcsrc/server/cl_client.qc
qcsrc/server/defs.qh
qcsrc/server/miscfunctions.qc

index 8783944f8cead1fc318964af3ec80538f2dad395..7c3fb2100a8786f556f27c525ce1f554fa736507 100644 (file)
@@ -1712,9 +1712,9 @@ alias gl_flashblend_update "_gl_flashblend_update_$r_shadow_realtime_dlight$r_sh
 
 set sv_clones 0        "number of clones a player may make (reset by the \"kill\" command)"
 
-set cl_handicap 1      "the higher, the more damage you will receive (client setting)"
+set cl_handicap 1      "the higher, the more damage you will receive (client setting) NOTE: reconnect or use sendcvar command to update the choice."
 
-seta cl_noclipspectating 0 "noclip for spectators so that you can pass through walls and such. (client setting)
+seta cl_clippedspectating 1 "movement collision for spectators so that you can't pass through walls and such. (client setting) NOTE: reconnect or use sendcvar command to update the choice.
 
 // must be at the bottom of this file:
 // alias for switching the teamselect menu
index 16d6a25f16c505fd3afc1aa22105e29ad268df3d..d884c6d6173cd8b65dbcae9bb42f0f48628bbf1f 100644 (file)
@@ -659,7 +659,7 @@ void PutObserverInServer (void)
        self.health = -666;
        self.takedamage = DAMAGE_NO;
        self.solid = SOLID_NOT;
-       self.movetype = (self.cvar_cl_noclipspectating ? MOVETYPE_NOCLIP : MOVETYPE_FLY);
+       self.movetype = MOVETYPE_FLY; //(self.cvar_cl_clippedspectating ? MOVETYPE_NOCLIP : MOVETYPE_FLY); // it's too early for this anyway, lets just set it in playerprethink
        self.flags = FL_CLIENT | FL_NOTARGET;
        self.armorvalue = 666;
        self.effects = 0;
@@ -2519,6 +2519,7 @@ void checkSpectatorBlock() {
 
 void ObserverThink()
 {
+       float prefered_movetype;
        if (self.flags & FL_JUMPRELEASED) {
                if (self.BUTTON_JUMP && !self.version_mismatch) {
                        self.welcomemessage_time = 0;
@@ -2530,6 +2531,10 @@ void ObserverThink()
                        if(SpectateNext() == 1) {
                                self.classname = "spectator";
                        }
+               } else {
+                       prefered_movetype = (self.cvar_cl_clippedspectating ? MOVETYPE_FLY : MOVETYPE_NOCLIP);
+                       if (self.movetype != prefered_movetype)
+                               self.movetype = prefered_movetype;
                }
        } else {
                if (!(self.BUTTON_ATCK || self.BUTTON_JUMP)) {
index 92872dc659ff27e09ba2b020387ba0e75ac51335..a4ee43babaad69272323640ff3b8177b1845378e 100644 (file)
@@ -314,7 +314,7 @@ float default_weapon_alpha;
 .float cvar_cl_playerdetailreduction;
 .float cvar_scr_centertime;
 .float cvar_cl_shownames;
-.float cvar_cl_noclipspectating;
+.float cvar_cl_clippedspectating;
 
 .string cvar_g_xonoticversion;
 .string cvar_cl_weaponpriority;
index 4679f9264430e1284b400dd5965de583f814e11b..a797451439a845f4f8e77a0e0669582ce612750e 100644 (file)
@@ -582,7 +582,7 @@ void GetCvars(float f)
        GetCvars_handleFloat(s, f, cvar_scr_centertime, "scr_centertime");
        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_handleFloat(s, f, cvar_cl_clippedspectating, "cl_clippedspectating");
        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);