Skip to content

Commit 570a2b6

Browse files
committed
1 parent 2592d46 commit 570a2b6

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

src/game/server/tf/tf_player.cpp

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14375,31 +14375,33 @@ int CTFPlayer::GiveAmmo( int iCount, int iAmmoIndex, bool bSuppressSound, EAmmoS
1437514375
// ammo.
1437614376
if ( iAmmoIndex != TF_AMMO_METAL )
1437714377
{
14378-
//int iAmmoBecomesHealth = 0;
14379-
//CALL_ATTRIB_HOOK_INT( iAmmoBecomesHealth, ammo_becomes_health );
14380-
//if ( iAmmoBecomesHealth == 1 )
14381-
//{
14382-
// // Ammo from ground pickups is converted to health.
14383-
// if ( eAmmoSource == kAmmoSource_Pickup )
14384-
// {
14385-
// int iTakenHealth = TakeHealth( iCount, DMG_GENERIC );
14386-
// if ( iTakenHealth > 0 )
14387-
// {
14388-
// if ( !bSuppressSound )
14389-
// {
14390-
// EmitSound( "BaseCombatCharacter.AmmoPickup" );
14391-
// }
14392-
// m_Shared.HealthKitPickupEffects( iCount );
14393-
// }
14394-
// return iTakenHealth;
14395-
// }
14396-
14397-
// // Ammo from the cart or engineer dispensers is flatly ignored.
14398-
// if ( eAmmoSource == kAmmoSource_DispenserOrCart )
14399-
// return 0;
14400-
14401-
// Assert( eAmmoSource == kAmmoSource_Resupply );
14402-
//}
14378+
#ifdef BDSBASE
14379+
int iAmmoBecomesHealth = 0;
14380+
CALL_ATTRIB_HOOK_INT( iAmmoBecomesHealth, ammo_becomes_health );
14381+
if ( iAmmoBecomesHealth == 1 )
14382+
{
14383+
// Ammo from ground pickups is converted to health.
14384+
if ( eAmmoSource == kAmmoSource_Pickup )
14385+
{
14386+
int iTakenHealth = TakeHealth( iCount, DMG_GENERIC );
14387+
if ( iTakenHealth > 0 )
14388+
{
14389+
if ( !bSuppressSound )
14390+
{
14391+
EmitSound( "BaseCombatCharacter.AmmoPickup" );
14392+
}
14393+
m_Shared.HealthKitPickupEffects( iCount );
14394+
}
14395+
return iTakenHealth;
14396+
}
14397+
14398+
// Ammo from the cart or engineer dispensers is flatly ignored.
14399+
if ( eAmmoSource == kAmmoSource_DispenserOrCart )
14400+
return 0;
14401+
14402+
Assert( eAmmoSource == kAmmoSource_Resupply );
14403+
}
14404+
#endif
1440314405

1440414406
// Items that rely on timers to refill ammo use these attributes
1440514407
// Prevents "touch supply closet and spam the thing" scenario.

0 commit comments

Comments
 (0)