ValveSoftware / ValveSoftware/source-sdk-2013
[Bug] func_button OnDamaged output might have the wrong activator
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10k
- Forks
- 3k
- Avg merge
- 8d 11h
- Merged PRs (30d)
- 2
Description
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);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/game/server/buttons.cpp, lines 301-316, and trace how OnDamaged is fired during button damage. Compare the available attacker and activator values, then validate that the output uses the attacker correctly on both first and subsequent damage events.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100