From e2b4c3cbfd3289f632fe86dced0ab7756e447814 Mon Sep 17 00:00:00 2001 From: nosoop Date: Sat, 16 Jul 2022 05:36:31 -0700 Subject: [PATCH] Fix persistence being broken for Shotguns Fixes #43. --- scripting/cwx.sp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripting/cwx.sp b/scripting/cwx.sp index a989e26..a95fb0b 100644 --- a/scripting/cwx.sp +++ b/scripting/cwx.sp @@ -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); }