]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/physics.qh
Predict warpzones
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / physics.qh
index fb396d1596291b1ed51947a2a38093762e0e95bf..01a8770a591f75000eadcb590baeae8f175daf49 100644 (file)
@@ -32,49 +32,29 @@ bool IsFlying(entity a);
 #define GAMEPLAYFIX_STEPMULTIPLETIMES       STAT(GAMEPLAYFIX_STEPMULTIPLETIMES, this)
 #define GAMEPLAYFIX_UNSTICKPLAYERS          STAT(GAMEPLAYFIX_UNSTICKPLAYERS, this)
 
-#define PHYS_ACCELERATE                     STAT(MOVEVARS_ACCELERATE, this)
-#define PHYS_AIRACCELERATE                  STAT(MOVEVARS_AIRACCELERATE, this)
+#define PHYS_ACCELERATE(s)                  STAT(MOVEVARS_ACCELERATE, s)
+#define PHYS_AIRACCELERATE(s)               STAT(MOVEVARS_AIRACCELERATE, s)
 #define PHYS_AIRACCEL_QW(s)                 STAT(MOVEVARS_AIRACCEL_QW, s)
 #define PHYS_AIRACCEL_QW_STRETCHFACTOR(s)   STAT(MOVEVARS_AIRACCEL_QW_STRETCHFACTOR, s)
-#define PHYS_AIRACCEL_SIDEWAYS_FRICTION     STAT(MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION, this)
-#define PHYS_AIRCONTROL                     STAT(MOVEVARS_AIRCONTROL, this)
-#define PHYS_AIRCONTROL_PENALTY             STAT(MOVEVARS_AIRCONTROL_PENALTY, this)
-#define PHYS_AIRCONTROL_POWER               STAT(MOVEVARS_AIRCONTROL_POWER, this)
+#define PHYS_AIRACCEL_SIDEWAYS_FRICTION(s)  STAT(MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION, s)
+#define PHYS_AIRCONTROL(s)                  STAT(MOVEVARS_AIRCONTROL, s)
+#define PHYS_AIRCONTROL_PENALTY(s)          STAT(MOVEVARS_AIRCONTROL_PENALTY, s)
+#define PHYS_AIRCONTROL_POWER(s)            STAT(MOVEVARS_AIRCONTROL_POWER, s)
 #define PHYS_AIRSPEEDLIMIT_NONQW(s)         STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW, s)
-#define PHYS_AIRSTOPACCELERATE              STAT(MOVEVARS_AIRSTOPACCELERATE, this)
-#define PHYS_AIRSTRAFEACCELERATE(s)         STAT(MOVEVARS_AIRSTRAFEACCELERATE, this)
+#define PHYS_AIRSTOPACCELERATE(s)           STAT(MOVEVARS_AIRSTOPACCELERATE, s)
+#define PHYS_AIRSTRAFEACCELERATE(s)         STAT(MOVEVARS_AIRSTRAFEACCELERATE, s)
 #define PHYS_AIRSTRAFEACCEL_QW(s)           STAT(MOVEVARS_AIRSTRAFEACCEL_QW, s)
 
 #define PHYS_AMMO_FUEL(s)                   STAT(FUEL, s)
 
-#define PHYS_BUGRIGS                        STAT(BUGRIGS, this)
-#define PHYS_BUGRIGS_ACCEL                  STAT(BUGRIGS_ACCEL, this)
-#define PHYS_BUGRIGS_AIR_STEERING           STAT(BUGRIGS_AIR_STEERING, this)
-#define PHYS_BUGRIGS_ANGLE_SMOOTHING        STAT(BUGRIGS_ANGLE_SMOOTHING, this)
-#define PHYS_BUGRIGS_CAR_JUMPING            STAT(BUGRIGS_CAR_JUMPING, this)
-#define PHYS_BUGRIGS_FRICTION_AIR           STAT(BUGRIGS_FRICTION_AIR, this)
-#define PHYS_BUGRIGS_FRICTION_BRAKE         STAT(BUGRIGS_FRICTION_BRAKE, this)
-#define PHYS_BUGRIGS_FRICTION_FLOOR         STAT(BUGRIGS_FRICTION_FLOOR, this)
-#define PHYS_BUGRIGS_PLANAR_MOVEMENT        STAT(BUGRIGS_PLANAR_MOVEMENT, this)
-#define PHYS_BUGRIGS_REVERSE_SPEEDING       STAT(BUGRIGS_REVERSE_SPEEDING, this)
-#define PHYS_BUGRIGS_REVERSE_SPINNING       STAT(BUGRIGS_REVERSE_SPINNING, this)
-#define PHYS_BUGRIGS_REVERSE_STOPPING       STAT(BUGRIGS_REVERSE_STOPPING, this)
-#define PHYS_BUGRIGS_SPEED_POW              STAT(BUGRIGS_SPEED_POW, this)
-#define PHYS_BUGRIGS_SPEED_REF              STAT(BUGRIGS_SPEED_REF, this)
-#define PHYS_BUGRIGS_STEER                  STAT(BUGRIGS_STEER, this)
-
 #define PHYS_DODGING_FROZEN                                    STAT(DODGING_FROZEN, this)
 
-#define PHYS_DOUBLEJUMP                     STAT(DOUBLEJUMP, this)
-
-#define PHYS_FRICTION                       STAT(MOVEVARS_FRICTION, this)
+#define PHYS_FRICTION(s)                    STAT(MOVEVARS_FRICTION, s)
 #define PHYS_FRICTION_ONLAND                STAT(MOVEVARS_FRICTION_ONLAND, this)
 #define PHYS_FRICTION_SLICK                 STAT(MOVEVARS_FRICTION_SLICK, this)
 
 #define PHYS_FROZEN(s)                      STAT(FROZEN, s)
 
-#define PHYS_GRAVITY(s)                     STAT(MOVEVARS_GRAVITY, s)
-
 #define PHYS_HIGHSPEED                      STAT(MOVEVARS_HIGHSPEED, this)
 
 #define PHYS_JETPACK_ACCEL_SIDE                        STAT(JETPACK_ACCEL_SIDE, this)
@@ -86,37 +66,36 @@ bool IsFlying(entity a);
 
 #define PHYS_JUMPSPEEDCAP_DISABLE_ONRAMPS   STAT(MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS, this)
 #define PHYS_JUMPSTEP                                          STAT(MOVEVARS_JUMPSTEP, this)
-#define PHYS_JUMPVELOCITY                   STAT(MOVEVARS_JUMPVELOCITY, this)
+#define PHYS_JUMPVELOCITY(s)                STAT(MOVEVARS_JUMPVELOCITY, s)
 
 #define PHYS_MAXAIRSPEED(s)                 STAT(MOVEVARS_MAXAIRSPEED, s)
-#define PHYS_MAXAIRSTRAFESPEED              STAT(MOVEVARS_MAXAIRSTRAFESPEED, this)
+#define PHYS_MAXAIRSTRAFESPEED(s)           STAT(MOVEVARS_MAXAIRSTRAFESPEED, s)
 #define PHYS_MAXSPEED(s)                    STAT(MOVEVARS_MAXSPEED, s)
 
 #define PHYS_NOSTEP                                                    STAT(NOSTEP, this)
 #define PHYS_STEPHEIGHT                     STAT(MOVEVARS_STEPHEIGHT, this)
 
-#define PHYS_STOPSPEED                      STAT(MOVEVARS_STOPSPEED, this)
+#define PHYS_STOPSPEED(s)                   STAT(MOVEVARS_STOPSPEED, s)
 
 #define PHYS_TRACK_CANJUMP(s)               STAT(MOVEVARS_TRACK_CANJUMP, s)
 
 #define PHYS_WALLFRICTION                                      STAT(MOVEVARS_WALLFRICTION, this)
 
-#define PHYS_WARSOWBUNNY_ACCEL              STAT(MOVEVARS_WARSOWBUNNY_ACCEL, this)
-#define PHYS_WARSOWBUNNY_AIRFORWARDACCEL    STAT(MOVEVARS_WARSOWBUNNY_AIRFORWARDACCEL, this)
-#define PHYS_WARSOWBUNNY_BACKTOSIDERATIO    STAT(MOVEVARS_WARSOWBUNNY_BACKTOSIDERATIO, this)
-#define PHYS_WARSOWBUNNY_TOPSPEED           STAT(MOVEVARS_WARSOWBUNNY_TOPSPEED, this)
-#define PHYS_WARSOWBUNNY_TURNACCEL          STAT(MOVEVARS_WARSOWBUNNY_TURNACCEL, this)
+#define PHYS_WARSOWBUNNY_ACCEL(s)           STAT(MOVEVARS_WARSOWBUNNY_ACCEL, s)
+#define PHYS_WARSOWBUNNY_AIRFORWARDACCEL(s) STAT(MOVEVARS_WARSOWBUNNY_AIRFORWARDACCEL, s)
+#define PHYS_WARSOWBUNNY_BACKTOSIDERATIO(s) STAT(MOVEVARS_WARSOWBUNNY_BACKTOSIDERATIO, s)
+#define PHYS_WARSOWBUNNY_TOPSPEED(s)        STAT(MOVEVARS_WARSOWBUNNY_TOPSPEED, s)
+#define PHYS_WARSOWBUNNY_TURNACCEL(s)       STAT(MOVEVARS_WARSOWBUNNY_TURNACCEL, s)
 
 #define UPWARD_VELOCITY_CLEARS_ONGROUND     STAT(GAMEPLAYFIX_UPVELOCITYCLEARSONGROUND, this)
 
 #ifdef CSQC
 
+       noref float pmove_waterjumptime;
+
        const int FL_WATERJUMP = 2048;  // player jumping out of water
        const int FL_JUMPRELEASED = 4096;       // for jump debouncing
 
-       float PM_multijump_checkjump();
-       void PM_multijump();
-
        .float watertype;
        .float waterlevel;
        .int items;
@@ -127,11 +106,16 @@ bool IsFlying(entity a);
 // TODO
        #define IS_CLIENT(s)                                            (s).isplayermodel
        #define IS_PLAYER(s)                                            (s).isplayermodel
+       #define IS_NOT_A_CLIENT(s)                                 !(s).isplayermodel
        #define isPushable(s)                                           (s).isplayermodel
 
        //float player_multijump;
        //float player_jumpheight;
 
+       #define PHYS_GRAVITY(s)                     STAT(MOVEVARS_GRAVITY, s)
+
+       #define PHYS_TELEPORT_TIME(s)                           pmove_waterjumptime
+
        #define TICRATE ticrate
 
        #define PHYS_INPUT_ANGLES(s)                            input_angles
@@ -196,6 +180,10 @@ bool IsFlying(entity a);
        /** Not real stats */
        .string stat_jumpspeedcap_min, stat_jumpspeedcap_max;
 
+       #define PHYS_TELEPORT_TIME(s)                           s.teleport_time
+
+       #define PHYS_GRAVITY(s)                     autocvar_sv_gravity
+
        #define TICRATE sys_frametime
 
        #define PHYS_INPUT_ANGLES(s)                            s.v_angle