]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
new funny cvar g_movementspeed, works by overriding the otherwise engine-set stats...
authorRudolf Polzer <divverent@alientrap.org>
Sun, 23 May 2010 20:25:51 +0000 (22:25 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 23 May 2010 20:25:51 +0000 (22:25 +0200)
defaultXonotic.cfg
qcsrc/common/constants.qh
qcsrc/server/cl_physics.qc
qcsrc/server/defs.qh
qcsrc/server/g_world.qc

index 1f7f53522d153b78ee1dd9da61379d3907316c5a..6a01ba59a42f720e9328be40efbf5ebb21ed59ab 100644 (file)
@@ -1846,3 +1846,5 @@ set g_weaponreplace_tuba ""
 set g_weaponreplace_fireball ""
 set g_weaponreplace_seeker ""
 set sv_q3acompat_machineshotgunswap 0 "shorthand for swapping uzi and shotgun (for Q3A map compatibility in mapinfo files)"
 set g_weaponreplace_fireball ""
 set g_weaponreplace_seeker ""
 set sv_q3acompat_machineshotgunswap 0 "shorthand for swapping uzi and shotgun (for Q3A map compatibility in mapinfo files)"
+
+set g_movement_highspeed 1 "movement speed modification factor (only changes movement when above maxspeed)"
index cdf92f0709035ad3a2dc012518ab84b06fe08db5..d747b70dbe44ea9da825aab2506a788ce1821a66 100644 (file)
@@ -279,6 +279,11 @@ const float STAT_NB_METERSTART = 45;
 const float STAT_SHOTORG = 46; // compressShotOrigin
 const float STAT_LEADLIMIT = 47;
 const float STAT_BULLETS_LOADED = 48;
 const float STAT_SHOTORG = 46; // compressShotOrigin
 const float STAT_LEADLIMIT = 47;
 const float STAT_BULLETS_LOADED = 48;
+
+// see DP source, quakedef.h
+const float STAT_MOVEVARS_AIRSTRAFEACCEL_QW = 223;
+const float STAT_MOVEVARS_AIRACCEL_QW = 254;
+
 const float CTF_STATE_ATTACK = 1;
 const float CTF_STATE_DEFEND = 2;
 const float CTF_STATE_COMMANDER = 3;
 const float CTF_STATE_ATTACK = 1;
 const float CTF_STATE_DEFEND = 2;
 const float CTF_STATE_COMMANDER = 3;
index 8d7bac21ddfd51651f2f37656a8ac6dedc04a0dc..f42e1420916deb3b52e04c9d9801050f8e370bd9 100644 (file)
@@ -605,6 +605,7 @@ string GetMapname(void);
 float speedaward_lastupdate;
 float speedaward_lastsent;
 .float jumppadusetime;
 float speedaward_lastupdate;
 float speedaward_lastsent;
 .float jumppadusetime;
+var float autocvar_g_movement_highspeed = 1;
 void SV_PlayerPhysics()
 {
        local vector wishvel, wishdir, v;
 void SV_PlayerPhysics()
 {
        local vector wishvel, wishdir, v;
@@ -614,6 +615,13 @@ void SV_PlayerPhysics()
        float not_allowed_to_move;
        string c;
 
        float not_allowed_to_move;
        string c;
 
+       // fix physics stats for g_movement_highspeed
+       self.stat_sv_airaccel_qw = copysign(bound(0, 1-(1-fabs(sv_airaccel_qw))*autocvar_g_movement_highspeed, 1), sv_airaccel_qw);
+       if(sv_airstrafeaccel_qw)
+               self.stat_sv_airstrafeaccel_qw = copysign(bound(0.001, 1-(1-fabs(sv_airstrafeaccel_qw))*autocvar_g_movement_highspeed, 1), sv_airstrafeaccel_qw);
+       else
+               self.stat_sv_airstrafeaccel_qw = 0;
+
     if(self.PlayerPhysplug)
         if(self.PlayerPhysplug())
             return;
     if(self.PlayerPhysplug)
         if(self.PlayerPhysplug())
             return;
@@ -1160,7 +1168,7 @@ void SV_PlayerPhysics()
                        float airaccelqw;
                        float strafity;
 
                        float airaccelqw;
                        float strafity;
 
-                       airaccelqw = sv_airaccel_qw;
+                       airaccelqw = self.stat_sv_airaccel_qw;
                        accelerating = (self.velocity * wishdir > 0);
                        wishspeed2 = wishspeed;
 
                        accelerating = (self.velocity * wishdir > 0);
                        wishspeed2 = wishspeed;
 
@@ -1181,8 +1189,8 @@ void SV_PlayerPhysics()
                                wishspeed = min(wishspeed, GeomLerp(sv_maxairspeed*maxspd_mod, strafity, sv_maxairstrafespeed*maxspd_mod));
                        if(sv_airstrafeaccelerate)
                                airaccel = GeomLerp(airaccel, strafity, sv_airstrafeaccelerate*maxspd_mod);
                                wishspeed = min(wishspeed, GeomLerp(sv_maxairspeed*maxspd_mod, strafity, sv_maxairstrafespeed*maxspd_mod));
                        if(sv_airstrafeaccelerate)
                                airaccel = GeomLerp(airaccel, strafity, sv_airstrafeaccelerate*maxspd_mod);
-                       if(sv_airstrafeaccel_qw)
-                               airaccelqw = copysign(1-GeomLerp(1-fabs(sv_airaccel_qw), strafity, 1-fabs(sv_airstrafeaccel_qw)), ((strafity > 0.5) ? sv_airstrafeaccel_qw : sv_airaccel_qw));
+                       if(self.stat_sv_airstrafeaccel_qw)
+                               airaccelqw = copysign(1-GeomLerp(1-fabs(self.stat_sv_airaccel_qw), strafity, 1-fabs(self.stat_sv_airstrafeaccel_qw)), ((strafity > 0.5) ? self.stat_sv_airstrafeaccel_qw : self.stat_sv_airaccel_qw));
                        // !CPM
 
                        if(sv_warsowbunny_turnaccel && accelerating && self.movement_y == 0 && self.movement_x != 0)
                        // !CPM
 
                        if(sv_warsowbunny_turnaccel && accelerating && self.movement_y == 0 && self.movement_x != 0)
index 41ca098b7796de764f4eb2c9ae3f8eb100201d2a..fec2a0976f196e2f1e29c154b1f86587f57057b9 100644 (file)
@@ -534,6 +534,9 @@ string cvar_changes;
 float game_starttime; //point in time when the countdown is over
 .float stat_game_starttime;
 
 float game_starttime; //point in time when the countdown is over
 .float stat_game_starttime;
 
+.float stat_sv_airaccel_qw;
+.float stat_sv_airstrafeaccel_qw;
+
 void W_Porto_Remove (entity p);
 
 .float projectiledeathtype;
 void W_Porto_Remove (entity p);
 
 .float projectiledeathtype;
index c815b0815a8539690c0c882f2b0e9b5a7663e6f5..e969146ca40e145ed8e73e7e04a20f1f09e94330 100644 (file)
@@ -635,6 +635,10 @@ void spawnfunc_worldspawn (void)
        addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit);
        addstat(STAT_BULLETS_LOADED, AS_INT, campingrifle_bulletcounter);
 
        addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit);
        addstat(STAT_BULLETS_LOADED, AS_INT, campingrifle_bulletcounter);
 
+       // g_movementspeed hack
+       addstat(STAT_MOVEVARS_AIRACCEL_QW, AS_FLOAT, stat_sv_airaccel_qw);
+       addstat(STAT_MOVEVARS_AIRSTRAFEACCEL_QW, AS_FLOAT, stat_sv_airstrafeaccel_qw);
+
        next_pingtime = time + 5;
        InitializeEntity(self, cvar_changes_init, INITPRIO_CVARS);
 
        next_pingtime = time + 5;
        InitializeEntity(self, cvar_changes_init, INITPRIO_CVARS);