source-sdk-2013
source-sdk-2013 copied to clipboard
[Bug] func_button OnDamaged output might have the wrong activator
The issue is pretty apparent here since the OnDamaged output is fired with m_hActivator instead of info.GetAttacker():
https://github.com/ValveSoftware/source-sdk-2013/blob/238a15a79dd2c3c151e98eea8b39e5f161a93703/src/game/server/buttons.cpp#L301-L316
This means that the first time a button is damaged, it will not fire correctly, and subsequent damages can fire with the wrong activator.
Something like this might be the correct thing to do here:
- m_OnDamaged.FireOutput(m_hActivator, this);
+ m_OnDamaged.FireOutput(info.GetAttacker(), this);