StatsHelix / demoinfo

A library to analyze CS:GO demos in C#
MIT License
321 stars 78 forks source link

Player hurt event health damage exceeding players previous health #169

Closed ScouseTeryaki closed 2 years ago

ScouseTeryaki commented 2 years ago

I would like to be able to collect all player damage but using HealthDamage sometimes gives me more damage than actually done. This is because the damage has exceeded the players health, for example a AWP headshot may do 400 damage but a player only has 100 health. I don't know if this is a bug or if I should be using a method of retrieving the players health prior to the damage event.

ScouseTeryaki commented 2 years ago

Nevermind I had to use HealthDamage = e.Player.HP < e.HealthDamage ? e.Player.HP : e.HealthDamage; to work out the damage.