source-sdk-2013
source-sdk-2013 copied to clipboard
[HL2MP] Adjust melee hit trace
Issue:
Melee attacks weren't filtering out entities that shouldn't take damage, which leads to situations where melee hits affected immune entities. Additionally, passive entities (like props) weren't getting the right melee damage when neither the attacker nor the victim was a combat character.
Fix:
We added a check to see if an entity can actually be hit by a melee attack before dealing damage, which stops melee strikes from hitting the wrong targets. Now, if neither the attacker nor the victim is a combat character (like NPCs), melee damage is correctly applied to passive entities such as props, making melee interactions with objects in the game more reliable.