Skip to content

Commit eaeaa6f

Browse files
committed
fix budhha and god not working with blast jumps
1 parent 2998010 commit eaeaa6f

File tree

2 files changed

+30
-9
lines changed

2 files changed

+30
-9
lines changed

game/server/tf/tf_player.cpp

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8534,7 +8534,15 @@ int CTFPlayer::OnTakeDamage( const CTakeDamageInfo &inputInfo )
85348534
CTFWeaponBase *pWeapon = dynamic_cast< CTFWeaponBase * >( inputInfo.GetWeapon() );
85358535

85368536
if ( GetFlags() & FL_GODMODE )
8537+
{
8538+
if (info.GetInflictor() == this)
8539+
{
8540+
Vector vecDir;
8541+
GetAttackVector(info, vecDir);
8542+
ApplyPushFromDamage(info, vecDir);
8543+
}
85378544
return 0;
8545+
}
85388546

85398547
if ( IsInCommentaryMode() )
85408548
return 0;
@@ -8550,6 +8558,12 @@ int CTFPlayer::OnTakeDamage( const CTakeDamageInfo &inputInfo )
85508558
{
85518559
if ( ( m_iHealth - info.GetDamage() ) <= 0 )
85528560
{
8561+
if (info.GetInflictor() == this)
8562+
{
8563+
Vector vecDir;
8564+
GetAttackVector(info, vecDir);
8565+
ApplyPushFromDamage(info, vecDir);
8566+
}
85538567
m_iHealth = 1;
85548568
return 0;
85558569
}
@@ -10002,6 +10016,17 @@ void CTFPlayer::PlayDamageResistSound( float flStartDamage, float flModifiedDama
1000210016
}
1000310017
}
1000410018

10019+
void CTFPlayer::GetAttackVector(const CTakeDamageInfo& info, Vector& vecDir)
10020+
{
10021+
vecDir = vec3_origin;
10022+
if ( info.GetInflictor() )
10023+
{
10024+
vecDir = info.GetInflictor()->WorldSpaceCenter() - Vector ( 0.0f, 0.0f, 10.0f ) - WorldSpaceCenter();
10025+
info.GetInflictor()->AdjustDamageDirection( info, vecDir, this );
10026+
VectorNormalize( vecDir );
10027+
}
10028+
}
10029+
1000510030
//-----------------------------------------------------------------------------
1000610031
// Purpose:
1000710032
// Input : &info -
@@ -10042,14 +10067,9 @@ int CTFPlayer::OnTakeDamage_Alive( const CTakeDamageInfo &info )
1004210067

1004310068
// Grab the vector of the incoming attack.
1004410069
// (Pretend that the inflictor is a little lower than it really is, so the body will tend to fly upward a bit).
10045-
Vector vecDir = vec3_origin;
10046-
if ( info.GetInflictor() )
10047-
{
10048-
vecDir = info.GetInflictor()->WorldSpaceCenter() - Vector ( 0.0f, 0.0f, 10.0f ) - WorldSpaceCenter();
10049-
info.GetInflictor()->AdjustDamageDirection( info, vecDir, this );
10050-
VectorNormalize( vecDir );
10051-
}
10052-
g_vecAttackDir = vecDir;
10070+
Vector vecDir;
10071+
GetAttackVector(info, vecDir);
10072+
g_vecAttackDir = vecDir;
1005310073

1005410074
// Do the damage.
1005510075
m_bitsDamageType |= info.GetDamageType();

game/server/tf/tf_player.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ class CTFPlayer : public CBaseMultiplayerPlayer, public IHasAttributes, public I
166166
virtual bool ShouldCollide( int collisionGroup, int contentsMask ) const;
167167
void ApplyPushFromDamage( const CTakeDamageInfo &info, Vector vecDir );
168168
void PlayDamageResistSound( float flStartDamage, float flModifiedDamage );
169-
bool CheckBlockBackstab( CTFPlayer *pTFAttacker );
169+
void GetAttackVector(const CTakeDamageInfo& info, Vector& vecDir);
170+
bool CheckBlockBackstab( CTFPlayer *pTFAttacker );
170171

171172
virtual bool Weapon_CanSwitchTo( CBaseCombatWeapon *pWeapon );
172173

0 commit comments

Comments
 (0)