From 312f4315472d735e9e79d0bf7db2870f251d549e Mon Sep 17 00:00:00 2001 From: MarcusKubis9 Date: Fri, 7 Nov 2025 13:59:13 -0800 Subject: [PATCH 1/3] Enable previously disabled attributes --- src/game/server/tf/tf_player.cpp | 50 +++++++++---------- src/game/shared/tf/tf_gamerules.cpp | 30 +++++------ src/game/shared/tf/tf_player_shared.cpp | 2 +- src/game/shared/tf/tf_weapon_flamethrower.cpp | 20 ++++---- src/game/shared/tf/tf_weaponbase.cpp | 33 ++++++------ src/game/shared/tf/tf_weaponbase_gun.cpp | 15 +++--- 6 files changed, 74 insertions(+), 76 deletions(-) diff --git a/src/game/server/tf/tf_player.cpp b/src/game/server/tf/tf_player.cpp index 0b1ccbb61d3..c89c4ad2260 100644 --- a/src/game/server/tf/tf_player.cpp +++ b/src/game/server/tf/tf_player.cpp @@ -14085,31 +14085,31 @@ int CTFPlayer::GiveAmmo( int iCount, int iAmmoIndex, bool bSuppressSound, EAmmoS // ammo. if ( iAmmoIndex != TF_AMMO_METAL ) { - //int iAmmoBecomesHealth = 0; - //CALL_ATTRIB_HOOK_INT( iAmmoBecomesHealth, ammo_becomes_health ); - //if ( iAmmoBecomesHealth == 1 ) - //{ - // // Ammo from ground pickups is converted to health. - // if ( eAmmoSource == kAmmoSource_Pickup ) - // { - // int iTakenHealth = TakeHealth( iCount, DMG_GENERIC ); - // if ( iTakenHealth > 0 ) - // { - // if ( !bSuppressSound ) - // { - // EmitSound( "BaseCombatCharacter.AmmoPickup" ); - // } - // m_Shared.HealthKitPickupEffects( iCount ); - // } - // return iTakenHealth; - // } - - // // Ammo from the cart or engineer dispensers is flatly ignored. - // if ( eAmmoSource == kAmmoSource_DispenserOrCart ) - // return 0; - - // Assert( eAmmoSource == kAmmoSource_Resupply ); - //} + int iAmmoBecomesHealth = 0; + CALL_ATTRIB_HOOK_INT( iAmmoBecomesHealth, ammo_becomes_health ); + if ( iAmmoBecomesHealth == 1 ) + { + // Ammo from ground pickups is converted to health. + if ( eAmmoSource == kAmmoSource_Pickup ) + { + int iTakenHealth = TakeHealth( iCount, DMG_GENERIC ); + if ( iTakenHealth > 0 ) + { + if ( !bSuppressSound ) + { + EmitSound( "BaseCombatCharacter.AmmoPickup" ); + } + m_Shared.HealthKitPickupEffects( iCount ); + } + return iTakenHealth; + } + + // Ammo from the cart or engineer dispensers is flatly ignored. + if ( eAmmoSource == kAmmoSource_DispenserOrCart ) + return 0; + + Assert( eAmmoSource == kAmmoSource_Resupply ); + } // Items that rely on timers to refill ammo use these attributes // Prevents "touch supply closet and spam the thing" scenario. diff --git a/src/game/shared/tf/tf_gamerules.cpp b/src/game/shared/tf/tf_gamerules.cpp index ea7f43039f0..ec5f05563e8 100644 --- a/src/game/shared/tf/tf_gamerules.cpp +++ b/src/game/shared/tf/tf_gamerules.cpp @@ -6244,21 +6244,21 @@ bool CTFGameRules::ApplyOnDamageModifyRules( CTakeDamageInfo &info, CBaseEntity } //// Some weapons minicrit *any* target in the air, regardless of how they got there. - //int iMiniCritAirborneDeploy = 0; - //CALL_ATTRIB_HOOK_INT_ON_OTHER( pWeapon, iMiniCritAirborneDeploy, mini_crit_airborne_deploy ); - //if ( iMiniCritAirborneDeploy > 0 && - // pWeapon && - // ( gpGlobals->curtime - pWeapon->GetLastDeployTime() ) < iMiniCritAirborneDeploy && - // // - - // pVictim && !( pVictim->GetFlags() & FL_ONGROUND ) && - // ( pVictim->GetWaterLevel() == WL_NotInWater ) ) - //{ - // bAllSeeCrit = true; - // info.SetCritType( CTakeDamageInfo::CRIT_MINI ); - // eBonusEffect = kBonusEffect_MiniCrit; - // break; - //} + int iMiniCritAirborneDeploy = 0; + CALL_ATTRIB_HOOK_INT_ON_OTHER( pWeapon, iMiniCritAirborneDeploy, mini_crit_airborne_deploy ); + if ( iMiniCritAirborneDeploy > 0 && + pWeapon && + ( gpGlobals->curtime - pWeapon->GetLastDeployTime() ) < iMiniCritAirborneDeploy && + + + pVictim && !( pVictim->GetFlags() & FL_ONGROUND ) && + ( pVictim->GetWaterLevel() == WL_NotInWater ) ) + { + bAllSeeCrit = true; + info.SetCritType( CTakeDamageInfo::CRIT_MINI ); + eBonusEffect = kBonusEffect_MiniCrit; + break; + } } } diff --git a/src/game/shared/tf/tf_player_shared.cpp b/src/game/shared/tf/tf_player_shared.cpp index 75c6775c551..048fe92fd01 100644 --- a/src/game/shared/tf/tf_player_shared.cpp +++ b/src/game/shared/tf/tf_player_shared.cpp @@ -8201,7 +8201,7 @@ void CTFPlayerShared::Disguise( int nTeam, int nClass, CTFPlayer* pDesiredTarget // Start the think to complete our disguise float flTimeToDisguise = TF_TIME_TO_DISGUISE; - //CALL_ATTRIB_HOOK_INT_ON_OTHER( m_pOuter, iTimeToDisguise, disguise_speed_penalty ); // Unused Attr + CALL_ATTRIB_HOOK_INT_ON_OTHER( m_pOuter, iTimeToDisguise, disguise_speed_penalty ); // STAGING_SPY // Quick disguise if you already disguised diff --git a/src/game/shared/tf/tf_weapon_flamethrower.cpp b/src/game/shared/tf/tf_weapon_flamethrower.cpp index 65810b22251..020da0ee860 100644 --- a/src/game/shared/tf/tf_weapon_flamethrower.cpp +++ b/src/game/shared/tf/tf_weapon_flamethrower.cpp @@ -1232,16 +1232,16 @@ float CTFFlameThrower::GetDeflectionRadius() const { float fMultiplier = 1.0f; - // int iChargedAirblast = 0; - // CALL_ATTRIB_HOOK_INT( iChargedAirblast, set_charged_airblast ); - // if ( iChargedAirblast != 0 ) - // { - // fMultiplier *= RemapValClamped( ( gpGlobals->curtime - m_flChargeBeginTime ), - // 0.0f, - // GetChargeMaxTime(), - // AIRBLAST_CHARGE_MULT_MIN, - // AIRBLAST_CHARGE_MULT_MAX ); - // } + int iChargedAirblast = 0; + CALL_ATTRIB_HOOK_INT( iChargedAirblast, set_charged_airblast ); + if ( iChargedAirblast != 0 ) + { + fMultiplier *= RemapValClamped( ( gpGlobals->curtime - m_flChargeBeginTime ), + 0.0f, + GetChargeMaxTime(), + AIRBLAST_CHARGE_MULT_MIN, + AIRBLAST_CHARGE_MULT_MAX ); + } // Allow custom attributes to scale the deflection size. CALL_ATTRIB_HOOK_FLOAT( fMultiplier, deflection_size_multiplier ); diff --git a/src/game/shared/tf/tf_weaponbase.cpp b/src/game/shared/tf/tf_weaponbase.cpp index 5df220b3c5e..7806739353a 100644 --- a/src/game/shared/tf/tf_weaponbase.cpp +++ b/src/game/shared/tf/tf_weaponbase.cpp @@ -656,7 +656,7 @@ const char *CTFWeaponBase::GetViewModel( int iViewModel ) const int iHandModelIndex = 0; if ( pPlayer ) { - //CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pPlayer, iHandModelIndex, override_hand_model_index ); // this is a cleaner way of doing it, but... + CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pPlayer, iHandModelIndex, override_hand_model_index ); // this is a cleaner way of doing it, but... CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pPlayer, iHandModelIndex, wrench_builds_minisentry ); // ...the gunslinger is the only thing that uses this attribute for now } @@ -2257,19 +2257,19 @@ void CTFWeaponBase::SetReloadTimer( float flReloadTime ) CALL_ATTRIB_HOOK_FLOAT( flReloadTime, fast_reload ); CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pPlayer, flReloadTime, hwn_mult_reload_time ); - //int iPanicAttack = 0; - //CALL_ATTRIB_HOOK_INT( iPanicAttack, panic_attack ); - //if ( iPanicAttack ) - //{ - // if ( pPlayer->GetHealth() < pPlayer->GetMaxHealth() * 0.33f ) - // { - // flReloadTime *= 0.3f; - // } - // else if ( pPlayer->GetHealth() < pPlayer->GetMaxHealth() * 0.66f ) - // { - // flReloadTime *= 0.6f; - // } - //} + int iPanicAttack = 0; + CALL_ATTRIB_HOOK_INT( iPanicAttack, panic_attack ); + if ( iPanicAttack ) + { + if ( pPlayer->GetHealth() < pPlayer->GetMaxHealth() * 0.33f ) + { + flReloadTime *= 0.3f; + } + else if ( pPlayer->GetHealth() < pPlayer->GetMaxHealth() * 0.66f ) + { + flReloadTime *= 0.6f; + } + } // Haste Powerup Rune adds multiplier to reload time. if ( pPlayer->m_Shared.GetCarryingRuneType() == RUNE_HASTE ) @@ -5316,15 +5316,14 @@ void CTFWeaponBase::ApplyOnHitAttributes( CBaseEntity *pVictimBaseEntity, CTFPla } // Damage bonus on hit - // Disabled because we have no attributes that use it - /* + float flAddDamageDoneBonusOnHit = 0; CALL_ATTRIB_HOOK_FLOAT( flAddDamageDoneBonusOnHit, addperc_ondmgdone_tmpbuff ); if ( flAddDamageDoneBonusOnHit ) { pAttacker->m_Shared.AddTmpDamageBonus( flAddDamageDoneBonusOnHit, 10.0 ); } - */ + if ( pVictim ) { diff --git a/src/game/shared/tf/tf_weaponbase_gun.cpp b/src/game/shared/tf/tf_weaponbase_gun.cpp index 58d0dc27075..92aba201d51 100644 --- a/src/game/shared/tf/tf_weaponbase_gun.cpp +++ b/src/game/shared/tf/tf_weaponbase_gun.cpp @@ -706,12 +706,12 @@ CBaseEntity *CTFWeaponBaseGun::FirePipeBomb( CTFPlayer *pPlayer, int iPipeBombTy pProjectile->SetCritical( IsCurrentAttackACrit() ); pProjectile->SetLauncher( this ); - //float flFizzle = 0; - //CALL_ATTRIB_HOOK_FLOAT( flFizzle, stickybomb_fizzle_time ); - //if ( flFizzle ) - //{ - // pProjectile->SetDetonateTimerLength( flFizzle ); - //} + float flFizzle = 0; + CALL_ATTRIB_HOOK_FLOAT( flFizzle, stickybomb_fizzle_time ); + if ( flFizzle ) + { + pProjectile->SetDetonateTimerLength( flFizzle ); + } CAttribute_String attrCustomModelName; GetCustomProjectileModel( &attrCustomModelName ); if ( attrCustomModelName.has_value() ) @@ -1054,8 +1054,7 @@ void CTFWeaponBaseGun::ZoomIn( void ) // TODO: The weapon fov should be gotten from the script file. float fBaseZoom = TF_WEAPON_ZOOM_FOV; - // Disabled this for now, because we have no attributes using it - //CALL_ATTRIB_HOOK_FLOAT( fBaseZoom, mult_zoom_fov ); + CALL_ATTRIB_HOOK_FLOAT( fBaseZoom, mult_zoom_fov ); pPlayer->SetFOV( pPlayer, fBaseZoom, 0.1f ); pPlayer->m_Shared.AddCond( TF_COND_ZOOMED ); From ff69183fe1a9ce0ef8cfbb8cb04c0f7719d24520 Mon Sep 17 00:00:00 2001 From: MarcusKubis9 Date: Fri, 7 Nov 2025 16:23:13 -0800 Subject: [PATCH 2/3] Re-comment out two entirely broken attributes --- src/game/shared/tf/tf_player_shared.cpp | 2 +- src/game/shared/tf/tf_weapon_flamethrower.cpp | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/game/shared/tf/tf_player_shared.cpp b/src/game/shared/tf/tf_player_shared.cpp index 048fe92fd01..75c6775c551 100644 --- a/src/game/shared/tf/tf_player_shared.cpp +++ b/src/game/shared/tf/tf_player_shared.cpp @@ -8201,7 +8201,7 @@ void CTFPlayerShared::Disguise( int nTeam, int nClass, CTFPlayer* pDesiredTarget // Start the think to complete our disguise float flTimeToDisguise = TF_TIME_TO_DISGUISE; - CALL_ATTRIB_HOOK_INT_ON_OTHER( m_pOuter, iTimeToDisguise, disguise_speed_penalty ); + //CALL_ATTRIB_HOOK_INT_ON_OTHER( m_pOuter, iTimeToDisguise, disguise_speed_penalty ); // Unused Attr // STAGING_SPY // Quick disguise if you already disguised diff --git a/src/game/shared/tf/tf_weapon_flamethrower.cpp b/src/game/shared/tf/tf_weapon_flamethrower.cpp index 020da0ee860..de9de6c18e6 100644 --- a/src/game/shared/tf/tf_weapon_flamethrower.cpp +++ b/src/game/shared/tf/tf_weapon_flamethrower.cpp @@ -1232,16 +1232,16 @@ float CTFFlameThrower::GetDeflectionRadius() const { float fMultiplier = 1.0f; - int iChargedAirblast = 0; - CALL_ATTRIB_HOOK_INT( iChargedAirblast, set_charged_airblast ); - if ( iChargedAirblast != 0 ) - { - fMultiplier *= RemapValClamped( ( gpGlobals->curtime - m_flChargeBeginTime ), - 0.0f, - GetChargeMaxTime(), - AIRBLAST_CHARGE_MULT_MIN, - AIRBLAST_CHARGE_MULT_MAX ); - } + //int iChargedAirblast = 0; + //CALL_ATTRIB_HOOK_INT( iChargedAirblast, set_charged_airblast ); + //if ( iChargedAirblast != 0 ) + //{ + // fMultiplier *= RemapValClamped( ( gpGlobals->curtime - m_flChargeBeginTime ), + // 0.0f, + // GetChargeMaxTime(), + // AIRBLAST_CHARGE_MULT_MIN, + // AIRBLAST_CHARGE_MULT_MAX ); + //} // Allow custom attributes to scale the deflection size. CALL_ATTRIB_HOOK_FLOAT( fMultiplier, deflection_size_multiplier ); From 6c63dc211c040692457c6330891a3d4c638ce11f Mon Sep 17 00:00:00 2001 From: MarcusKubis9 Date: Mon, 10 Nov 2025 13:01:25 -0800 Subject: [PATCH 3/3] Update tf_weapon_flamethrower.cpp --- src/game/shared/tf/tf_weapon_flamethrower.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/game/shared/tf/tf_weapon_flamethrower.cpp b/src/game/shared/tf/tf_weapon_flamethrower.cpp index de9de6c18e6..65810b22251 100644 --- a/src/game/shared/tf/tf_weapon_flamethrower.cpp +++ b/src/game/shared/tf/tf_weapon_flamethrower.cpp @@ -1232,16 +1232,16 @@ float CTFFlameThrower::GetDeflectionRadius() const { float fMultiplier = 1.0f; - //int iChargedAirblast = 0; - //CALL_ATTRIB_HOOK_INT( iChargedAirblast, set_charged_airblast ); - //if ( iChargedAirblast != 0 ) - //{ + // int iChargedAirblast = 0; + // CALL_ATTRIB_HOOK_INT( iChargedAirblast, set_charged_airblast ); + // if ( iChargedAirblast != 0 ) + // { // fMultiplier *= RemapValClamped( ( gpGlobals->curtime - m_flChargeBeginTime ), - // 0.0f, - // GetChargeMaxTime(), - // AIRBLAST_CHARGE_MULT_MIN, - // AIRBLAST_CHARGE_MULT_MAX ); - //} + // 0.0f, + // GetChargeMaxTime(), + // AIRBLAST_CHARGE_MULT_MIN, + // AIRBLAST_CHARGE_MULT_MAX ); + // } // Allow custom attributes to scale the deflection size. CALL_ATTRIB_HOOK_FLOAT( fMultiplier, deflection_size_multiplier );