Skip to content

Commit

Permalink
ChaosMod: future proof(?) checking logic
Browse files Browse the repository at this point in the history
at least it *better* than hardcoded weapon hashes now
  • Loading branch information
holysnipz committed Feb 17, 2024
1 parent cdedfd9 commit 5a147f7
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions ChaosMod/Util/Weapon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 5a147f7

Please sign in to comment.