ValveSoftware / ValveSoftware/source-sdk-2013

[Bug] func_button OnDamaged output might have the wrong activator

Open Beginner friendly
#843 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.