diff --git a/src/game/client/tf/c_tf_player.cpp b/src/game/client/tf/c_tf_player.cpp index ca482d17d1..8100b28f3c 100644 --- a/src/game/client/tf/c_tf_player.cpp +++ b/src/game/client/tf/c_tf_player.cpp @@ -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( 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( 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( 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 {