From: Mario Date: Sat, 12 Mar 2016 03:22:47 +0000 (+1000) Subject: Broken attempt to bring back switching weapons while dead, uncovers some bug somewher... X-Git-Tag: xonotic-v0.8.2~1121^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bec6579c18848ca5fbd5a775b53e8d28c0487a17;p=xonotic%2Fxonotic-data.pk3dir.git Broken attempt to bring back switching weapons while dead, uncovers some bug somewhere (pushing so others can attempt to spot the issue) --- diff --git a/qcsrc/common/mutators/mutator/overkill/overkill.qc b/qcsrc/common/mutators/mutator/overkill/overkill.qc index 972220e75..2dc6e8414 100644 --- a/qcsrc/common/mutators/mutator/overkill/overkill.qc +++ b/qcsrc/common/mutators/mutator/overkill/overkill.qc @@ -182,7 +182,13 @@ MUTATOR_HOOKFUNCTION(ok, PlayerPreThink) if(self.ok_lastwep) { - PS(self).m_switchweapon = Weapons_from(self.ok_lastwep); + Weapon newwep = Weapons_from(self.ok_lastwep); + if(self.ok_lastwep == WEP_HMG.m_id) + newwep = WEP_MACHINEGUN; + if(self.ok_lastwep == WEP_RPC.m_id) + newwep = WEP_VORTEX; + PS(self).m_switchweapon = newwep; + LOG_INFO("Overkill PlayerPreThink weapon setting at time ", ftos(time), "\n"); self.ok_lastwep = 0; } diff --git a/qcsrc/server/cl_impulse.qc b/qcsrc/server/cl_impulse.qc index 917a95f17..47c5354c6 100644 --- a/qcsrc/server/cl_impulse.qc +++ b/qcsrc/server/cl_impulse.qc @@ -53,7 +53,12 @@ #define X(slot) \ IMPULSE(weapon_group_##slot) \ { \ - if (IS_DEAD(this)) return; \ + if (IS_DEAD(this)) \ + { \ + this.impulse = IMP_weapon_group_##slot.impulse; \ + return; \ + } \ + LOG_INFO("PlayerPostThink impulse setting at time ", ftos(time), "\n"); \ W_NextWeaponOnImpulse(slot); \ } X(1) @@ -74,10 +79,15 @@ X(0) IMPULSE(weapon_priority_##slot##_##dir) \ { \ if (this.vehicle) return; \ - if (IS_DEAD(this)) 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; \ + LOG_INFO("Setting weapon by cycle\n"); \ W_CycleWeapon(this.cvar_cl_weaponpriorities[slot], dir); \ } X(0, prev) @@ -120,7 +130,12 @@ X(9, next) IMPULSE(weapon_byid_##i) \ { \ if (this.vehicle) return; \ - if (IS_DEAD(this)) return; \ + if (IS_DEAD(this)) \ + { \ + this.impulse = IMP_weapon_byid_##i.impulse; \ + return; \ + } \ + LOG_INFO("Setting weapon by ID\n"); \ W_SwitchWeapon(Weapons_from(WEP_FIRST + i)); \ } X(0) @@ -152,42 +167,72 @@ X(23) IMPULSE(weapon_next_byid) { if (this.vehicle) return; - if (IS_DEAD(this)) return; + if (IS_DEAD(this)) + { + this.impulse = IMP_weapon_next_byid.impulse; + return; + } + LOG_INFO("Setting next by ID\n"); W_NextWeapon(0); } IMPULSE(weapon_prev_byid) { if (this.vehicle) return; - if (IS_DEAD(this)) return; + if (IS_DEAD(this)) + { + this.impulse = IMP_weapon_prev_byid.impulse; + return; + } + LOG_INFO("Setting prev by ID\n"); W_PreviousWeapon(0); } IMPULSE(weapon_next_bygroup) { if (this.vehicle) return; - if (IS_DEAD(this)) return; + if (IS_DEAD(this)) + { + this.impulse = IMP_weapon_next_bygroup.impulse; + return; + } + LOG_INFO("Setting next by group\n"); W_NextWeapon(1); } IMPULSE(weapon_prev_bygroup) { if (this.vehicle) return; - if (IS_DEAD(this)) return; + if (IS_DEAD(this)) + { + this.impulse = IMP_weapon_prev_bygroup.impulse; + return; + } + LOG_INFO("Setting prev by group\n"); W_PreviousWeapon(1); } IMPULSE(weapon_next_bypriority) { if (this.vehicle) return; - if (IS_DEAD(this)) return; + if (IS_DEAD(this)) + { + this.impulse = IMP_weapon_next_bypriority.impulse; + return; + } + LOG_INFO("Setting next by priority\n"); W_NextWeapon(2); } IMPULSE(weapon_prev_bypriority) { if (this.vehicle) return; - if (IS_DEAD(this)) return; + if (IS_DEAD(this)) + { + this.impulse = IMP_weapon_prev_bypriority.impulse; + return; + } + LOG_INFO("Setting prev by priority\n"); W_PreviousWeapon(2); }