X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcl_impulse.qc;h=2cc8e0215bb8c1b1f0be9620c2b484326f4acde0;hb=390d33b5f587dc807ae08ffe39adc1d762fc7f4c;hp=c9896bc74591a8b3263c7e4884cca106c6ca3a49;hpb=b7d32c1f333da63877913b30c861230243ce1213;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/cl_impulse.qc b/qcsrc/server/cl_impulse.qc index c9896bc74..2cc8e0215 100644 --- a/qcsrc/server/cl_impulse.qc +++ b/qcsrc/server/cl_impulse.qc @@ -1,3 +1,11 @@ +#include "round_handler.qh" + +#include "bot/waypoints.qh" + +#include "weapons/throwing.qh" + +#include "../common/weapons/weapons.qh" + /* * Impulse map: * @@ -35,7 +43,7 @@ void ImpulseCommands (void) { - float imp; + int imp; vector org; float i; float m; @@ -68,8 +76,8 @@ void ImpulseCommands (void) // weapon switching impulses if(self.deadflag == DEAD_NO) W_NextWeaponOnImpulse(imp); - else - self.impulse = imp; // retry in next frame + //else + // self.impulse = imp; // retry in next frame } else if(imp >= 10 && imp <= 20) { @@ -78,37 +86,37 @@ void ImpulseCommands (void) switch(imp) { case 10: - W_NextWeapon (0); + W_NextWeapon(0); break; case 11: W_LastWeapon(); break; case 12: - W_PreviousWeapon (0); + W_PreviousWeapon(0); break; case 13: - W_SwitchWeapon (w_getbestweapon(self)); + W_SwitchWeapon(w_getbestweapon(self)); break; case 14: W_NextWeaponOnImpulse(0); break; case 15: - W_NextWeapon (2); + W_NextWeapon(2); break; case 16: - W_PreviousWeapon (2); + 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); + W_NextWeapon(1); break; case 19: - W_PreviousWeapon (1); + W_PreviousWeapon(1); break; case 20: - W_TriggerReload (); + if(!forbidWeaponUse()) { WEP_ACTION(self.weapon, WR_RELOAD); } break; } } @@ -124,7 +132,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); } @@ -171,7 +179,7 @@ void ImpulseCommands (void) { if (!MUTATOR_CALLHOOK(HelpMePing)) { - 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 @@ -181,14 +189,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"); @@ -196,21 +204,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"); @@ -218,7 +226,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"); @@ -255,7 +263,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)) { @@ -275,7 +283,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; @@ -316,7 +324,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; @@ -347,7 +355,7 @@ void ImpulseCommands (void) } for(e = start; e; e = e.chain) { - if(navigation_findnearestwaypoint(e, FALSE)) + if(navigation_findnearestwaypoint(e, false)) { } else @@ -364,7 +372,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