]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/master' into samual/flyingspectators
authorSamual <samual@xonotic.org>
Thu, 19 May 2011 00:08:59 +0000 (20:08 -0400)
committerSamual <samual@xonotic.org>
Thu, 19 May 2011 00:08:59 +0000 (20:08 -0400)
1  2 
defaultXonotic.cfg
qcsrc/server/cl_client.qc
qcsrc/server/cl_physics.qc
qcsrc/server/miscfunctions.qc

diff --combined defaultXonotic.cfg
index 7c3fb2100a8786f556f27c525ce1f554fa736507,1db88b208faf9dd15925c4584a12ac6980257292..0f808b62d29566210f9dd638481ff7e9a6810682
@@@ -1712,9 -1712,7 +1712,9 @@@ alias gl_flashblend_update "_gl_flashbl
  
  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_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
@@@ -2139,7 -2137,7 +2139,7 @@@ alias sRGBcorrect_off "r_texture_sRGB_s
  exec balanceXonotic.cfg
  exec ctfscoring-ai.cfg
  exec effects-normal.cfg
- exec physicsX0.cfg
+ exec physicsX.cfg
  exec turrets.cfg
  
  // hud cvar descriptions
index c5098ea7cb3b9aa1d50b460a4948ba5a3c8f1fc9,561b755c9694b9d2ff05f95fc946dfbd7df31256..58ad1ce286cc044d81b4ab18520f38d06363de33
@@@ -653,13 -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_NOCLIP;
 +      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;
        self.fixangle = TRUE;
        self.crouch = FALSE;
  
 -      self.view_ofs = PL_VIEW_OFS;
 +      self.view_ofs = '0 0 0'; // so that you can't go inside walls with MOVETYPE_FLY, previously "PL_VIEW_OFS" - for some reason this is diff from normal players
        setorigin (self, spot.origin);
 -      setsize (self, '0 0 0', '0 0 0');
 +      setsize (self, '-16 -16 -24', '16 16 24'); // so that you can't go inside walls with MOVETYPE_FLY
        self.prevorigin = self.origin;
        self.items = 0;
        self.weapons = 0;
@@@ -1770,8 -1770,6 +1770,6 @@@ void ClientConnect (void
                set_dom_state(self);
  
        CheatInitClient();
-       PlayerStats_AddPlayer(self);
  }
  
  /*
@@@ -2504,7 -2502,6 +2502,7 @@@ void checkSpectatorBlock() 
  
  void ObserverThink()
  {
 +      float prefered_movetype;
        if (self.flags & FL_JUMPRELEASED) {
                if (self.BUTTON_JUMP && !self.version_mismatch) {
                        self.welcomemessage_time = 0;
                        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 9fbec9299deeeaebbc32aed74d497f75f3152941,e986341cd027eb11b5904f5542d5ab833e8a2ea9..d542f0838fce8f20a7f0019d9e33f798c0fd345b
@@@ -504,7 -504,7 +504,7 @@@ float AdjustAirAccelQW(float accelqw, f
  //   sv_airaccel_sideways_friction 0
  //   prvm_globalset server speedclamp_mode 1
  //     (or 2)
- void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float accel, float accelqw, float sidefric, float speedlimit)
+ void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float accel, float accelqw, float stretchfactor, float sidefric, float speedlimit)
  {
        float vel_straight;
        float vel_z;
        float vel_xy_backward, vel_xy_forward;
        float speedclamp;
  
-       speedclamp = (accelqw < 0);
-       if(speedclamp)
+       if(stretchfactor > 0)
+               speedclamp = stretchfactor;
+       else if(accelqw < 0)
+               speedclamp = 1; // full clamping, no stretch
+       else
+               speedclamp = -1; // no clamping
+       if(accelqw < 0)
                accelqw = -accelqw;
  
        if(autocvar_sv_gameplayfix_q2airaccelerate)
        
        vel_xy = vel_straight * wishdir + vel_perpend;
        
-       if(speedclamp)
+       if(speedclamp >= 0)
        {
-               // ensure we don't get too fast or decelerate faster than we should
-               vel_xy_current = min(vlen(vel_xy), vel_xy_forward);
-               if(vel_xy_current > 0) // prevent division by zero
-                       vel_xy = normalize(vel_xy) * vel_xy_current;
+               float vel_xy_preclamp;
+               vel_xy_preclamp = vlen(vel_xy);
+               if(vel_xy_preclamp > 0) // prevent division by zero
+               {
+                       vel_xy_current += (vel_xy_forward - vel_xy_current) * speedclamp;
+                       if(vel_xy_current < vel_xy_preclamp)
+                               vel_xy = vel_xy * (vel_xy_current / vel_xy_preclamp);
+               }
        }
  
        self.velocity = vel_xy + vel_z * '0 0 1';
@@@ -894,7 -904,6 +904,7 @@@ void SV_PlayerPhysics(
        }
  
        if(self.flags & FL_ONGROUND)
 +      if(self.classname == "player") // no fall sounds for observers thank you very much
        if(self.wasFlying)
        {
                self.wasFlying = 0;
                if (wishspeed > self.stat_sv_maxspeed*maxspd_mod)
                        wishspeed = self.stat_sv_maxspeed*maxspd_mod;
                if (time >= self.teleport_time)
-                       PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0);
+                       PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0, 0);
        }
        else if (self.waterlevel >= WATERLEVEL_SWIMMING)
        {
                self.velocity = self.velocity * (1 - frametime * autocvar_sv_friction);
  
                // water acceleration
-               PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0);
+               PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0, 0);
        }
        else if (time < self.ladder_time)
        {
                if (time >= self.teleport_time)
                {
                        // water acceleration
-                       PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0);
+                       PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0, 0);
                }
        }
        else if ((self.items & IT_JETPACK) && self.BUTTON_HOOK && (!autocvar_g_jetpack_fuel || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO))
                if (self.crouch)
                        wishspeed = wishspeed * 0.5;
                if (time >= self.teleport_time)
-                       PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0);
+                       PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0, 0);
        }
        else
        {
                        if(autocvar_sv_warsowbunny_turnaccel && accelerating && self.movement_y == 0 && self.movement_x != 0)
                                PM_AirAccelerate(wishdir, wishspeed);
                        else
-                               PM_Accelerate(wishdir, wishspeed, wishspeed0, airaccel, airaccelqw, autocvar_sv_airaccel_sideways_friction / maxairspd, self.stat_sv_airspeedlimit_nonqw);
+                               PM_Accelerate(wishdir, wishspeed, wishspeed0, airaccel, airaccelqw, autocvar_sv_airaccel_qw_stretchfactor, autocvar_sv_airaccel_sideways_friction / maxairspd, self.stat_sv_airspeedlimit_nonqw);
  
                        if(autocvar_sv_aircontrol)
                                CPM_PM_Aircontrol(wishdir, wishspeed2);
index a797451439a845f4f8e77a0e0669582ce612750e,6622dea1ff5c6ca9c8cbce3b7114252cb9136ffd..eca38d1ca7d3f60ec32351ff8bcaaae9b369534c
@@@ -582,7 -582,6 +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_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);
        {
                if (s == "cl_weaponpriority")
                        self.switchweapon = w_getbestweapon(self);
+               if (s == "cl_allow_uidtracking")
+                       PlayerStats_AddPlayer(self);
        }
  }