saul / demofile-net

Blazing fast cross-platform demo parser library for Counter-Strike 2 and Valve's Deadlock, written in C#.
MIT License
111 stars 10 forks source link

on PlayerHurt USP returns as P2000 #18

Closed aintalike217 closed 9 months ago

aintalike217 commented 1 year ago

e.Weapon on PlayerHurt returns hpk2000 instead of usp_silencer. Also the same problem appears in player's Weapons, usp_silencer returned as hpk2000. It is strange since on PlayerDeath everything works right.

saul commented 1 year ago

For player_hurt, can you try getting the active weapon of the attacker instead? From that you should be able to get much more detailed economy/item information than what's provided in the game event

aintalike217 commented 1 year ago

Yes, it will be a fix for getting the right weapon on PlayerHurt. But if player active weapon is any from slot 1, and we want to get his full inventory, USP-S will be P2000 in MyWeapons. I understand that probably 99% don't bother about it, just decided to let you know.

saul commented 12 months ago

Please can you share some example code, a demo and what you expect the output to be? ActiveWeapon and MyWeapons should always give access to the weapon's economy info (e.g. whether it's USP-S, what the paintkit is, rarity, etc)