-
Notifications
You must be signed in to change notification settings - Fork 755
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
Add skill_db2.conf and some SkillDB code fix/simplification #3216
Merged
Conversation
This file contains 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
includes support for inheriting the original definition in order to change specific configs
guilherme-gm
commented
Jun 18, 2023
- change case-insensitive check to case-sensitive (strcmpi -> strcmp) Database flags should always have their case taken into account, to this change will detect and alert about flags with the wrong case - simplify the long if/else chain with the flag possibilities into an array of flag/value. This: - makes it easier to read/maintain - avoids typos/mistakes due to replicating the condition many times
- change case-insensitive check to case-sensitive (strcmpi -> strcmp) Database flags should always have their case taken into account, so this change will detect and alert about flags with the wrong case - simplify the long if/else chain with the flag possibilities into an array of flag/value. This: - makes it easier to read/maintain - avoids typos/mistakes due to replicating the condition many times
- change case-insensitive check to case-sensitive (strcmpi -> strcmp) Database flags should always have their case taken into account, so this change will detect and alert about flags with the wrong case - simplify the long if/else chain with the flag possibilities into an array of flag/value. This: - makes it easier to read/maintain - avoids typos/mistakes due to replicating the condition many times
- change case-insensitive check to case-sensitive (strcmpi -> strcmp) Database flags should always have their case taken into account, so this change will detect and alert about flags with the wrong case - simplify the long if/else chain with the flag possibilities into an array of flag/value. This: - makes it easier to read/maintain - avoids typos/mistakes due to replicating the condition many times
- change case-insensitive check to case-sensitive (strcmpi -> strcmp) Database flags should always have their case taken into account, so this change will detect and alert about flags with the wrong case - simplify the long if/else chain with the flag possibilities into an array of flag/value. This: - makes it easier to read/maintain - avoids typos/mistakes due to replicating the condition many times
- change case-insensitive check to case-sensitive (strcmpi -> strcmp) Database flags should always have their case taken into account, so this change will detect and alert about flags with the wrong case - simplify the long if/else chain with the flag possibilities into an array of flag/value. This: - makes it easier to read/maintain - avoids typos/mistakes due to replicating the condition many times
- change case-insensitive check to case-sensitive (strcmpi -> strcmp) Database flags should always have their case taken into account, so this change will detect and alert about flags with the wrong case - simplify the long if/else chain with the flag possibilities into an array of flag/value. This: - makes it easier to read/maintain - avoids typos/mistakes due to replicating the condition many times
- change case-insensitive check to case-sensitive (strcmpi -> strcmp) Database flags should always have their case taken into account, so this change will detect and alert about flags with the wrong case - fixed case of "Sameguild" value in skill_db (should be "SameGuild") - simplify the long if/else chain with the flag possibilities into an array of flag/value. This: - makes it easier to read/maintain - avoids typos/mistakes due to replicating the condition many times
MishimaHaruna
approved these changes
Jul 13, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request Prelude
Changes Proposed
Add skill_db2.conf
This follows the same idea of the existing item_db2.conf / mob_db2.conf, allowing users to create skill_db entries (or override existing ones).
Just like the item/mob dbs, it also includes the
Inherit
field to allow changing only parts of a skill.Code simplification
This is a suggestion to reduce the amount of if/else's in the flags parsing. Instead replacing them with an array of key/values.
I applied it to the functions related to skill_db.conf that had a long list and were only doing that. There is a few other cases with smaller lists which I skipped.
I have used this small diff to validate if the changes did not cause any side effect:
compare_skills.diff.txt
If you apply it to master, build and run, you will get a list of skill flags. Save it. Change to this branch and do the same thing. Both should present the same output.
Case enforcing and fix
During the simplification I also changed the comparison from
strcmpi
tostrcmp
. For our base code, it only triggered issues withSameGuild
flag (which was being used asSameguild
. Custom changes will trigger warnings for people to work and use the correct case.Issues addressed:
None, I think