From 5a147f70e85d9e37a1f25d60fbd0727c2445db2f Mon Sep 17 00:00:00 2001 From: Snipz <9103583+holysnipz@users.noreply.github.com> Date: Sat, 17 Feb 2024 17:10:16 +0700 Subject: [PATCH] ChaosMod: future proof(?) checking logic at least it *better* than hardcoded weapon hashes now --- ChaosMod/Util/Weapon.h | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/ChaosMod/Util/Weapon.h b/ChaosMod/Util/Weapon.h index 848c3d618..fee80989e 100644 --- a/ChaosMod/Util/Weapon.h +++ b/ChaosMod/Util/Weapon.h @@ -4,24 +4,8 @@ using Hash = unsigned long; namespace Util { - // TODO: Maybe CWeaponInfo has some field which can be checked (instead of hardcoding the weapon hashes) inline bool IsWeaponShotgun(Hash weaponHash) { - switch ((long)weaponHash) - { - case 487013001: - case 2017895192: - case -1654528753: - case -494615257: - case -1466123874: - case 984333226: - case -275439685: - case 317205821: - case 1432025498: - case 94989220: - return true; - } - - return false; + return GET_WEAPONTYPE_GROUP(weaponHash) == "GROUP_SHOTGUN"_hash; } } \ No newline at end of file