]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_impulse.qc
Merge branch 'terencehill/quickmenu_file_example' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_impulse.qc
index 0271f085bd0a68b96304ee1571893959465fcec3..58f1a9bd37022a67ed9ff399788706bde4c94a60 100644 (file)
@@ -1,4 +1,3 @@
-#include "_all.qh"
 #include "round_handler.qh"
 
 #include "bot/waypoints.qh"
 #include "../common/minigames/sv_minigames.qh"
 
 #include "../common/weapons/all.qh"
+#include "../common/vehicles/sv_vehicles.qh"
 
-/*
+#include "../common/mutators/mutator/waypoints/waypointsprites.qh"
+
+.entity vehicle;
+
+/**
  * Impulse map:
  *
  * 0 reserved (no input)
@@ -50,7 +54,7 @@
  * 230 to 253: individual weapons (up to 24)
  */
 
-void ImpulseCommands (void)
+void ImpulseCommands ()
 {SELFPARAM();
        int imp;
        vector org;
@@ -134,12 +138,15 @@ void ImpulseCommands (void)
                                        W_PreviousWeapon(1);
                                        break;
                                case 20:
-                                       if(!forbidWeaponUse(self)) { WEP_ACTION(self.weapon, WR_RELOAD); }
+                                       if(!forbidWeaponUse(self)) {
+                                               Weapon w = get_weaponinfo(self.weapon);
+                                               w.wr_reload(w);
+                                       }
                                        break;
                        }
                }
-               else
-                       self.impulse = imp; // retry in next frame
+               //else
+                       //self.impulse = imp; // retry in next frame
        }
        else if(imp == 21)
        {
@@ -155,16 +162,16 @@ void ImpulseCommands (void)
                        m = (imp - (210 + i)); // <0 for prev, =0 for best, >0 for next
                        W_CycleWeapon(self.(cvar_cl_weaponpriorities[i]), m);
                }
-               else
-                       self.impulse = imp; // retry in next frame
+               //else
+                       //self.impulse = imp; // retry in next frame
        }
-       else if(imp >= 230 && imp <= 253)
+       else if(imp >= WEP_IMPULSE_BEGIN && imp <= WEP_IMPULSE_END)
        {
                if(!self.vehicle)
                if(self.deadflag == DEAD_NO)
-                       W_SwitchWeapon (imp - 230 + WEP_FIRST);
-               else
-                       self.impulse = imp; // retry in next frame
+                       W_SwitchWeapon (imp - WEP_IMPULSE_BEGIN + WEP_FIRST);
+               //else
+                       //self.impulse = imp; // retry in next frame
        }
        // deploy waypoints
        else if (imp >= 30 && imp <= 49)
@@ -355,7 +362,7 @@ void ImpulseCommands (void)
                                                        setorigin(e, org);
                                                        LOG_INFO("spawn without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
                                                        e.effects |= EF_NODEPTHTEST;
-                                                       setmodel(e, self.model);
+                                                       _setmodel(e, self.model);
                                                        e.frame = self.frame;
                                                        e.skin = self.skin;
                                                        e.colormod = '8 0.5 8';