Skip to content

Fix gametype filter UI bugs and code quality issues#10

Open
bretonium wants to merge 1 commit intoPointer31:infclass-based-19.5-2from
bretonium:fix/gametype-filter-review
Open

Fix gametype filter UI bugs and code quality issues#10
bretonium wants to merge 1 commit intoPointer31:infclass-based-19.5-2from
bretonium:fix/gametype-filter-review

Conversation

@bretonium
Copy link

  • Fix HSplitBottom → HSplitTop so gametype filter header is actually visible
  • Simplify token parsing: drop pGametypeNext, use local pToken per iteration
  • Replace magic number 9 with MAX_GAMETYPE_FILTERS constant
  • Size s_Buttons[MAX_GAMETYPE_FILTERS + 1] (was [11] with unexplained +1)
  • Move "No filter" button to s_Buttons[MAX_GAMETYPE_FILTERS] (index 9)
  • Rename isSelected → IsSelected to match project convention
  • Switch Config()->m_Cl* to g_Config.m_Cl* for consistency with surrounding code
  • Add bounds check via minimum() in str_copy for token length
  • Document cl_position_community_filter values 0/1/2 in config description
  • Remove attribution comment

Checklist

  • Tested the change ingame
  • Provided screenshots if it is a visual change
  • Tested in combination with possibly related configuration options
  • Written a unit test (especially base/) or added coverage to integration test
  • Considered possible null pointers and out of bounds array indexing
  • Changed no physics that affect existing maps
  • Tested the change with ASan+UBSan or valgrind's memcheck (optional)

- Fix HSplitBottom → HSplitTop so gametype filter header is actually visible
- Simplify token parsing: drop pGametypeNext, use local pToken per iteration
- Replace magic number 9 with MAX_GAMETYPE_FILTERS constant
- Size s_Buttons[MAX_GAMETYPE_FILTERS + 1] (was [11] with unexplained +1)
- Move "No filter" button to s_Buttons[MAX_GAMETYPE_FILTERS] (index 9)
- Rename isSelected → IsSelected to match project convention
- Switch Config()->m_Cl* to g_Config.m_Cl* for consistency with surrounding code
- Add bounds check via minimum() in str_copy for token length
- Document cl_position_community_filter values 0/1/2 in config description
- Remove attribution comment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bretonium bretonium force-pushed the fix/gametype-filter-review branch from f072e00 to ce4d44d Compare March 4, 2026 17:09
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