From 5e374479d833d1b5ab5e0ded1a66e48221845984 Mon Sep 17 00:00:00 2001 From: cypress Date: Mon, 8 Jan 2024 12:39:48 -0500 Subject: [PATCH] SERVER: Add a Blacklist for weapons that should not play Pack-A-Punch fire sfx --- source/server/weapons/weapon_core.qc | 2 +- source/shared/weapon_defines.qc | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/source/server/weapons/weapon_core.qc b/source/server/weapons/weapon_core.qc index 4d466fa..b730df9 100644 --- a/source/server/weapons/weapon_core.qc +++ b/source/server/weapons/weapon_core.qc @@ -1183,7 +1183,7 @@ void(float side) W_Fire = self.fire_delay2 = getWeaponDelay(self.weapon, FIRE) + time; } - if (IsPapWeapon(self.weapon)) { + if (IsPapWeapon(self.weapon) && !WepDef_DoesNotPlayUpgradedSound(self.weapon)) { sound (self, 0, "sounds/weapons/papfire.wav", 1, ATTN_NORM); } diff --git a/source/shared/weapon_defines.qc b/source/shared/weapon_defines.qc index 0771c3e..e3d94de 100644 --- a/source/shared/weapon_defines.qc +++ b/source/shared/weapon_defines.qc @@ -4567,6 +4567,25 @@ float(float weapon) WepDef_DoesNotADS = return false; } +// +// WepDef_DoesNotPlayUpgradedSound(weapon) +// Returns true if the weapon should not play +// the special Pack-A-Punch fire sound over +// it's standard weapon fire. +// +float(float weapon) WepDef_DoesNotPlayUpgradedSound = +{ + switch(weapon) { + case W_DG3: + case W_PORTER: + return true; + default: + return false; + } + + return false; +} + // // WepDef_OnlyOneAllowed(weapon) // Returns true if server is only allowed to distribute