]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_impulse.qc
Merge branch 'terencehill/team_slider_fix' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_impulse.qc
index eab7b55bf2ee12844bfd61167156eeb81c715ff3..7446b7022a229c2c46589d7cfc9c1d92423a05c2 100644 (file)
@@ -46,8 +46,9 @@ void ImpulseCommands (void)
                return;
        self.impulse = 0;
 
-       // forbid impulses when not in round time
+       // allow only weapon change impulses when not in round time
        if(round_handler_IsActive() && !round_handler_IsRoundStarted())
+       if(imp == 17 || (imp >= 20 && imp < 200) || imp > 253)
                return;
 
        if (timeout_status == TIMEOUT_ACTIVE) //don't allow any impulses while the game is paused
@@ -55,8 +56,8 @@ void ImpulseCommands (void)
 
     if(self.vehicle)
         if(self.vehicle.deadflag == DEAD_NO)
-            if(self.vehicle.vehicles_impusle)
-                if(self.vehicle.vehicles_impusle(imp))
+            if(self.vehicle.vehicles_impulse)
+                if(self.vehicle.vehicles_impulse(imp))
                     return;
 
        if(CheatImpulse(imp))
@@ -107,7 +108,7 @@ void ImpulseCommands (void)
                                        W_PreviousWeapon(1);
                                        break;
                                case 20:
-                                       WEP_ACTION(self.weapon, WR_RELOAD);
+                                       if(!forbidWeaponUse()) { WEP_ACTION(self.weapon, WR_RELOAD); }
                                        break;
                        }
                }
@@ -123,7 +124,7 @@ void ImpulseCommands (void)
                if(self.deadflag == DEAD_NO)
                {
                        // custom order weapon cycling
-                       i = mod(imp, 10);
+                       i = imp % 10;
                        m = (imp - (210 + i)); // <0 for prev, =0 for best, >0 for next
                        W_CycleWeapon(self.(cvar_cl_weaponpriorities[i]), m);
                }