Skip to content

Commit

Permalink
Make mod_use_metal_ammo_type attribute class effective
Browse files Browse the repository at this point in the history
This happens in a particular code path that doesn't otherwise use
attributes.

Fixes #65.
  • Loading branch information
nosoop committed Aug 30, 2024
1 parent 6d4a51b commit 66bf3b3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripting/cwx/item_config.sp
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,14 @@ int EquipCustomItem(int client, const CustomItemDefinition item) {
int weaponSlot = TF2Util_GetWeaponSlot(itemEntity);
bRemovedWeaponInSlot = IsValidEntity(GetPlayerWeaponSlot(client, weaponSlot));
TF2_RemoveWeaponSlot(client, weaponSlot);

/**
* ::Spawn calls ::Precache, which is where mod_use_metal_ammo_type takes effect.
*
* Calling this a second time (after TF2_CreateItem) may have side effects that I'm not
* aware of, but we'll burn that bridge when we cross it.
*/
DispatchSpawn(itemEntity);
}

// we didn't remove a weapon by its weapon slot; remove item based on loadout slot
Expand Down

0 comments on commit 66bf3b3

Please sign in to comment.