Skip to content

Fix punt and kickoff return yard narration - #50

Merged
CalebRose merged 1 commit into
CalebRose:masterfrom
tpitzel:agent/fix-return-yard-export-current-master
Jul 25, 2026
Merged

Fix punt and kickoff return yard narration#50
CalebRose merged 1 commit into
CalebRose:masterfrom
tpitzel:agent/fix-return-yard-export-current-master

Conversation

@tpitzel

@tpitzel tpitzel commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Use play.ResultYards directly when narrating kickoff returns.
  • Use play.ResultYards directly when narrating punt returns.
  • Apply the same direct-return contract to both normal result output and stream output.
  • Remove the obsolete field-position formulas that attempted to reconstruct return distance.

Why

The engine and stored play-by-play data already use ResultYards as the actual return distance. The API was interpreting that value a second time:

  • Kickoff results displayed 100 - ResultYards.
  • Punt results displayed line of scrimmage plus kick distance minus ResultYards.
  • Stream output performed similar coordinate conversions.

That caused the human-readable result to disagree with the exported numeric Yards Gained and the ensuing field position. In game 9937, all 13 narrated punt/kickoff returns matched the obsolete formulas instead of the direct return value.

Impact

Play-by-play pages and CSV exports will display the same punt and kickoff return distance already stored in ResultYards. Because export narration is generated on request, historical games using the direct-return contract will also display correctly after this API version is deployed.

This is intentionally a one-file API formatter fix. It does not change the engine, database schema, Interface, or unrelated play-by-play fields.

Checks

  • Based directly on current upstream master commit 844d1c7.
  • go test ./...
  • git diff --check upstream/master...HEAD
  • One commit changing only managers/StatsManager.go.
  • GitHub Actions completed the Go build successfully. The subsequent Azure registry login failed because deployment secrets are blank for the fork pull-request run, not because of a source or build failure.

@CalebRose
CalebRose merged commit 936c38a into CalebRose:master Jul 25, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants