From: Mario Date: Sun, 8 Mar 2015 14:11:47 +0000 (+1100) Subject: Fix secondary fire affecting primary accuracy in overkill and instagib X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d9639cea2ba6c5436670f1baecbe2cf1af0755ee;p=xonotic%2Fxonotic-data.pk3dir.git Fix secondary fire affecting primary accuracy in overkill and instagib --- diff --git a/qcsrc/common/weapons/w_vaporizer.qc b/qcsrc/common/weapons/w_vaporizer.qc index e0b43ac64..c757ebd85 100644 --- a/qcsrc/common/weapons/w_vaporizer.qc +++ b/qcsrc/common/weapons/w_vaporizer.qc @@ -775,8 +775,10 @@ float W_Vaporizer(float req) W_DecreaseAmmo(WEP_CVAR_SEC(vaporizer, ammo)); // ugly instagib hack to reuse the fire mode of the laser + int oldwep = self.weapon; // we can't avoid this hack + self.weapon = WEP_BLASTER; W_Blaster_Attack( - WEP_VAPORIZER | HITTYPE_SECONDARY, + WEP_BLASTER | HITTYPE_SECONDARY, WEP_CVAR_SEC(vaporizer, shotangle), WEP_CVAR_SEC(vaporizer, damage), WEP_CVAR_SEC(vaporizer, edgedamage), @@ -787,6 +789,7 @@ float W_Vaporizer(float req) WEP_CVAR_SEC(vaporizer, delay), WEP_CVAR_SEC(vaporizer, lifetime) ); + self.weapon = oldwep; // now do normal refire weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(vaporizer, animtime), w_ready); diff --git a/qcsrc/server/mutators/mutator_instagib.qc b/qcsrc/server/mutators/mutator_instagib.qc index 00396820c..c6db80991 100644 --- a/qcsrc/server/mutators/mutator_instagib.qc +++ b/qcsrc/server/mutators/mutator_instagib.qc @@ -236,6 +236,18 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerDamage) if(IS_PLAYER(frag_attacker)) if(DEATH_ISWEAPON(frag_deathtype, WEP_VAPORIZER)) + { + if(frag_target.armorvalue) + { + frag_target.armorvalue -= 1; + frag_damage = 0; + frag_target.damage_dealt += 1; + frag_attacker.damage_dealt += 1; // TODO: change this to a specific hitsound for armor hit + Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_INSTAGIB_LIVES_REMAINING, frag_target.armorvalue); + } + } + + if(IS_PLAYER(frag_attacker) && DEATH_ISWEAPON(frag_deathtype, WEP_BLASTER)) { if(frag_deathtype & HITTYPE_SECONDARY) { @@ -249,14 +261,6 @@ MUTATOR_HOOKFUNCTION(instagib_PlayerDamage) frag_force = '0 0 0'; } } - else if(frag_target.armorvalue) - { - frag_target.armorvalue -= 1; - frag_damage = 0; - frag_target.damage_dealt += 1; - frag_attacker.damage_dealt += 1; // TODO: change this to a specific hitsound for armor hit - Send_Notification(NOTIF_ONE, frag_target, MSG_CENTER, CENTER_INSTAGIB_LIVES_REMAINING, frag_target.armorvalue); - } } } diff --git a/qcsrc/server/mutators/mutator_overkill.qc b/qcsrc/server/mutators/mutator_overkill.qc index dca48795c..0a0f79afd 100644 --- a/qcsrc/server/mutators/mutator_overkill.qc +++ b/qcsrc/server/mutators/mutator_overkill.qc @@ -139,6 +139,8 @@ MUTATOR_HOOKFUNCTION(ok_PlayerPreThink) self.jump_interval = time + WEP_CVAR_PRI(blaster, refire) * W_WeaponRateFactor(); makevectors(self.v_angle); + int oldwep = self.weapon; + self.weapon = WEP_BLASTER; W_Blaster_Attack( WEP_BLASTER | HITTYPE_SECONDARY, WEP_CVAR_SEC(vaporizer, shotangle), @@ -151,6 +153,7 @@ MUTATOR_HOOKFUNCTION(ok_PlayerPreThink) WEP_CVAR_SEC(vaporizer, delay), WEP_CVAR_SEC(vaporizer, lifetime) ); + self.weapon = oldwep; } self.weapon_blocked = false;