source-sdk-2013 icon indicating copy to clipboard operation
source-sdk-2013 copied to clipboard

[HL2MP] Fix spectator exploits

Open speedvoltage opened this issue 9 months ago • 2 comments

Issue: By default, it is possible to unfairly kill people when attacking them and switching to spectators quickly.

Example: If TDM is enabled and you throw a grenade to a team mate and switch to spectators before that grenade blows, then that grenade will hurt or kill what used to be your team mate. This is because the game thinks you are no longer in the same team, and logically, you are not anymore.

Fix: The fix is to treat all damage done by anyone in spectators as no damage. This fix also applies if TDM is disabled.

speedvoltage avatar Mar 14 '25 21:03 speedvoltage

why not check the projectile's team instead of the attacker's team?

wgetJane avatar Mar 15 '25 03:03 wgetJane

why not check the projectile's team instead of the attacker's team?

iirc in HL2MP projectiles aren't assigned to a team, so its owner's team has to be checked.

EDIT: also unlike TF2, HL2 bullets don't have a projectile assigned to them. HL2 Bullets are raycast and are controlled through FireBullets which can be called on the weapon or the player (preferably on the player though so the player can get kills properly)

Bitl avatar Mar 16 '25 02:03 Bitl