You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When any slider value is out of bounds, an early return is initialized, causing the slider position value not be set at all.
The slider position value is then 0, even if the minimum is higher than 0.
Instead the slider UI is bound instead. If the slider is touched by the user, it will set its value between the minimum and maximum - easily allowing to reset the value if needed.
I left a comment to ensure in the future coders understand why there is no check in place. Can remove if desired.
This PR fixes a bug where a slider's stored position was silently left at 0 whenever a value loaded from option.ini fell outside the slider's [minVal, maxVal] range (e.g., a user-customised value that pre-dates a min/max change). The fix removes the early break and instead clamps only the derived window-coordinate used for thumb rendering, so custom settings are preserved while the visual thumb stays within the track. The change is correctly applied to all four slider files (horizontal + vertical, Generals + Zero Hour).
Confidence Score: 5/5
Safe to merge — the fix is minimal, well-reasoned, and correctly handles out-of-bounds visual positioning via clamp.
No P0 or P1 findings. The clamp call uses the same argument order (min, value, max) as every other call-site in the codebase. The GSM_SLIDER_TRACK handler already clamps s->position when the user moves the slider, so storing an out-of-bounds value intentionally is consistent with the design. All four symmetric files are updated identically.
Removes early-return bounds check in GSM_SET_SLIDER; adds clamp on the translated window coordinate to keep the thumb within the track while allowing s->position to store out-of-bounds values from option.ini.
Same fix as the horizontal slider counterpart — drops out-of-bounds break in GSM_SET_SLIDER and clamps only the inverted window-coord translation, keeping visual thumb in range.
xezon
added
Bug
Something is not working right, typically is user facing
Minor
Severity: Minor < Major < Critical < Blocker
Gen
Relates to Generals
ZH
Relates to Zero Hour
and removed
Fix
Is fixing something, but is not user facing
labels
Apr 21, 2026
xezon
changed the title
fix: Remove slider bounds check to prevent unwanted reset of custom settings
bugfix(gui): Remove slider bounds checks to prevent unwanted reset of custom settings
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BugSomething is not working right, typically is user facingGenRelates to GeneralsGUIFor graphical user interfaceMinorSeverity: Minor < Major < Critical < BlockerZHRelates to Zero Hour
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When any slider value is out of bounds, an early return is initialized, causing the slider position value not be set at all.
The slider position value is then 0, even if the minimum is higher than 0.
Instead the slider UI is bound instead. If the slider is touched by the user, it will set its value between the minimum and maximum - easily allowing to reset the value if needed.
I left a comment to ensure in the future coders understand why there is no check in place. Can remove if desired.