From b456b1dd42356d159f29154a30ffd5cc41d7eb04 Mon Sep 17 00:00:00 2001 From: rabscootle Date: Tue, 13 Jan 2026 20:27:55 -0600 Subject: [PATCH 1/3] Added support to display Stat Clock values on world models --- src/game/client/tf/c_tf_player.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/game/client/tf/c_tf_player.cpp b/src/game/client/tf/c_tf_player.cpp index ca482d17d1..1d5074f765 100644 --- a/src/game/client/tf/c_tf_player.cpp +++ b/src/game/client/tf/c_tf_player.cpp @@ -3137,6 +3137,31 @@ bool CStatTrakDigitProxy::HelperOnBindGetStatTrakScore( void *pC_BaseEntity, int } } } + else + { + CTFWeaponBase* pWeap = NULL; + + // Check if it's an attachment model (world model) + C_TFWeaponAttachmentModel* pAttachment = dynamic_cast(pEntity); + if (pAttachment) + { + // StatTrak will be child of world model it is attached to + 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 { From ffb82190eb51a97a49e9f4219edf0c57d0649873 Mon Sep 17 00:00:00 2001 From: rabscootle Date: Tue, 13 Jan 2026 21:12:19 -0600 Subject: [PATCH 2/3] Added support for dropped weapons to display strange count --- src/game/client/tf/c_tf_player.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/game/client/tf/c_tf_player.cpp b/src/game/client/tf/c_tf_player.cpp index 1d5074f765..ed5fceac7f 100644 --- a/src/game/client/tf/c_tf_player.cpp +++ b/src/game/client/tf/c_tf_player.cpp @@ -3141,17 +3141,18 @@ bool CStatTrakDigitProxy::HelperOnBindGetStatTrakScore( void *pC_BaseEntity, int { CTFWeaponBase* pWeap = NULL; - // Check if it's an attachment model (world model) + // Check if it's an attachment for world model C_TFWeaponAttachmentModel* pAttachment = dynamic_cast(pEntity); if (pAttachment) { - // StatTrak will be child of world model it is attached to + // 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(); @@ -3161,6 +3162,23 @@ bool CStatTrakDigitProxy::HelperOnBindGetStatTrakScore( void *pC_BaseEntity, int 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 From c6af963e69ae58613300b9f0b0efe3148a7326a9 Mon Sep 17 00:00:00 2001 From: rabscootle Date: Fri, 16 Jan 2026 09:59:56 -0600 Subject: [PATCH 3/3] Updated formatting --- src/game/client/tf/c_tf_player.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/game/client/tf/c_tf_player.cpp b/src/game/client/tf/c_tf_player.cpp index ed5fceac7f..8100b28f3c 100644 --- a/src/game/client/tf/c_tf_player.cpp +++ b/src/game/client/tf/c_tf_player.cpp @@ -3142,21 +3142,21 @@ bool CStatTrakDigitProxy::HelperOnBindGetStatTrakScore( void *pC_BaseEntity, int CTFWeaponBase* pWeap = NULL; // Check if it's an attachment for world model - C_TFWeaponAttachmentModel* pAttachment = dynamic_cast(pEntity); - if (pAttachment) + 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) + if ( pParent ) { - pWeap = dynamic_cast(pParent); + pWeap = dynamic_cast( pParent ); } } - if (pWeap) + if ( pWeap ) { CEconItemView* pItem = pWeap->GetAttributeContainer()->GetItem(); - if (pItem && pItem->FindAttribute(GetKillEaterAttr_Score(0), &unScore)) + if ( pItem && pItem->FindAttribute( GetKillEaterAttr_Score( 0 ), &unScore ) ) { *piScore = unScore; bReturnValue = true; @@ -3166,13 +3166,13 @@ bool CStatTrakDigitProxy::HelperOnBindGetStatTrakScore( void *pC_BaseEntity, int { // Are we dealing with a dropped weapon? C_BaseEntity* pParent = pEntity->GetMoveParent(); - CTFDroppedWeapon* pDroppedWeapon = dynamic_cast(pParent); + CTFDroppedWeapon* pDroppedWeapon = dynamic_cast( pParent ); - if (pDroppedWeapon) + 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)) + if ( pItem && pItem->FindAttribute( GetKillEaterAttr_Score( 0 ), &unScore ) ) { *piScore = unScore; bReturnValue = true;