X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcl_impulse.qc;h=a525c58f7fed79ee13db8f7b8e7f0b28f266fc75;hb=6e0735e995e35d56e60f8b816285077b7db0b155;hp=ecd4ae07e58e2e6c9c30ea6716c6d3b13db68561;hpb=0d626c1759ca9320467b44c0522dd884a6d9678a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/cl_impulse.qc b/qcsrc/server/cl_impulse.qc index ecd4ae07e..a525c58f7 100644 --- a/qcsrc/server/cl_impulse.qc +++ b/qcsrc/server/cl_impulse.qc @@ -1,3 +1,4 @@ +#include "cl_impulse.qh" #include "round_handler.qh" #include "bot/waypoints.qh" @@ -53,7 +54,11 @@ #define X(slot) \ IMPULSE(weapon_group_##slot) \ { \ - if (this.deadflag != DEAD_NO) return; \ + if (IS_DEAD(this)) \ + { \ + this.impulse = IMP_weapon_group_##slot.impulse; \ + return; \ + } \ W_NextWeaponOnImpulse(slot); \ } X(1) @@ -74,7 +79,11 @@ X(0) IMPULSE(weapon_priority_##slot##_##dir) \ { \ if (this.vehicle) return; \ - if (this.deadflag != DEAD_NO) return; \ + if (IS_DEAD(this)) \ + { \ + this.impulse = IMP_weapon_priority_##slot##_##dir.impulse; \ + return; \ + } \ noref int prev = -1; \ noref int best = 0; \ noref int next = +1; \ @@ -120,7 +129,11 @@ X(9, next) IMPULSE(weapon_byid_##i) \ { \ if (this.vehicle) return; \ - if (this.deadflag != DEAD_NO) return; \ + if (IS_DEAD(this)) \ + { \ + this.impulse = IMP_weapon_byid_##i.impulse; \ + return; \ + } \ W_SwitchWeapon(Weapons_from(WEP_FIRST + i)); \ } X(0) @@ -152,73 +165,99 @@ X(23) IMPULSE(weapon_next_byid) { if (this.vehicle) return; - if (this.deadflag != DEAD_NO) return; + if (IS_DEAD(this)) + { + this.impulse = IMP_weapon_next_byid.impulse; + return; + } W_NextWeapon(0); } IMPULSE(weapon_prev_byid) { if (this.vehicle) return; - if (this.deadflag != DEAD_NO) return; + if (IS_DEAD(this)) + { + this.impulse = IMP_weapon_prev_byid.impulse; + return; + } W_PreviousWeapon(0); } IMPULSE(weapon_next_bygroup) { if (this.vehicle) return; - if (this.deadflag != DEAD_NO) return; + if (IS_DEAD(this)) + { + this.impulse = IMP_weapon_next_bygroup.impulse; + return; + } W_NextWeapon(1); } IMPULSE(weapon_prev_bygroup) { if (this.vehicle) return; - if (this.deadflag != DEAD_NO) return; + if (IS_DEAD(this)) + { + this.impulse = IMP_weapon_prev_bygroup.impulse; + return; + } W_PreviousWeapon(1); } IMPULSE(weapon_next_bypriority) { if (this.vehicle) return; - if (this.deadflag != DEAD_NO) return; + if (IS_DEAD(this)) + { + this.impulse = IMP_weapon_next_bypriority.impulse; + return; + } W_NextWeapon(2); } IMPULSE(weapon_prev_bypriority) { if (this.vehicle) return; - if (this.deadflag != DEAD_NO) return; + if (IS_DEAD(this)) + { + this.impulse = IMP_weapon_prev_bypriority.impulse; + return; + } W_PreviousWeapon(2); } IMPULSE(weapon_last) { if (this.vehicle) return; - if (this.deadflag != DEAD_NO) return; + if (IS_DEAD(this)) return; W_LastWeapon(this); } IMPULSE(weapon_best) { if (this.vehicle) return; - if (this.deadflag != DEAD_NO) return; + if (IS_DEAD(this)) return; W_SwitchWeapon(w_getbestweapon(this)); } IMPULSE(weapon_drop) { if (this.vehicle) return; - if (this.deadflag != DEAD_NO) return; + if (IS_DEAD(this)) return; W_ThrowWeapon(W_CalculateProjectileVelocity(this.velocity, v_forward * 750, false), '0 0 0', true); } IMPULSE(weapon_reload) { if (this.vehicle) return; - if (this.deadflag != DEAD_NO) return; + if (IS_DEAD(this)) return; if (forbidWeaponUse(this)) return; Weapon w = PS(this).m_weapon; - w.wr_reload(w); + entity actor = this; + .entity weaponentity = weaponentities[0]; // TODO: unhardcode + w.wr_reload(w, actor, weaponentity); } void ImpulseCommands(entity this) @@ -361,7 +400,7 @@ IMPULSE(waypoint_personal_death) IMPULSE(waypoint_here_follow) { if (!teamplay) return; - if (this.deadflag != DEAD_NO) return; + if (IS_DEAD(this)) return; if (!MUTATOR_CALLHOOK(HelpMePing, this)) { entity wp = WaypointSprite_Attach(WP_Helpme, true, RADARICON_HELPME); @@ -513,7 +552,7 @@ IMPULSE(navwaypoint_unreachable) for (entity e = findchain(classname, "info_player_deathmatch"); e; e = e.chain) { vector org = e.origin; - tracebox(e.origin, PL_MIN, PL_MAX, e.origin - '0 0 512', MOVE_NOMONSTERS, world); + tracebox(e.origin, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL), e.origin - '0 0 512', MOVE_NOMONSTERS, world); setorigin(e, trace_endpos); if (navigation_findnearestwaypoint(e, false)) {