Skip to content

Award Collateral only for one bullet from one gun, not a shotgun shell [patch] - #96

Open
matt-edmondson wants to merge 1 commit into
mainfrom
fix/collateral-one-bullet
Open

matt-edmondson wants to merge 1 commit into
mainfrom
fix/collateral-one-bullet

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #94

What changed

Collateral ("Kill two players with one bullet") fired whenever the same attacker got a second kill in one server tick, with any weapon. Two cases were wrongly awarded:

  • one shotgun shell killing two enemies who were standing close together
  • a molotov finishing one enemy on the same tick that a rifle killed another

Fixes:

  • RoundTracker.RegisterKill takes the weapon key as a new optional last parameter. KillsWithThisBullet now counts only same-tick kills with the same weapon.
  • CombatHandlers.CreditKill resolves the weapon before calling RegisterKill (it used to resolve it just after) and passes its key in.
  • Collateral uses GunNotShotgun, matching Point blank and One tap.

Spray transfer's KillsWithThisBullet < 2 check only becomes more precise with this change.

Tests

  • TrackerTests.KillsOnTheSameTickWithDifferentWeaponsAreNotOneBullet: molotov then AK on one tick gives 1, and a second AK kill on that tick gives 2.
  • SkillShotTests.SituationalKills: an AK with KillsWithThisBullet = 2 still earns Collateral, and a Nova does not.
  • Both fail with the tick/weapon comparison and catalog filter reverted, and pass with them. Full suite: 742 passed, 7 skipped.

Note: main doesn't build at the moment, so CI here will fail until those fixes land:

Open PR #79 also edits multi-kill tracking. It may need a small rebase in RoundTracker depending on which PR merges first.


Generated by Claude Code

…l [patch]

Collateral fired on any second kill by the same attacker in one server
tick: one shotgun shell killing two enemies, or a molotov finishing one
enemy as a rifle killed another. RoundTracker now counts kills on a tick
per weapon, and Collateral takes the GunNotShotgun filter that Point
blank and One tap already use.

Fixes #94

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017vfJW5PUccwNk8Pndsg92E

Copy link
Copy Markdown
Contributor Author

CI is red, but the cause is already on main, not this PR. The build stops before any tests run, with the same two KTSU0006 errors as on main (#82):

  • CounterStrikeProgression.Site/MetricsEndpoints.cs(22,38): transitive Microsoft.Extensions.DependencyInjection.Abstractions used directly
  • CounterStrikeProgression.Site/Live/LiveState.cs(28,97): transitive Microsoft.Extensions.Logging.Abstractions used directly

This PR doesn't touch the Site. #85 fixes the build, and with its package change applied locally this branch's full suite passes (742 passed, 7 skipped).

The plugin build also fails on main with CS0618 (ConVar obsolete, #83), which #86 fixes. With CS0618 suppressed, the plugin builds cleanly with this PR's CombatHandlers change. CI should go green on this PR once #85 and #86 merge.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants