Merge branch 'master' into Mario/qc_physics_prehax
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / physics.qh
index 599eee5..17de7b2 100644 (file)
@@ -135,7 +135,7 @@ bool IsFlying(entity a);
        #define PHYS_AIRSPEEDLIMIT_NONQW(s)                     getstatf(STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW)
        #define PHYS_AIRSTOPACCELERATE                          getstatf(STAT_MOVEVARS_AIRSTOPACCELERATE)
        #define PHYS_AIRSTRAFEACCEL_QW(s)                       getstatf(STAT_MOVEVARS_AIRSTRAFEACCEL_QW)
-       #define PHYS_AIRSTRAFEACCELERATE                        getstatf(STAT_MOVEVARS_AIRSTRAFEACCELERATE)
+       #define PHYS_AIRSTRAFEACCELERATE(s)                     getstatf(STAT_MOVEVARS_AIRSTRAFEACCELERATE)
        #define PHYS_ENTGRAVITY(s)                                      getstatf(STAT_MOVEVARS_ENTGRAVITY)
        #define PHYS_FRICTION                                           getstatf(STAT_MOVEVARS_FRICTION)
        #define PHYS_FRICTION_SLICK                                     getstatf(STAT_MOVEVARS_FRICTION_SLICK)
@@ -143,7 +143,7 @@ bool IsFlying(entity a);
        #define PHYS_GRAVITY                                            getstatf(STAT_MOVEVARS_GRAVITY)
        #define PHYS_HIGHSPEED                                          getstatf(STAT_MOVEVARS_HIGHSPEED)
        #define PHYS_JUMPVELOCITY                                       getstatf(STAT_MOVEVARS_JUMPVELOCITY)
-       #define PHYS_MAXAIRSPEED                                        getstatf(STAT_MOVEVARS_MAXAIRSPEED)
+       #define PHYS_MAXAIRSPEED(s)                                     getstatf(STAT_MOVEVARS_MAXAIRSPEED)
        #define PHYS_MAXAIRSTRAFESPEED                          getstatf(STAT_MOVEVARS_MAXAIRSTRAFESPEED)
        #define PHYS_MAXSPEED(s)                                        getstatf(STAT_MOVEVARS_MAXSPEED)
        #define PHYS_STEPHEIGHT                                         getstatf(STAT_MOVEVARS_STEPHEIGHT)
@@ -170,6 +170,8 @@ bool IsFlying(entity a);
 
 #elif defined(SVQC)
 
+       bool Physics_Valid(string thecvar);
+
        .vector stat_pl_view_ofs;
        .vector stat_pl_crouch_view_ofs;
 
@@ -221,6 +223,27 @@ bool IsFlying(entity a);
        .float stat_bugrigs_reverse_spinning;
        .float stat_bugrigs_reverse_stopping;
 
+       // new properties
+       .float stat_sv_jumpvelocity;
+       .float stat_sv_airaccel_qw_stretchfactor;
+       .float stat_sv_maxairstrafespeed;
+       .float stat_sv_maxairspeed;
+       .float stat_sv_airstrafeaccelerate;
+       .float stat_sv_warsowbunny_turnaccel;
+       .float stat_sv_airaccel_sideways_friction;
+       .float stat_sv_aircontrol;
+       .float stat_sv_aircontrol_power;
+       .float stat_sv_aircontrol_penalty;
+       .float stat_sv_warsowbunny_airforwardaccel;
+       .float stat_sv_warsowbunny_topspeed;
+       .float stat_sv_warsowbunny_accel;
+       .float stat_sv_warsowbunny_backtosideratio;
+       .float stat_sv_friction;
+       .float stat_sv_accelerate;
+       .float stat_sv_stopspeed;
+       .float stat_sv_airaccelerate;
+       .float stat_sv_airstopaccelerate;
+
        .float stat_nostep;
        .float stat_jumpstep;
 
@@ -301,35 +324,35 @@ bool IsFlying(entity a);
        #define PHYS_JUMPSPEEDCAP_DISABLE_ONRAMPS       autocvar_sv_jumpspeedcap_max_disable_on_ramps
 
        #define PHYS_TRACK_CANJUMP(s)                           s.cvar_cl_movement_track_canjump
-       #define PHYS_ACCELERATE                                         autocvar_sv_accelerate
+       #define PHYS_ACCELERATE                                         self.stat_sv_accelerate
        #define PHYS_AIRACCEL_QW(s)                                     s.stat_sv_airaccel_qw
-       #define PHYS_AIRACCEL_QW_STRETCHFACTOR(s)       autocvar_sv_airaccel_qw_stretchfactor
-       #define PHYS_AIRACCEL_SIDEWAYS_FRICTION         autocvar_sv_airaccel_sideways_friction
-       #define PHYS_AIRACCELERATE                                      autocvar_sv_airaccelerate
-       #define PHYS_AIRCONTROL                                         autocvar_sv_aircontrol
-       #define PHYS_AIRCONTROL_PENALTY                         autocvar_sv_aircontrol_penalty
-       #define PHYS_AIRCONTROL_POWER                           autocvar_sv_aircontrol_power
+       #define PHYS_AIRACCEL_QW_STRETCHFACTOR(s)       self.stat_sv_airaccel_qw_stretchfactor
+       #define PHYS_AIRACCEL_SIDEWAYS_FRICTION         self.stat_sv_airaccel_sideways_friction
+       #define PHYS_AIRACCELERATE                                      self.stat_sv_airaccelerate
+       #define PHYS_AIRCONTROL                                         self.stat_sv_aircontrol
+       #define PHYS_AIRCONTROL_PENALTY                         self.stat_sv_aircontrol_penalty
+       #define PHYS_AIRCONTROL_POWER                           self.stat_sv_aircontrol_power
        #define PHYS_AIRSPEEDLIMIT_NONQW(s)                     s.stat_sv_airspeedlimit_nonqw
-       #define PHYS_AIRSTOPACCELERATE                          autocvar_sv_airstopaccelerate
+       #define PHYS_AIRSTOPACCELERATE                          self.stat_sv_airstopaccelerate
        #define PHYS_AIRSTRAFEACCEL_QW(s)                       s.stat_sv_airstrafeaccel_qw
-       #define PHYS_AIRSTRAFEACCELERATE                        autocvar_sv_airstrafeaccelerate
+       #define PHYS_AIRSTRAFEACCELERATE(s)                     s.stat_sv_airstrafeaccelerate
        #define PHYS_ENTGRAVITY(s)                                      s.gravity
-       #define PHYS_FRICTION                                           autocvar_sv_friction
+       #define PHYS_FRICTION                                           self.stat_sv_friction
        #define PHYS_FRICTION_SLICK                                     autocvar_sv_friction_slick
        #define PHYS_FRICTION_ONLAND                            autocvar_sv_friction_on_land
        #define PHYS_GRAVITY                                            autocvar_sv_gravity
        #define PHYS_HIGHSPEED                                          autocvar_g_movement_highspeed
-       #define PHYS_JUMPVELOCITY                                       autocvar_sv_jumpvelocity
-       #define PHYS_MAXAIRSPEED                                        autocvar_sv_maxairspeed
-       #define PHYS_MAXAIRSTRAFESPEED                          autocvar_sv_maxairstrafespeed
+       #define PHYS_JUMPVELOCITY                                       self.stat_sv_jumpvelocity
+       #define PHYS_MAXAIRSPEED(s)                                     self.stat_sv_maxairspeed
+       #define PHYS_MAXAIRSTRAFESPEED                          self.stat_sv_maxairstrafespeed
        #define PHYS_MAXSPEED(s)                                        s.stat_sv_maxspeed
        #define PHYS_STEPHEIGHT                                         autocvar_sv_stepheight
-       #define PHYS_STOPSPEED                                          autocvar_sv_stopspeed
-       #define PHYS_WARSOWBUNNY_ACCEL                          autocvar_sv_warsowbunny_accel
-       #define PHYS_WARSOWBUNNY_BACKTOSIDERATIO        autocvar_sv_warsowbunny_backtosideratio
-       #define PHYS_WARSOWBUNNY_AIRFORWARDACCEL        autocvar_sv_warsowbunny_airforwardaccel
-       #define PHYS_WARSOWBUNNY_TOPSPEED                       autocvar_sv_warsowbunny_topspeed
-       #define PHYS_WARSOWBUNNY_TURNACCEL                      autocvar_sv_warsowbunny_turnaccel
+       #define PHYS_STOPSPEED                                          self.stat_sv_stopspeed
+       #define PHYS_WARSOWBUNNY_ACCEL                          self.stat_sv_warsowbunny_accel
+       #define PHYS_WARSOWBUNNY_BACKTOSIDERATIO        self.stat_sv_warsowbunny_backtosideratio
+       #define PHYS_WARSOWBUNNY_AIRFORWARDACCEL        self.stat_sv_warsowbunny_airforwardaccel
+       #define PHYS_WARSOWBUNNY_TOPSPEED                       self.stat_sv_warsowbunny_topspeed
+       #define PHYS_WARSOWBUNNY_TURNACCEL                      self.stat_sv_warsowbunny_turnaccel
 
        #define PHYS_WALLFRICTION                                       cvar("sv_wallfriction")