Skip to content

Commit 6f8e92b

Browse files
committed
1 parent bc9a4c3 commit 6f8e92b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/game/server/hl2mp/hl2mp_player.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,21 @@ void CHL2MP_Player::Event_Killed( const CTakeDamageInfo &info )
15681568
CBaseEntity *pAttacker = info.GetAttacker();
15691569

15701570
#ifdef BDSBASE
1571-
if (pAttacker && (pAttacker != this || !FBitSet(m_iSuicideCustomKillFlags, EPlayerSuicideFlag_LockScore)))
1571+
if (HL2MPRules()->IsTeamplay())
1572+
{
1573+
// Check for the attacker being in team Unassigned to account
1574+
// for non-player attackers, which are in this team by default.
1575+
// In TDM, should only happen with deaths to non-player causes.
1576+
if (pAttacker && !pAttacker->InSameTeam(this) && pAttacker->GetTeamNumber() != TEAM_UNASSIGNED)
1577+
{
1578+
pAttacker->GetTeam()->AddScore(1);
1579+
}
1580+
else
1581+
{
1582+
GetTeam()->AddScore(-1);
1583+
}
1584+
}
1585+
else if (pAttacker && (pAttacker != this || !FBitSet(m_iSuicideCustomKillFlags, EPlayerSuicideFlag_LockScore)))
15721586
#else
15731587
if (pAttacker)
15741588
#endif

0 commit comments

Comments
 (0)