Skip to content

[TF2] Uncomment Attribute Code for ammo_becomes_health to Make it Function Again #1301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
50 changes: 25 additions & 25 deletions src/game/server/tf/tf_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14074,31 +14074,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.
Expand Down