]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_impulse.qc
Merge branch 'master' into Mario/vehicles
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_impulse.qc
index ce2fbc3b3c0be25ae7a27f85e2871021b926bfe5..45708409c5fe9731e95088dee3fcb9779b15daa1 100644 (file)
@@ -1,3 +1,19 @@
+#include "_all.qh"
+#include "round_handler.qh"
+
+#include "bot/waypoints.qh"
+
+#include "weapons/throwing.qh"
+#include "command/common.qh"
+#include "cheats.qh"
+#include "bot/navigation.qh"
+#include "weapons/selection.qh"
+#include "weapons/tracing.qh"
+#include "weapons/weaponsystem.qh"
+#include "waypointsprites.qh"
+
+#include "../common/weapons/all.qh"
+
 /*
  * Impulse map:
  *
@@ -35,7 +51,7 @@
 
 void ImpulseCommands (void)
 {
-       float imp;
+       int imp;
        vector org;
        float i;
        float m;
@@ -56,9 +72,13 @@ void ImpulseCommands (void)
 
        if(self.vehicle)
        if(self.vehicle.deadflag == DEAD_NO)
-       if(self.vehicle.vehicles_impulse)
-       if(self.vehicle.vehicles_impulse(imp))
-               return;
+       {
+               if(self.vehicle.vehicles_impulse)
+               if(self.vehicle.vehicles_impulse(imp))
+                       return;
+               if(vehicle_impulse(imp))
+                       return;
+       }
 
        if(CheatImpulse(imp))
        {
@@ -100,7 +120,7 @@ void ImpulseCommands (void)
                                        W_PreviousWeapon(2);
                                        break;
                                case 17:
-                                       W_ThrowWeapon(W_CalculateProjectileVelocity(self.velocity, v_forward * 750, FALSE), '0 0 0', TRUE);
+                                       W_ThrowWeapon(W_CalculateProjectileVelocity(self.velocity, v_forward * 750, false), '0 0 0', true);
                                        break;
                                case 18:
                                        W_NextWeapon(1);
@@ -126,7 +146,7 @@ void ImpulseCommands (void)
                if(self.deadflag == DEAD_NO)
                {
                        // custom order weapon cycling
-                       i = imp % 10;
+                       int i = imp % 10;
                        m = (imp - (210 + i)); // <0 for prev, =0 for best, >0 for next
                        W_CycleWeapon(self.(cvar_cl_weaponpriorities[i]), m);
                }
@@ -172,9 +192,9 @@ void ImpulseCommands (void)
                        case 33:
                                if(self.deadflag == DEAD_NO && teamplay)
                                {
-                                       if (!MUTATOR_CALLHOOK(HelpMePing))
+                                       if (!MUTATOR_CALLHOOK(HelpMePing, self))
                                        {
-                                               wp = WaypointSprite_Attach("helpme", TRUE, RADARICON_HELPME, '1 0.5 0');
+                                               wp = WaypointSprite_Attach("helpme", true, RADARICON_HELPME, '1 0.5 0');
                                                if(!wp)
                                                        WaypointSprite_HelpMePing(self.waypointsprite_attachedforcarrier);
                                                else
@@ -184,14 +204,14 @@ void ImpulseCommands (void)
                                }
                                break;
                        case 34:
-                               wp = WaypointSprite_DeployFixed("here", FALSE, self.origin, RADARICON_HERE, '0 1 0');
+                               wp = WaypointSprite_DeployFixed("here", false, self.origin, RADARICON_HERE, '0 1 0');
                                if(wp)
                                        WaypointSprite_Ping(wp);
                                sprint(self, "HERE spawned at location\n");
                                break;
                        case 35:
                                WarpZone_crosshair_trace(self);
-                               wp = WaypointSprite_DeployFixed("here", FALSE, trace_endpos, RADARICON_HERE, '0 1 0');
+                               wp = WaypointSprite_DeployFixed("here", false, trace_endpos, RADARICON_HERE, '0 1 0');
                                if(wp)
                                        WaypointSprite_Ping(wp);
                                sprint(self, "HERE spawned at crosshair\n");
@@ -199,21 +219,21 @@ void ImpulseCommands (void)
                        case 36:
                                if(vlen(self.death_origin))
                                {
-                                       wp = WaypointSprite_DeployFixed("here", FALSE, self.death_origin, RADARICON_HERE, '0 1 0');
+                                       wp = WaypointSprite_DeployFixed("here", false, self.death_origin, RADARICON_HERE, '0 1 0');
                                        if(wp)
                                                WaypointSprite_Ping(wp);
                                        sprint(self, "HERE spawned at death location\n");
                                }
                                break;
                        case 37:
-                               wp = WaypointSprite_DeployFixed("danger", FALSE, self.origin, RADARICON_DANGER, '1 0.5 0');
+                               wp = WaypointSprite_DeployFixed("danger", false, self.origin, RADARICON_DANGER, '1 0.5 0');
                                if(wp)
                                        WaypointSprite_Ping(wp);
                                sprint(self, "DANGER spawned at location\n");
                                break;
                        case 38:
                                WarpZone_crosshair_trace(self);
-                               wp = WaypointSprite_DeployFixed("danger", FALSE, trace_endpos, RADARICON_DANGER, '1 0.5 0');
+                               wp = WaypointSprite_DeployFixed("danger", false, trace_endpos, RADARICON_DANGER, '1 0.5 0');
                                if(wp)
                                        WaypointSprite_Ping(wp);
                                sprint(self, "DANGER spawned at crosshair\n");
@@ -221,7 +241,7 @@ void ImpulseCommands (void)
                        case 39:
                                if(vlen(self.death_origin))
                                {
-                                       wp = WaypointSprite_DeployFixed("danger", FALSE, self.death_origin, RADARICON_DANGER, '1 0.5 0');
+                                       wp = WaypointSprite_DeployFixed("danger", false, self.death_origin, RADARICON_DANGER, '1 0.5 0');
                                        if(wp)
                                                WaypointSprite_Ping(wp);
                                        sprint(self, "DANGER spawned at death location\n");
@@ -258,7 +278,7 @@ void ImpulseCommands (void)
                                        bprint(strcat("Waypoint spawned at ",vtos(self.origin),"\n"));
                                        break;
                                case 104:
-                                       e = navigation_findnearestwaypoint(self, FALSE);
+                                       e = navigation_findnearestwaypoint(self, false);
                                        if (e)
                                        if (!(e.wpflags & WAYPOINTFLAG_GENERATED))
                                        {
@@ -278,7 +298,7 @@ void ImpulseCommands (void)
                                                e.colormod = '0.5 0.5 0.5';
                                                e.effects &= ~(EF_NODEPTHTEST | EF_RED | EF_BLUE);
                                        }
-                                       e2 = navigation_findnearestwaypoint(self, FALSE);
+                                       e2 = navigation_findnearestwaypoint(self, false);
                                        navigation_markroutes(e2);
                                        i = 0;
                                        m = 0;
@@ -319,7 +339,7 @@ void ImpulseCommands (void)
                                                org = e.origin;
                                                tracebox(e.origin, PL_MIN, PL_MAX, e.origin - '0 0 512', MOVE_NOMONSTERS, world);
                                                setorigin(e, trace_endpos);
-                                               if(navigation_findnearestwaypoint(e, FALSE))
+                                               if(navigation_findnearestwaypoint(e, false))
                                                {
                                                        setorigin(e, org);
                                                        e.effects &= ~EF_NODEPTHTEST;
@@ -350,7 +370,7 @@ void ImpulseCommands (void)
                                        }
                                        for(e = start; e; e = e.chain)
                                        {
-                                               if(navigation_findnearestwaypoint(e, FALSE))
+                                               if(navigation_findnearestwaypoint(e, false))
                                                {
                                                }
                                                else
@@ -367,7 +387,7 @@ void ImpulseCommands (void)
                                        for(e = start; e; e = e.chain)
                                        {
                                                org = e.origin;
-                                               if(navigation_findnearestwaypoint(e, TRUE))
+                                               if(navigation_findnearestwaypoint(e, true))
                                                {
                                                }
                                                else