diff --git a/plugins/tf2item_weapons.smx b/plugins/tf2item_weapons.smx index 1cfd589..8ddb049 100644 Binary files a/plugins/tf2item_weapons.smx and b/plugins/tf2item_weapons.smx differ diff --git a/scripting/tf2item_weapons.sp b/scripting/tf2item_weapons.sp index 594e18d..1fb80db 100644 --- a/scripting/tf2item_weapons.sp +++ b/scripting/tf2item_weapons.sp @@ -3,7 +3,7 @@ #pragma semicolon 1 #pragma newdecls required -#define PLUGIN_VERSION "3.1.2" +#define PLUGIN_VERSION "3.1.3" public Plugin myinfo = { @@ -625,6 +625,14 @@ public Action TF2Items_OnGiveNamedItem(int client, char[] classname, int iItemDe // Ignore cosmetic items. if (StrContains(classname, "tf_wearable", false) != -1) return Plugin_Continue; + TFClassType class = TF2_GetPlayerClass(client); + + // Ignore disguise weapons (we do NOT have an entity index here, so we can't check directly for m_bDisguiseWeapon) + if (class == TFClass_Spy) { + // They're a Spy. Check if this weapon being given corresponds to their class. + if (TF2Econ_GetItemLoadoutSlot(iItemDefinitionIndex, class) == -1) return Plugin_Continue; + } + // Turn the item ID into the strange variant just to be sure. bool changed = StockToStrange(iItemDefinitionIndex); diff --git a/scripting/tf2items/tf2item_base.inc b/scripting/tf2items/tf2item_base.inc index 79c5864..301d29d 100644 --- a/scripting/tf2items/tf2item_base.inc +++ b/scripting/tf2items/tf2item_base.inc @@ -13,6 +13,12 @@ /* * Change-Log * + * 3.1.3 - 13/11/21 + * tf2item_weapons + * - Fixed #16 + * - Players with set overrides on any class could mask item indexes to be given weapons they must not equip by disguising. + * - Disguise Weapons would fire TF2Items_OnGiveNamedItem + * * 3.1.2 - 04/11/21 * General * - Fixed ArrayLists not being properly initialized through map changes.