-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: limit_mode for none must be empty #1089
Conversation
I really think this isn't right. We should keep it as 0 - the official key we get from KoL servers - and add a getASHName instance function to LimitMode that returns "" when the enum is LimitMode.NONE, and use that in limit_mode(). |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1089 +/- ##
============================================
- Coverage 29.65% 29.65% -0.01%
Complexity 14350 14350
============================================
Files 1036 1036
Lines 160939 160943 +4
Branches 35122 35123 +1
============================================
- Hits 47729 47728 -1
- Misses 104649 104652 +3
- Partials 8561 8563 +2
Continue to review full report at Codecov.
|
"0" isn't the key, though. The key is an integer -- 0. I'd rather change the API code to something like
and add UNKNOWN for an unknown string. |
This works with me |
if (lmo instanceof Integer && lmo.equals(0)) { | ||
KoLCharacter.setLimitMode(LimitMode.NONE); | ||
} else { | ||
KoLCharacter.setLimitMode(lmo.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably instanceof string check here and error out otherwise. And add a coverage test to this slice of the code too, why not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aye, will merge here and follow-up.
#1084 broke ChIT, which assumes the result of
limit_mode
for no limit mode must be "", but it is instead "0".