Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log crossbow heals + Fix wrong heal on damage #63

Merged
merged 2 commits into from
May 21, 2022

Conversation

F2
Copy link
Contributor

@F2 F2 commented May 12, 2022

shock mentioned to me that TFTrue doesn't seem to be logging crossbow heals, and it was also reported in issue #57.

It turns out that the player_healed event does log crossbow heals, but we don't handle this event when tftrue_logs_includebuffs is enabled. In that case, we need to use the crossbow_heal event. I tested that it works in various scenarios. Assume that the arrow can do 100 hp healing, and that we are healing a soldier:

  • When the patient is 50 hp, the full 100 hp healing is logged
  • When the patient is 150 hp, the full 100 hp is still logged (even though technically it only heals 50 hp) - I think that's okay, since it's the same behaviour we have for damage
  • When the patient is 200 hp or above, the event is never triggered, and no log is written

Additionally, I stumbled upon a different problem: The player_healonhit event is triggered for the patient when they are healed by an arrow. This is a problem because we store the heal value in m_uiLastHealOnHit, and log it the next time they do damage, as if they were responsible for healing themselves (like when using the Black Box).

However, according to my tests, the crossbow_heal event is fired after the player_healonhit event, so we can simply overwrite that value with 0, preventing it from being logged at the next damage event.

Note that this bug is present regardless of tftrue_logs_includebuffs, so we have to always overwrite it.

@AnAkkk AnAkkk merged commit 69a9d8b into AnAkkk:public May 21, 2022
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.

2 participants