]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_physics.qc
Merge branch 'master' of ssh://gitlab.com/xonotic/xonotic-data.pk3dir into kickban...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_physics.qc
index 34e3e8f5d2791f7705bb70a24eade0e751a2ebaa..fb283bb2a3a488b0bc8bc6d2ed627d7f6917c26a 100644 (file)
@@ -169,13 +169,14 @@ void CheckPlayerJump()
                float air_jump = !PlayerJump() || self.multijump_count > 0; // PlayerJump() has important side effects
                float activate = self.cvar_cl_jetpack_jump && air_jump && self.BUTTON_JUMP || self.BUTTON_JETPACK;
                float has_fuel = !autocvar_g_jetpack_fuel || self.ammo_fuel || self.items & IT_UNLIMITED_WEAPON_AMMO;
-               if (self.jetpack_stopped) { }
+               if (!(self.items & IT_JETPACK)) { }
+               else if (self.jetpack_stopped) { }
                else if (!has_fuel)
                {
-                       if (was_flying)
-                               sprint(self, "You ran out of fuel for the ^2Jetpack\n");
-                       else
-                               sprint(self, "You don't have any fuel for the ^2Jetpack\n");
+                       if (was_flying) // TODO: ran out of fuel message
+                               Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_JETPACK_NOFUEL);
+                       else if (activate)
+                               Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_JETPACK_NOFUEL);
                        self.jetpack_stopped = TRUE;
                        self.items &= ~IT_USING_JETPACK;
                }
@@ -793,7 +794,6 @@ void SV_PlayerPhysics()
                not_allowed_to_move = 0;
                if(self.race_penalty)
                        not_allowed_to_move = 1;
-               if(!autocvar_sv_ready_restart_after_countdown)
                if(time < game_starttime)
                        not_allowed_to_move = 1;
 
@@ -1148,6 +1148,10 @@ 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) && self.ammo_fuel < 0.01)
+                       Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_JETPACK_NOFUEL);
+
                // walking
                makevectors(self.v_angle_y * '0 1 0');
                wishvel = v_forward * self.movement_x + v_right * self.movement_y;
@@ -1213,6 +1217,9 @@ void SV_PlayerPhysics()
        else
        {
                float wishspeed0;
+               // we get here if we ran out of ammo
+               if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32) && self.ammo_fuel < 0.01)
+                       Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_JETPACK_NOFUEL);
 
                if(maxspd_mod < 1)
                {