Skip to content

Commit ae880cb

Browse files
committed
improve custom items handling
1 parent 546de97 commit ae880cb

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/game/server/tf/tf_player.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ class CTFPlayer : public CBaseMultiplayerPlayer, public IHasAttributes, public I
677677
CEconItemView* GetEquippedItemForLoadoutSlot(int iLoadoutSlot) {
678678
auto itemID = m_EquippedLoadoutItemIndices[iLoadoutSlot];
679679
CEconItemView* pItem;
680-
if (itemID < 100000)
680+
if (itemID < TF_CUSTOM_ITEMS_ID_LIMIT)
681681
{
682682
int count = TFInventoryManager()->GetSoloItemCount();
683683
for (int i = 0; i < count; i++)

src/game/shared/tf/tf_item_inventory.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ bool CTFInventoryManager::EquipItemInLoadout( int iClass, int iSlot, itemid_t iI
312312
#ifdef BDSBASE
313313
CEconItemView* pItem = m_LocalInventory.GetInventoryItemByItemID(iItemID);
314314

315-
if (iItemID < 100000)
315+
if (iItemID < TF_CUSTOM_ITEMS_ID_LIMIT)
316316
{
317317
int count = TFInventoryManager()->GetSoloItemCount();
318318
for (int i = 0; i < count; i++)
@@ -1170,7 +1170,7 @@ void CTFPlayerInventory::EquipLocal(uint64 ulItemID, equipped_class_t unClass, e
11701170
#ifdef BDSBASE
11711171
itemid_t ulPreviousItem = m_LoadoutItems[unClass][unSlot];
11721172

1173-
if (ulPreviousItem != 0 && ulPreviousItem < 100000)
1173+
if (ulPreviousItem != 0 && ulPreviousItem < TF_CUSTOM_ITEMS_ID_LIMIT)
11741174
{
11751175
int count = TFInventoryManager()->GetSoloItemCount();
11761176
for (int i = 0; i < count; i++)
@@ -1201,7 +1201,7 @@ void CTFPlayerInventory::EquipLocal(uint64 ulItemID, equipped_class_t unClass, e
12011201

12021202
// Equip the new item and add it to our loadout.
12031203
#ifdef BDSBASE
1204-
if (ulItemID < 100000)
1204+
if (ulItemID < TF_CUSTOM_ITEMS_ID_LIMIT)
12051205
{
12061206
int count = TFInventoryManager()->GetSoloItemCount();
12071207
CEconItemView* pItem = NULL;
@@ -1709,7 +1709,7 @@ CEconItemView* CTFPlayerInventory::GetDefaultItemInLoadout(int iClass, int iSlot
17091709
return pItem;
17101710
}
17111711

1712-
if (m_LoadoutItems[iClass][iSlot] < 100000)
1712+
if (m_LoadoutItems[iClass][iSlot] < TF_CUSTOM_ITEMS_ID_LIMIT)
17131713
{
17141714
int count = TFInventoryManager()->GetSoloItemCount();
17151715

src/game/shared/tf/tf_item_inventory.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
#define LOADOUT_SLOT_USE_BASE_ITEM 0
2323

24+
#ifdef BDSBASE
25+
#define TF_CUSTOM_ITEMS_ID_LIMIT 65536
26+
#endif
27+
2428
namespace vgui
2529
{
2630
class Panel;

0 commit comments

Comments
 (0)