]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/physics.qc
Revert "Merge branch 'TimePath/bot_api' into 'master'\r"
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / physics.qc
index 33aaeb58b0456845e255761a6731b40e3df74021..1a799c8de79c903edef70a5db80115bc103d657b 100644 (file)
@@ -25,15 +25,15 @@ float Physics_ClientOption(entity pl, string option)
 {
        if(Physics_Valid(pl.cvar_cl_physics))
        {
-               string var = sprintf("g_physics_%s_%s", pl.cvar_cl_physics, option);
-               if(cvar_type(var) & CVAR_TYPEFLAG_EXISTS)
-                       return cvar(var);
+               string s = sprintf("g_physics_%s_%s", pl.cvar_cl_physics, option);
+               if(cvar_type(s) & CVAR_TYPEFLAG_EXISTS)
+                       return cvar(s);
        }
        if(autocvar_g_physics_clientselect && autocvar_g_physics_clientselect_default)
        {
-               string var = sprintf("g_physics_%s_%s", autocvar_g_physics_clientselect_default, option);
-               if(cvar_type(var) & CVAR_TYPEFLAG_EXISTS)
-                       return cvar(var);
+               string s = sprintf("g_physics_%s_%s", autocvar_g_physics_clientselect_default, option);
+               if(cvar_type(s) & CVAR_TYPEFLAG_EXISTS)
+                       return cvar(s);
        }
        return cvar(strcat("sv_", option));
 }
@@ -116,7 +116,7 @@ void Physics_AddStats()
 }
 
 void Physics_UpdateStats(float maxspd_mod)
-{
+{SELFPARAM();
        // blah
        self.stat_pl_view_ofs = PL_VIEW_OFS;
        self.stat_pl_crouch_view_ofs = PL_CROUCH_VIEW_OFS;
@@ -222,7 +222,7 @@ vector unstick_offsets[unstick_count] =
 };
 
 void PM_ClientMovement_Unstick()
-{
+{SELFPARAM();
        float i;
        for (i = 0; i < unstick_count; i++)
        {
@@ -237,7 +237,7 @@ void PM_ClientMovement_Unstick()
 }
 
 void PM_ClientMovement_UpdateStatus(bool ground)
-{
+{SELFPARAM();
        // make sure player is not stuck
        PM_ClientMovement_Unstick();
 
@@ -308,7 +308,7 @@ void PM_ClientMovement_UpdateStatus(bool ground)
 }
 
 void PM_ClientMovement_Move()
-{
+{SELFPARAM();
 #ifdef CSQC
        int bump;
        float t;
@@ -397,7 +397,7 @@ void PM_ClientMovement_Move()
 }
 
 void CPM_PM_Aircontrol(vector wishdir, float wishspeed)
-{
+{SELFPARAM();
        float k = 32 * (2 * IsMoveInDirection(self.movement, 0) - 1);
        if (k <= 0)
                return;
@@ -434,7 +434,7 @@ float AdjustAirAccelQW(float accelqw, float factor)
 //   prvm_globalset server speedclamp_mode 1
 //     (or 2)
 void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float accel, float accelqw, float stretchfactor, float sidefric, float speedlimit)
-{
+{SELFPARAM();
        float speedclamp = stretchfactor > 0 ? stretchfactor
        : accelqw < 0 ? 1 // full clamping, no stretch
        : -1; // no clamping
@@ -498,7 +498,7 @@ void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float acce
 }
 
 void PM_AirAccelerate(vector wishdir, float wishspeed)
-{
+{SELFPARAM();
        if (wishspeed == 0)
                return;
 
@@ -541,7 +541,7 @@ returns true if handled
 =============
 */
 bool PlayerJump (void)
-{
+{SELFPARAM();
        if (PHYS_FROZEN(self))
                return true; // no jumping in freezetag when frozen
 
@@ -657,7 +657,7 @@ bool PlayerJump (void)
 }
 
 void CheckWaterJump()
-{
+{SELFPARAM();
 // check for a jump-out-of-water
        makevectors(self.v_angle);
        vector start = self.origin;
@@ -697,7 +697,7 @@ void CheckWaterJump()
 // Hack: shouldn't need to know about this
 .float multijump_count;
 void CheckPlayerJump()
-{
+{SELFPARAM();
 #ifdef SVQC
        float was_flying = ITEMS_STAT(self) & IT_USING_JETPACK;
 #endif
@@ -757,7 +757,7 @@ float racecar_angle(float forward, float down)
 }
 
 void RaceCarPhysics()
-{
+{SELFPARAM();
 #ifdef SVQC
        // using this move type for "big rigs"
        // the engine does not push the entity!
@@ -976,17 +976,8 @@ void SpecialCommand()
 #endif
 }
 
-float PM_check_keepaway(void)
-{
-#ifdef SVQC
-       return (self.ballcarried && g_keepaway) ? autocvar_g_keepaway_ballcarrier_highspeed : 1;
-#else
-       return 1;
-#endif
-}
-
 void PM_check_race_movetime(void)
-{
+{SELFPARAM();
 #ifdef SVQC
        self.race_movetime_frac += PHYS_INPUT_TIMELENGTH;
        float f = floor(self.race_movetime_frac);
@@ -997,7 +988,7 @@ void PM_check_race_movetime(void)
 }
 
 float PM_check_specialcommand(float buttons)
-{
+{SELFPARAM();
 #ifdef SVQC
        string c;
        if (!buttons)
@@ -1034,7 +1025,7 @@ float PM_check_specialcommand(float buttons)
 }
 
 void PM_check_nickspam(void)
-{
+{SELFPARAM();
 #ifdef SVQC
        if (time >= self.nickspamtime)
                return;
@@ -1056,7 +1047,7 @@ void PM_check_nickspam(void)
 }
 
 void PM_check_punch()
-{
+{SELFPARAM();
 #ifdef SVQC
        if (self.punchangle != '0 0 0')
        {
@@ -1079,7 +1070,7 @@ void PM_check_punch()
 }
 
 void PM_check_spider(void)
-{
+{SELFPARAM();
 #ifdef SVQC
        if (time >= self.spider_slowness)
                return;
@@ -1092,7 +1083,7 @@ void PM_check_spider(void)
 
 // predict frozen movement, as frozen players CAN move in some cases
 void PM_check_frozen(void)
-{
+{SELFPARAM();
        if (!PHYS_FROZEN(self))
                return;
        if (PHYS_DODGING_FROZEN
@@ -1119,7 +1110,7 @@ void PM_check_frozen(void)
 }
 
 void PM_check_hitground()
-{
+{SELFPARAM();
 #ifdef SVQC
        if (IS_ONGROUND(self))
        if (IS_PLAYER(self)) // no fall sounds for observers thank you very much
@@ -1146,7 +1137,7 @@ void PM_check_hitground()
 }
 
 void PM_check_blocked(void)
-{
+{SELFPARAM();
 #ifdef SVQC
        if (!self.player_blocked)
                return;
@@ -1160,7 +1151,7 @@ float speedaward_lastsent;
 float speedaward_lastupdate;
 #endif
 void PM_check_race(void)
-{
+{SELFPARAM();
 #ifdef SVQC
        if(!(g_cts || g_race))
                return;
@@ -1190,7 +1181,7 @@ void PM_check_race(void)
 }
 
 void PM_check_vortex(void)
-{
+{SELFPARAM();
 #ifdef SVQC
        // WEAPONTODO
        float xyspeed = vlen(vec2(self.velocity));
@@ -1206,7 +1197,7 @@ void PM_check_vortex(void)
 }
 
 void PM_fly(float maxspd_mod)
-{
+{SELFPARAM();
        // noclipping or flying
        UNSET_ONGROUND(self);
 
@@ -1227,7 +1218,7 @@ void PM_fly(float maxspd_mod)
 }
 
 void PM_swim(float maxspd_mod)
-{
+{SELFPARAM();
        // swimming
        UNSET_ONGROUND(self);
 
@@ -1310,7 +1301,7 @@ void PM_swim(float maxspd_mod)
 }
 
 void PM_ladder(float maxspd_mod)
-{
+{SELFPARAM();
        // on a spawnfunc_func_ladder or swimming in spawnfunc_func_water
        UNSET_ONGROUND(self);
 
@@ -1363,7 +1354,7 @@ void PM_ladder(float maxspd_mod)
 }
 
 void PM_jetpack(float maxspd_mod)
-{
+{SELFPARAM();
        //makevectors(self.v_angle.y * '0 1 0');
        makevectors(self.v_angle);
        vector wishvel = v_forward * self.movement_x
@@ -1479,7 +1470,7 @@ void PM_jetpack(float maxspd_mod)
 }
 
 void PM_walk(float buttons_prev, float maxspd_mod)
-{
+{SELFPARAM();
        if (!WAS_ONGROUND(self))
        {
 #ifdef SVQC
@@ -1564,7 +1555,7 @@ void PM_walk(float buttons_prev, float maxspd_mod)
 }
 
 void PM_air(float buttons_prev, float maxspd_mod)
-{
+{SELFPARAM();
        makevectors(self.v_angle.y * '0 1 0');
        vector wishvel = v_forward * self.movement.x
                                        + v_right * self.movement.y;
@@ -1650,7 +1641,7 @@ bool IsFlying(entity a)
 }
 
 void PM_Main()
-{
+{SELFPARAM();
        int buttons = PHYS_INPUT_BUTTON_MASK(self);
 #ifdef CSQC
        self.items = getstati(STAT_ITEMS, 0, 24);
@@ -1675,7 +1666,6 @@ void PM_Main()
        WarpZone_PlayerPhysics_FixVAngle();
 #endif
        float maxspeed_mod = 1;
-       maxspeed_mod *= PM_check_keepaway();
        maxspeed_mod *= PHYS_HIGHSPEED;
 
 #ifdef SVQC
@@ -1933,7 +1923,7 @@ void SV_PlayerPhysics(void)
 #elif defined(CSQC)
 void CSQC_ClientMovement_PlayerMove_Frame(void)
 #endif
-{
+{SELFPARAM();
        PM_Main();
 
 #ifdef CSQC