コード例 #1
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CObjectSapper::Killed( const CTakeDamageInfo &info )
{
	// If the sapper is removed by someone other than builder, award bonus points.
	CTFPlayer *pScorer = ToTFPlayer( TFGameRules()->GetDeathScorer( info.GetAttacker(), info.GetInflictor(), this ) );
	if ( pScorer )
	{
		CBaseObject *pObject = GetParentObject();
		if ( pObject && pScorer != pObject->GetBuilder() )
		{
			CTF_GameStats.Event_PlayerAwardBonusPoints( pScorer, this, 1 );
		}
	}

	BaseClass::Killed( info );
}