Skip to content

Commit bcd78ab

Browse files
committed
add support for custom taunts (that i will never use outside of testing lmao)
1 parent 6b0a346 commit bcd78ab

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

src/game/client/tf/c_tf_player.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5089,7 +5089,13 @@ void C_TFPlayer::UpdateTauntItem()
50895089
{
50905090
int iClass = GetPlayerClass()->GetClassIndex();
50915091

5092+
#ifdef BDSBASE
5093+
#ifdef BDSBASE_CUSTOM_SCHEMA
5094+
CEconItemView* pMiscItemView = Inventory() ? Inventory()->GetItemInLoadout(iClass, m_nActiveTauntSlot) : NULL;
5095+
#else
50925096
CEconItemView *pMiscItemView = Inventory() ? Inventory()->GetCacheServerItemInLoadout( iClass, m_nActiveTauntSlot ) : NULL;
5097+
#endif
5098+
#endif
50935099
if ( pMiscItemView )
50945100
{
50955101
m_TauntEconItemView = *pMiscItemView;

src/game/client/tf/tf_hud_menu_taunt_selection.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,13 @@ void CHudMenuTauntSelection::UpdateItemModelPanels()
319319

320320
CItemModelPanel *pItemModelPanel = m_pItemModelPanels[i];
321321

322+
#ifdef BDSBASE
323+
#ifdef BDSBASE_CUSTOM_SCHEMA
324+
CEconItemView *pOwnedItemInSlot = pPlayer->Inventory()->GetItemInLoadout(iClass, iTauntSlot);
325+
#else
322326
CEconItemView *pOwnedItemInSlot = pPlayer->Inventory()->GetCacheServerItemInLoadout( iClass, iTauntSlot );
327+
#endif
328+
#endif
323329
pItemModelPanel->SetItem( pOwnedItemInSlot );
324330
pItemModelPanel->SetNoItemText( "#Hud_Menu_Taunt_NoItem" );
325331

@@ -445,7 +451,13 @@ static void OpenTauntSelectionUI()
445451
{
446452
for ( int iTauntSlot = LOADOUT_POSITION_TAUNT; iTauntSlot <= LOADOUT_POSITION_TAUNT8; ++iTauntSlot )
447453
{
454+
#ifdef BDSBASE
455+
#ifdef BDSBASE_CUSTOM_SCHEMA
456+
CEconItemView* pItem = pInv->GetItemInLoadout(iClass, iTauntSlot);
457+
#else
448458
CEconItemView *pItem = pInv->GetCacheServerItemInLoadout( iClass, iTauntSlot );
459+
#endif
460+
#endif
449461
if ( pItem && pItem->IsValid() )
450462
{
451463
bHasAnyTauntEquipped = true;

src/game/server/tf/tf_player.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,29 @@ class CTFPlayer : public CBaseMultiplayerPlayer, public IHasAttributes, public I
662662
bool IsZombieCostumeEquipped( void ) const;
663663
bool HasWearablesEquipped( const CSchemaItemDefHandle *ppItemDefs, int nWearables ) const;
664664

665+
#ifdef BDSBASE
666+
#ifdef BDSBASE_CUSTOM_SCHEMA
667+
CEconItemView* GetEquippedItemForLoadoutSlot(int iLoadoutSlot) {
668+
auto itemID = m_EquippedLoadoutItemIndices[iLoadoutSlot];
669+
CEconItemView* pItem;
670+
if (itemID < 100000)
671+
{
672+
int count = TFInventoryManager()->GetSoloItemCount();
673+
for (int i = 0; i < count; i++)
674+
{
675+
pItem = TFInventoryManager()->GetSoloItem(i);
676+
if (pItem && pItem->GetItemDefIndex() == itemID)
677+
{
678+
return pItem;
679+
}
680+
}
681+
}
682+
return m_Inventory.GetInventoryItemByItemID(m_EquippedLoadoutItemIndices[iLoadoutSlot]);
683+
}
684+
#else
665685
CEconItemView *GetEquippedItemForLoadoutSlot( int iLoadoutSlot ){ return m_Inventory.GetInventoryItemByItemID( m_EquippedLoadoutItemIndices[iLoadoutSlot] ); }
686+
#endif
687+
#endif
666688
CBaseEntity *GetEntityForLoadoutSlot( int iLoadoutSlot, bool bForceCheckWearable = false ); //Gets whatever entity is associated with the loadout slot (wearable or weapon)
667689
CTFWearable *GetEquippedWearableForLoadoutSlot( int iLoadoutSlot );
668690

0 commit comments

Comments
 (0)