1.1 --- a/extensions/cstrike/util_cstrike.cpp Wed Aug 21 00:01:28 2013 -0700
1.2 +++ b/extensions/cstrike/util_cstrike.cpp Wed Aug 21 10:55:12 2013 -0400
1.3 @@ -273,11 +273,11 @@
1.4 case SMCSWeapon_DEFUSER:
1.5 return (int)CSGOWeapon_DEFUSER;
1.6 default:
1.7 - return 0;
1.8 + return (int)CSGOWeapon_NONE;
1.9 }
1.10 #else
1.11 - if (weaponId > 33 || weaponId < 0)
1.12 - return 0;
1.13 + if (weaponId > (int)SMCSWeapon_NIGHTVISION || weaponId < (int)SMCSWeapon_NONE)
1.14 + return (int)SMCSWeapon_NONE;
1.15 else
1.16 return weaponId;
1.17 #endif
1.18 @@ -397,26 +397,26 @@
1.19 case CSGOWeapon_DEFUSER:
1.20 return (int)SMCSWeapon_DEFUSER;
1.21 default:
1.22 - return 0;
1.23 + return (int)SMCSWeapon_NONE;
1.24 }
1.25 #else
1.26 - if (weaponId > 33 || weaponId < 0)
1.27 - return 0;
1.28 + if (weaponId > (int)SMCSWeapon_NIGHTVISION || weaponId < (int)SMCSWeapon_NONE)
1.29 + return (int)SMCSWeapon_NONE;
1.30 else
1.31 return weaponId;
1.32 #endif
1.33 }
1.34 bool IsValidWeaponID(int id)
1.35 {
1.36 - if (id == (int)SMCSWeapon_NONE || id > (int)SMCSWeapon_DEFUSER)
1.37 + if (id <= (int)SMCSWeapon_NONE)
1.38 return false;
1.39 //Why are these even HERE!?! They dont exist in CS:GO but have valid ID's still
1.40 #if SOURCE_ENGINE == SE_CSGO
1.41 - else if (id == (int)SMCSWeapon_P228 || id == (int)SMCSWeapon_SCOUT || id == (int)SMCSWeapon_SG550 || id == (int)SMCSWeapon_GALIL || id == (int)SMCSWeapon_SCAR17 ||
1.42 - id == (int)SMCSWeapon_USP || id == (int)SMCSWeapon_M3 || id == (int)SMCSWeapon_MP5NAVY || id == (int)SMCSWeapon_TMP || id == (int)SMCSWeapon_SG552)
1.43 + else if (id > (int)SMCSWeapon_DEFUSER || id == (int)SMCSWeapon_P228 || id == (int)SMCSWeapon_SCOUT || id == (int)SMCSWeapon_SG550 || id == (int)SMCSWeapon_GALIL ||
1.44 + id == (int)SMCSWeapon_SCAR17 || id == (int)SMCSWeapon_USP || id == (int)SMCSWeapon_M3 || id == (int)SMCSWeapon_MP5NAVY || id == (int)SMCSWeapon_TMP || id == (int)SMCSWeapon_SG552)
1.45 return false;
1.46 #else
1.47 - else if (id > (int)SMCSWeapon_NIGHTVISION || id < (int)SMCSWeapon_NONE)
1.48 + else if (id > (int)SMCSWeapon_NIGHTVISION)
1.49 return false;
1.50 #endif
1.51 return true;