Skip to content

Store silenced and variant gun damage under the right gun - #293

Merged
lukepolo merged 1 commit into
mainfrom
fix/damage-silenced-weapon-names
Nov 3, 2026
Merged

lukepolo merged 1 commit into
mainfrom
fix/damage-silenced-weapon-names

Conversation

@lukepolo

@lukepolo lukepolo commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Damage from the M4A1-S, USP-S, CZ75, R8 and MP5-SD is now stored under that gun instead of the M4A4, P2000, P250, Deagle or MP7.

  • CS2's player_hurt names a weapon by its entity class, and those five guns are built on their base gun's class. player_death names them correctly, so per-weapon kills and damage stopped lining up: Arsenal showed 0 ADR for the M4A1-S and the M4A4 got its damage.
  • Both runtimes now pass the hurt name through CommunityWeapons.InHand with the attacker's active item definition. That's the same lookup player-management already uses for hurt events, and its tests cover all five pairs.
  • Evidence: demoinfocs documents PlayerHurt.WeaponString as wrong for the CZ and M4A1-S, and in demo-parser's test.dem player_hurt said mp7 for 10 hits from an attacker holding an MP5-SD.
  • Not tested in game. Manual check: on a match pod, deal damage to a real player with an M4A1-S and a USP-S, then confirm the new player_damages rows say m4a1_silencer / usp_silencer.
  • Ship before 5stackgg/api#1048, whose one-time backfill only fixes rows that already exist.

… that gun

player_hurt names the entity class, which CS2 shares with the base gun
(the M4A1-S is a weapon_m4a1), so the damage landed on the M4A4, P2000,
P250, Deagle or MP7 while kills kept the right name. The damage event
now names the gun in hand through CommunityWeapons.InHand, the same
lookup player-management already uses for hurt events.
@lukepolo
lukepolo merged commit c6b34d1 into main Nov 3, 2026
7 checks passed
@lukepolo
lukepolo deleted the fix/damage-silenced-weapon-names branch November 3, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant