Skip to content

Clamp status-bar fills instead of aborting on overflow - #194

Draft
genixpro wants to merge 1 commit into
masterfrom
codex/fix-status-bar-overflow
Draft

Clamp status-bar fills instead of aborting on overflow#194
genixpro wants to merge 1 commit into
masterfrom
codex/fix-status-bar-overflow

Conversation

@genixpro

@genixpro genixpro commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

A status bar whose current value exceeds its capacity aborts the game at Game::drawPointBar's actLength <= maxLength assertion. Clamp the primary fill to the bar's capacity and the secondary fill to the remaining space, preventing both the abort and drawing past the bar. Simulation values are unchanged.

The crash was observed during world-overlay rendering in #139, but this helper already exists on master and is shared by ordinary 2D rendering. This PR is based directly on master and has no torus dependency. The original gameplay event that produced the count is still unconfirmed; the preserved autosave itself renders successfully.

Adds a standalone pixel regression covering both fill sections, all four orientations, negative counts, and zero capacity. CI runs it with OpenGL and software rendering on Linux, and software rendering on Windows.

Validation on macOS / Apple M3:

  • Built the client and point-bar-render-test from this branch.
  • Confirmed the new test reproduces the assertion with the unpatched master renderer.
  • With the fix, SDL_AUDIODRIVER=dummy build/src/point-bar-render-test gl passes.
  • SDL_AUDIODRIVER=dummy SDL_VIDEODRIVER=dummy build/src/point-bar-render-test software passes.

@genixpro
genixpro requested a review from kylelutze September 8, 2026 01:33
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.

1 participant