AnAkkk / TFTrue

http://tftrue.esport-tools.net/
GNU General Public License v2.0
38 stars 12 forks source link

Reset LastHealOnHit once it has been logged #61

Closed F2 closed 2 years ago

F2 commented 2 years ago

Note: I am not able to compile/test my changes. Please thoroughly verify the code before accepting.

I noticed in logs (example) that damage logs would often include the same "healing" attribute, like this:

L 02/28/2022 - 20:53:36: "Martin<11><[U:1:3151199]><Red>" triggered "damage" against "dwo69<5><[U:1:40354909]><Blue>" (damage "14") (weapon "scattergun") (healing "118")
L 02/28/2022 - 20:53:37: "Martin<11><[U:1:3151199]><Red>" triggered "damage" against "acanta<8><[U:1:167002869]><Blue>" (damage "3") (weapon "scattergun") (healing "118")
L 02/28/2022 - 20:53:38: "Martin<11><[U:1:3151199]><Red>" triggered "damage" against "azn<4><[U:1:31135245]><Blue>" (damage "11") (weapon "scattergun") (healing "118")

Looking at the code, I noticed that m_uiLastHealOnHit is being set when "healonhit" is triggered, but it doesn't seem to be reset until you pick up a medkit.

This PR suggests resetting it when it has been logged once.

TheBv commented 2 years ago

59 fixes this and also fixes another array index issue :v

F2 commented 2 years ago

Awesome - good catch regarding the off-by-one error! Then I'll close this.