X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fw_shotgun.qc;h=e5ab80ae33952d311e0c56ed310dc25ab1f505d5;hb=e0c76a13de11a8e14284021a420c0908a8186507;hp=08c4a901e12083d7bdd972ed8755e3010cf97d9e;hpb=4807d95dd32464be05ee8d6bfcb815550524f949;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/w_shotgun.qc b/qcsrc/server/w_shotgun.qc index 08c4a901e..e5ab80ae3 100644 --- a/qcsrc/server/w_shotgun.qc +++ b/qcsrc/server/w_shotgun.qc @@ -1,5 +1,5 @@ #ifdef REGISTER_WEAPON -REGISTER_WEAPON(SHOTGUN, w_shotgun, IT_SHELLS, 2, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_LOW, "shotgun", "shotgun", "Shotgun"); +REGISTER_WEAPON(SHOTGUN, w_shotgun, IT_SHELLS, 2, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_LOW, "shotgun", "shotgun", _("Shotgun")) #else #ifdef SVQC void W_Shotgun_Attack (void) @@ -56,9 +56,12 @@ void shotgun_meleethink (void) vector angle; angle = v_forward; + float meleetime; + meleetime = autocvar_g_balance_shotgun_secondary_melee_time * W_WeaponRateFactor(); + // perform trace float f; - f = (self.cnt + autocvar_g_balance_shotgun_secondary_melee_time - time) / autocvar_g_balance_shotgun_secondary_melee_time * 2 - 1; + f = (self.cnt + meleetime - time) / meleetime * 2 - 1; vector targpos; targpos = self.owner.origin + self.owner.view_ofs + angle * autocvar_g_balance_shotgun_secondary_melee_range + v_right * f * autocvar_g_balance_shotgun_secondary_melee_swing + v_up * f * autocvar_g_balance_shotgun_secondary_melee_swing; @@ -74,7 +77,7 @@ void shotgun_meleethink (void) Damage (trace_ent, self.owner, self.owner, autocvar_g_balance_shotgun_secondary_damage * min(1, f + 1), WEP_SHOTGUN | HITTYPE_SECONDARY , self.owner.origin + self.owner.view_ofs, force); remove(self); } - else if(time >= self.cnt + autocvar_g_balance_shotgun_secondary_melee_time) // missed, remove ent + else if(time >= self.cnt + meleetime) // missed, remove ent remove(self); else // continue swinging the weapon in hope of hitting someone :) self.nextthink = time;