Permalink
Browse files

Fix some teammate-related assist bugs (closes #336)

 - Fixes Red + Blue1 -> Blue2 type teammate assists (I think they were visual only)
 - Fixes assists being blocked by teammates of the victim if the teammate did the most damage (now it looks for the top valid assister)
  • Loading branch information...
squeek502 committed Aug 1, 2017
1 parent 8321e29 commit 3c8eb9baff4a57115f8f09737fde4a6c234f3e2c
Showing with 8 additions and 5 deletions.
  1. +6 −0 dlls/ff/ff_player.cpp
  2. +2 −5 game_shared/multiplay_gamerules.cpp
View
@@ -7949,6 +7949,12 @@ RecentAttackerInfo* CFFPlayer::GetTopKillAssister( CBasePlayer* killerToIgnore )
// because previous logic prevents adding ourselves to the assist list
bool isKiller = !killedByWorld && pFFAssister == killerToIgnore;
// assists by teammates of the victims don't count
if ( FFGameRules()->PlayerRelationship( this, pFFAssister ) == GR_TEAMMATE )
{
continue;
}
// added simple filter: if they last dmged us more than MAX_ASSIST_TIME_SECS ago, ignore
// if its the killer, dont report also as an assist
if ( gpGlobals->curtime - m_recentAttackers[i].timestamp >= MAX_ASSIST_TIME_SECS || isKiller )
@@ -571,11 +571,8 @@ bool CMultiplayRules::IsMultiplayer( void )
RecentAttackerInfo *pTopAssister = pFFPlayer->GetTopKillAssister( pScorer );
if ( pTopAssister && pTopAssister->hPlayer.Get() )
{
if ( PlayerRelationship( pVictim, pTopAssister->hPlayer.Get() ) != GR_TEAMMATE )
{
pTopAssister->hPlayer->AddFortPoints( 25, "#FF_FORTPOINTS_ASSIST" );
pTopAssister->hPlayer->IncrementAssistsCount( 1 );
}
pTopAssister->hPlayer->AddFortPoints( 25, "#FF_FORTPOINTS_ASSIST" );
pTopAssister->hPlayer->IncrementAssistsCount( 1 );
}
}

0 comments on commit 3c8eb9b

Please sign in to comment.