Skip to content

Draw the editor team selector for MAX_COUNT teams only - #145

Closed
Giszmo wants to merge 1 commit into
masterfrom
junior/fix-editor-team-selector-max-count
Closed

Draw the editor team selector for MAX_COUNT teams only#145
Giszmo wants to merge 1 commit into
masterfrom
junior/fix-editor-team-selector-max-count

Conversation

@Giszmo

@Giszmo Giszmo commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Cherry-picked bugfix from PR #132 (fix/fullscreen-scaling), split out to shrink #132/#129's diff against master per Leo's request.

Team::MAX_COUNT is 12, but TeamColorSelector::draw still looped to 16. Indexing teams[12..15] is undefined behavior.

Original commit: 3f6416b

Team::MAX_COUNT is 12, but TeamColorSelector::draw still looped to 16.
Indexing teams[12..15] is undefined, so GCC at -O3 drops the loop
bound entirely and the release build reads past the array until it
hits a garbage pointer: Editor, New Map, Ok segfaults. The selector is
6 x 2 cells, which already matches 12.
genixpro
genixpro previously approved these changes Sep 6, 2026

@genixpro genixpro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the focused diff and validated it against current master. The combined set applies cleanly after the five already merged fixes and builds successfully on macOS arm64; this PR has green Ubuntu 22.04, Ubuntu 24.04, and Windows CI.

@genixpro
genixpro dismissed their stale review September 6, 2026 01:14

Superseding provisional compile-only approval while behavior-focused testing is completed.

@genixpro

genixpro commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Current already uses in . The old branch conflicts because the editor was split into the modules. This PR is superseded on current master.

@kylelutze

Copy link
Copy Markdown
Contributor

Already on master — landed with the #132 merge (86d0398); the selector now lives in src/map/edit/Widgets.cpp, hence the conflict here.

@kylelutze kylelutze closed this Sep 6, 2026
@kylelutze
kylelutze deleted the junior/fix-editor-team-selector-max-count branch September 6, 2026 03:11
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.

3 participants