]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_physics.qc
Merge remote-tracking branch 'origin/master' into divVerent/csad
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_physics.qc
index 9364d729418fd8069328085b640160350c010790..50401604ef905313d521380d6995b0cf202d6bec 100644 (file)
@@ -169,10 +169,7 @@ void PlayerJump (void)
        self.flags &~= FL_ONGROUND;
        self.flags &~= FL_JUMPRELEASED;
 
-       if (self.crouch)
-               setanim(self, self.anim_duckjump, FALSE, TRUE, TRUE);
-       else if (self.animstate_startframe != self.anim_melee_x || (self.animstate_startframe == self.anim_melee_x && time - self.animstate_starttime >= 21/20)) // jump animation shouldn't override melee until we have animation blending (or until the anim finished, 21/20 = numframes/fps)
-               setanim(self, self.anim_jump, FALSE, TRUE, TRUE);
+       animdecide_setaction(self, ANIMACTION_JUMP, TRUE);
 
        if(g_jump_grunt)
                PlayerSound(playersound_jump, CH_PLAYER, VOICETYPE_PLAYERSOUND);
@@ -875,6 +872,12 @@ void SV_PlayerPhysics()
 
        MUTATOR_CALLHOOK(PlayerPhysics);
 
+       if(self.player_blocked)
+       {
+               self.movement = '0 0 0';
+               self.disableclientprediction = 1;
+       }
+
        maxspd_mod = 1;
 
        swampspd_mod = 1;
@@ -882,40 +885,24 @@ void SV_PlayerPhysics()
                swampspd_mod = self.swamp_slowdown; //cvar("g_balance_swamp_moverate");
        }
 
-       // conveyors: check if we still convey stuff
-       float conveyor_broken = FALSE;
-       if(self.groundentity.classname == "func_conveyor")
-       if(self.groundentity.nextthink)
-       {
-               if(!WarpZoneLib_BoxTouchesBrush(self.absmin + '0 0 -1', self.absmax + '0 0 -1', self.groundentity, self))
-                       self.groundentity = world;
-       }
-       if(!self.groundentity)
-       {
-               tracebox(self.origin + '0 0 -1', self.mins, self.maxs, self.origin + '0 0 -1', MOVE_NORMAL, self);
-               if(trace_ent.classname == "func_conveyor")
-                       self.groundentity = trace_ent;
-       }
-
        // conveyors: first fix velocity
-       if(self.groundentity.classname == "func_conveyor")
-               if(self.groundentity.nextthink)
-                       self.velocity -= self.groundentity.movedir;
+       if(self.conveyor.state)
+               self.velocity -= self.conveyor.movedir;
 
        if(self.classname != "player")
        {
                maxspd_mod = autocvar_sv_spectator_speed_multiplier;
                if(!self.spectatorspeed)
                        self.spectatorspeed = maxspd_mod;
-               if(self.impulse && self.impulse <= 19)
+               if(self.impulse && self.impulse <= 19 || self.impulse >= 200 && self.impulse <= 209 || self.impulse >= 220 && self.impulse <= 229)
                {
                        if(self.lastclassname != "player")
                        {
-                               if(self.impulse == 10 || self.impulse == 15 || self.impulse == 18)
+                               if(self.impulse == 10 || self.impulse == 15 || self.impulse == 18 || self.impulse >= 200 && self.impulse <= 209)
                                        self.spectatorspeed = bound(1, self.spectatorspeed + 0.5, 5);
                                else if(self.impulse == 11)
                                        self.spectatorspeed = maxspd_mod;
-                               else if(self.impulse == 12 || self.impulse == 16  || self.impulse == 19)
+                               else if(self.impulse == 12 || self.impulse == 16  || self.impulse == 19 || self.impulse >= 220 && self.impulse <= 229)
                                        self.spectatorspeed = bound(1, self.spectatorspeed - 0.5, 5);
                                else if(self.impulse >= 1 && self.impulse <= 9)
                                        self.spectatorspeed = 1 + 0.5 * (self.impulse - 1);
@@ -1084,7 +1071,7 @@ void SV_PlayerPhysics()
                        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))
+       else if ((self.items & IT_JETPACK) && self.BUTTON_HOOK && (!autocvar_g_jetpack_fuel || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO) && !self.freezetag_frozen)
        {
                //makevectors(self.v_angle_y * '0 1 0');
                makevectors(self.v_angle);
@@ -1186,7 +1173,7 @@ void SV_PlayerPhysics()
        else if (self.flags & FL_ONGROUND)
        {
                // we get here if we ran out of ammo
-               if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32))
+               if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32) && self.ammo_fuel < 0.01)
                        sprint(self, "You don't have any fuel for the ^2Jetpack\n");
 
                // walking
@@ -1269,7 +1256,7 @@ void SV_PlayerPhysics()
        {
                float wishspeed0;
                // we get here if we ran out of ammo
-               if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32))
+               if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32) && self.ammo_fuel < 0.01)
                        sprint(self, "You don't have any fuel for the ^2Jetpack\n");
 
                if(maxspd_mod < 1)
@@ -1382,9 +1369,8 @@ void SV_PlayerPhysics()
                self.lastground = time;
 
        // conveyors: then break velocity again
-       if(self.groundentity.classname == "func_conveyor")
-               if(self.groundentity.nextthink)
-                       self.velocity += self.groundentity.movedir;
+       if(self.conveyor.state)
+               self.velocity += self.conveyor.movedir;
 
        self.lastflags = self.flags;
        self.lastclassname = self.classname;