Skip to content

Commit

Permalink
Fix persistence being broken for Shotguns
Browse files Browse the repository at this point in the history
Fixes #43.
  • Loading branch information
nosoop committed Jul 16, 2022
1 parent 006b99b commit e2b4c3c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripting/cwx.sp
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,9 @@ MRESReturn OnManageRegularWeaponsPre(int client, Handle hParams) {
char classname[64];
TF2Econ_GetItemClassName(validitemdef, classname, sizeof(classname));

// we need to translate the item class because base shotguns use 'tf_weapon_shotgun'
TF2Econ_TranslateWeaponEntForClass(classname, sizeof(classname), playerClass);

SetEntProp(storedItem, Prop_Send, "m_iItemDefinitionIndex", validitemdef);
SetEntPropString(storedItem, Prop_Data, "m_iClassname", classname);
}
Expand Down

0 comments on commit e2b4c3c

Please sign in to comment.