Skip to content

Commit 1da3096

Browse files
committed
make add_give_health_to_teammate_on_hit respect other healing attributes and count as healing
1 parent 23ab059 commit 1da3096

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

game/quiver/info_changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ Added the following Source SDK Pull Requests:
7676
- #1508: Add C_BaseEntity::CanGlow to opt-out of glowing for Sentry Gun shield
7777
- #1509: Fix reanimator fast revive exploit
7878
- #1512: Explain client crash reason when malicious server sends CUtlVector length out of allowed range
79+
- #1514: Crusader's Crossbow arrow healing is now affected by mult_health_fromhealers (used by Back Scratcher)
80+
- #1515: Add "ParticleEffectStopAndDestroy" Client Effect and "DestroyImmediately" Input for info_particle_system
7981

8082
Details:
8183
- Fixed a bug where the mini-crit damage effect doesn't show up when your shield breaks.

src/game/shared/tf/tf_weaponbase_melee.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,11 +811,35 @@ bool CTFWeaponBaseMelee::OnSwingHit( trace_t &trace )
811811
// Give health to teammates on hit
812812
int nGiveHealthOnHit = 0;
813813
CALL_ATTRIB_HOOK_INT( nGiveHealthOnHit, add_give_health_to_teammate_on_hit );
814+
815+
#ifdef BDSBASE
816+
//scaled by other attributes
817+
CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(pTargetPlayer, nGiveHealthOnHit, mult_healing_from_medics);
818+
CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(pTargetPlayer, nGiveHealthOnHit, mult_health_fromhealers);
819+
820+
// Don't heal players using a weapon that blocks healing
821+
CTFWeaponBase* pWeapon = pTargetPlayer->GetActiveTFWeapon();
822+
if (pWeapon)
823+
{
824+
CALL_ATTRIB_HOOK_FLOAT_ON_OTHER(pWeapon, nGiveHealthOnHit, mult_health_fromhealers_penalty_active);
825+
826+
int iBlockHealing = 0;
827+
CALL_ATTRIB_HOOK_INT_ON_OTHER(pWeapon, iBlockHealing, weapon_blocks_healing);
828+
if (iBlockHealing)
829+
{
830+
nGiveHealthOnHit = 0;
831+
}
832+
}
833+
#endif
834+
814835
if ( nGiveHealthOnHit != 0 )
815836
{
816837
// Always keep at least 1 health for ourselves
817838
nGiveHealthOnHit = Min( pPlayer->GetHealth() - 1, nGiveHealthOnHit );
818839
int nHealthGiven = pTargetPlayer->TakeHealth( nGiveHealthOnHit, DMG_GENERIC );
840+
#ifdef BDSBASE
841+
CTF_GameStats.Event_PlayerHealedOther(pPlayer, nGiveHealthOnHit);
842+
#endif
819843

820844
if ( nHealthGiven > 0 )
821845
{

0 commit comments

Comments
 (0)