Skip to content
Open
Show file tree
Hide file tree
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
23 changes: 19 additions & 4 deletions src/game/shared/tf/tf_weapon_medigun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,6 @@ bool CWeaponMedigun::FindAndHealTargets( void )

if ( pTFPlayer && weapon_medigun_charge_rate.GetFloat() )
{
#ifdef GAME_DLL
int iBoostMax = floor( pTFPlayer->m_Shared.GetMaxBuffedHealth() * 0.95);
float flChargeModifier = 1.f;

Expand Down Expand Up @@ -1309,7 +1308,7 @@ bool CWeaponMedigun::FindAndHealTargets( void )

CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pOwner, flChargeAmount, mult_medigun_uberchargerate );


#ifdef GAME_DLL
// Apply any bonus our target gives us.
if ( pTarget )
{
Expand All @@ -1322,6 +1321,7 @@ bool CWeaponMedigun::FindAndHealTargets( void )
CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pTarget, flChargeAmount, mult_uberchargerate_for_healer );
}
}
#endif
if ( TFGameRules() )
{
if ( TFGameRules()->IsQuickBuildTime() )
Expand All @@ -1333,7 +1333,6 @@ bool CWeaponMedigun::FindAndHealTargets( void )
flChargeAmount *= 3.f;
}
}
#endif

float flNewLevel = MIN( m_flChargeLevel + flChargeAmount, 1.0 );

Expand Down Expand Up @@ -1611,9 +1610,25 @@ void CWeaponMedigun::ItemPostFrame( void )
m_bReloadDown = false;
}

#ifdef CLIENT_DLL
DrainCharge();
#endif

WeaponIdle();
}

//-----------------------------------------------------------------------------
// Purpose: Drain Ubercharge on client during weapon draw to fix prediction errors
//-----------------------------------------------------------------------------
void CWeaponMedigun::ItemBusyFrame( void )
{
#ifdef CLIENT_DLL
DrainCharge();
#endif

BaseClass::ItemBusyFrame();
}

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -1964,11 +1979,11 @@ void CWeaponMedigun::SecondaryAttack( void )
{
// Remove charge immediately and just give target and yourself the conditions
m_bChargeRelease = false;
SetChargeLevel( m_flChargeLevel - flChunkSize );
#ifdef GAME_DLL
float flResistDuration = weapon_vaccinator_resist_duration.GetFloat();
CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pOwner, flResistDuration, add_uber_time );
pOwner->m_Shared.AddCond( g_MedigunResistConditions[GetResistType()].uberCond, flResistDuration, pOwner );
m_flChargeLevel -= flChunkSize;
if ( pTFPlayerPatient )
{
pTFPlayerPatient->m_Shared.AddCond( g_MedigunResistConditions[GetResistType()].uberCond, flResistDuration, pOwner );
Expand Down
1 change: 1 addition & 0 deletions src/game/shared/tf/tf_weapon_medigun.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class CWeaponMedigun : public CTFWeaponBaseGun
virtual void UpdateOnRemove( void );
virtual void ItemHolsterFrame( void );
virtual void ItemPostFrame( void );
virtual void ItemBusyFrame( void );
virtual bool Lower( void );
virtual void PrimaryAttack( void );
virtual void SecondaryAttack( void );
Expand Down