Skip to content

fix(exp): experience bar overflows#316

Open
olisikh wants to merge 2 commits intosven-n:mainfrom
olisikh:fix/exp_bar_overflow
Open

fix(exp): experience bar overflows#316
olisikh wants to merge 2 commits intosven-n:mainfrom
olisikh:fix/exp_bar_overflow

Conversation

@olisikh
Copy link
Copy Markdown
Contributor

@olisikh olisikh commented Apr 5, 2026

Fixes bar overflows when sometimes it shows numbers > 9, both for master and normal experience progression.
This PR is manually tested by myself, works pretty well so far.

* fix(exp): address experience bar overflows

* fix(exp): remove redundant else branch in master exp bar rendering

Agent-Logs-Url: https://github.com/olisikh/ClosedMuMain/sessions/48614910-9c0b-4ba3-b996-df0a139a9f13

Co-authored-by: olisikh <1538201+olisikh@users.noreply.github.com>

* code review remarks addressed

* Fix EXP bar max-progress rendering and clamp with std::clamp

* Fix remaining EXP review findings

* Fix master EXP lower bound calc for MSVC

* Fix saturating subtraction edge case

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: olisikh <1538201+olisikh@users.noreply.github.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses issues where experience bar values could overflow or display incorrectly by implementing strict bounds checking and safe arithmetic operations. It introduces centralized logic for calculating experience boundaries and clamping values, ensuring that both normal and master experience progression remain within valid ranges during updates and rendering.

Highlights

  • Experience Clamping: Implemented robust clamping logic for experience values to prevent overflows beyond the defined level boundaries.
  • Saturating Arithmetic: Added helper functions for saturating arithmetic to safely handle experience calculations without risking integer overflows.
  • UI Rendering Fixes: Updated the experience bar rendering logic to use the new clamping and segment building functions, ensuring accurate visual representation.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@olisikh olisikh changed the title fix(exp): address experience bar overflows fix(exp): experience bar overflows Apr 5, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors experience rendering and calculation logic to improve robustness and prevent overflows. It introduces a buildExpSegment helper in NewUIMainFrameWindow.cpp and several saturating arithmetic and bounding helpers in WSclient.cpp. Feedback suggests using std::numeric_limits for better C++ style and simplifying the saturating multiplication logic.

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