HarbourMasters / Shipwright

3.29k stars 492 forks source link

Fix options and sliders to prevent index out of range issues. #4421

Closed Malkierian closed 1 month ago

Malkierian commented 1 month ago

Turns out the issues with Triforce Hunt sliders were everywhere. This was discovered by the process outlined in #4414 by A-Green-Spoon with the rewards sliders with Greg as reward being changed to one of the other two. This is an alternative fix to that that can be applied to all sliders in the future, where it runs off of GetSelectedOptionIndex() instead of CVarGets for better performance, as well as fixing the overflow correction that was already there.

I have no idea why the Render functions were const, but I removed those specifiers so that those functions could reference object instance functions and variables, like GetSelectedOptionIndex() and SetFromCVar()

Build Artifacts