nosoop / SM-TFCustomAttributeStarterPack

A collection of plugins to be used with the TF2 Custom Attribute framework.
MIT License
20 stars 10 forks source link

`medigun drains health` does not run "on hit" attributes #54

Open KenanTheFab opened 2 years ago

KenanTheFab commented 2 years ago

Initial troubleshooting checklist

Describe the bug The "medigun drains health" attribute appears to not count as a "hit", causing "X on Hit" attributes to not work with it.

To Reproduce Apply the attribute to a weapon, latch onto an enemy and something like "heal on hit" will not work.

Expected behavior "medigun drains health" hitting the enemy, not being an invisible leech.

Server environment (please complete the following information):

nosoop commented 2 years ago

Thanks for the report; this one's not quite a bug, rather behavior that wasn't fleshed out since it was for a joke weapon demonstration.

I think this is due to the damage function call not receiving a weapon here:

https://github.com/nosoop/SM-TFCustomAttributeStarterPack/blob/adf5e1d2d54134e53783d7b17a182cb12b6a591e/scripting/joke_medigun_mod_drain_health.sp#L305-L306

But I also vaguely remember the game crashing if the medigun was provided back when it was originally in development, so if that's the case then it won't be that simple of a fix.

KenanTheFab commented 2 years ago

Understandable. Could theoretically be caused by an excess amount of damage calls?

I'm not into tf2 modding or w/e, but if that is the case then theoretically you could make it only detect as damage on the initial attachment, make it check every X seconds for a connection, or simply doing a workaround such as..... adding a bleed effect when attached, then allowing the user to change the bleed frequency.

(On a side-note, would love to be able to change how much Uber is gained after a medigun kill.)