Repository navigation
Store silenced and variant gun damage under the right gun - #293
Merged
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
player_hurtnames a weapon by its entity class, and those five guns are built on their base gun's class.player_deathnames 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.CommunityWeapons.InHandwith 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.PlayerHurt.WeaponStringas wrong for the CZ and M4A1-S, and in demo-parser'stest.demplayer_hurtsaidmp7for 10 hits from an attacker holding an MP5-SD.player_damagesrows saym4a1_silencer/usp_silencer.