Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions src/game/client/tf/c_tf_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3137,6 +3137,49 @@ bool CStatTrakDigitProxy::HelperOnBindGetStatTrakScore( void *pC_BaseEntity, int
}
}
}
else
{
CTFWeaponBase* pWeap = NULL;

// Check if it's an attachment for world model
C_TFWeaponAttachmentModel* pAttachment = dynamic_cast<C_TFWeaponAttachmentModel*>( pEntity );
if ( pAttachment )
{
// If we're dealing with a world model, Stat Clock will be it's child attachment
C_BaseEntity* pParent = pAttachment->GetMoveParent();
if ( pParent )
{
pWeap = dynamic_cast<CTFWeaponBase*>( pParent );
}
}

if ( pWeap )
{
CEconItemView* pItem = pWeap->GetAttributeContainer()->GetItem();
if ( pItem && pItem->FindAttribute( GetKillEaterAttr_Score( 0 ), &unScore ) )
{
*piScore = unScore;
bReturnValue = true;
}
}
else
{
// Are we dealing with a dropped weapon?
C_BaseEntity* pParent = pEntity->GetMoveParent();
CTFDroppedWeapon* pDroppedWeapon = dynamic_cast<CTFDroppedWeapon*>( pParent );

if ( pDroppedWeapon )
{
// We're able to extract item attributes from dropped weapons, including strange count
CEconItemView* pItem = pDroppedWeapon->GetItem();
if ( pItem && pItem->FindAttribute( GetKillEaterAttr_Score( 0 ), &unScore ) )
{
*piScore = unScore;
bReturnValue = true;
}
}
}
}
}
else
{
Expand Down