Skip to content

Commit d9cccfb

Browse files
committed
Fix trigger_fall not working in TF2
1 parent 24f9063 commit d9cccfb

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

src/game/server/player.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5533,6 +5533,10 @@ void CBasePlayer::Spawn( void )
55335533
}
55345534

55355535
m_weaponFiredTimer.Invalidate();
5536+
5537+
#ifdef MAPBASE
5538+
m_bInTriggerFall = false;
5539+
#endif
55365540
}
55375541

55385542
void CBasePlayer::Activate( void )

src/game/server/tf/tf_player.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9222,6 +9222,13 @@ int CTFPlayer::OnTakeDamage( const CTakeDamageInfo &inputInfo )
92229222
{
92239223
bAllowDamage = true;
92249224
}
9225+
#ifdef MAPBASE
9226+
else if ( info.GetDamageType() & DMG_FALL && m_bInTriggerFall )
9227+
{
9228+
// trigger_fall should always kill
9229+
bAllowDamage = true;
9230+
}
9231+
#endif
92259232

92269233
if ( !TFGameRules()->ApplyOnDamageModifyRules( info, this, bAllowDamage ) )
92279234
{

src/game/shared/tf/tf_gamerules.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13333,6 +13333,14 @@ float CTFGameRules::FlPlayerFallDamage( CBasePlayer *pPlayer )
1333313333
if ( !pTFPlayer )
1333413334
return 0;
1333513335

13336+
#ifdef MAPBASE
13337+
// trigger_fall overrides all fall damage conditions
13338+
if ( pTFPlayer->m_bInTriggerFall )
13339+
{
13340+
return pPlayer->GetMaxHealth();
13341+
}
13342+
#endif
13343+
1333613344
// Karts don't take fall damage
1333713345
if ( pTFPlayer->m_Shared.InCond( TF_COND_HALLOWEEN_KART ) )
1333813346
{

0 commit comments

Comments
 (0)