Fix AutoSpell not replacing selected skill in some cases #3282
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
SC_AUTOSPELL val1 should be the AutoSpell skill level, not the selected skill learned level. This was broken during the refactor (#3237) and is now fixed.
Thanks to @violent01 for spotting the issue in the rebalance PR ( #3230 (comment) )
Since it was now using the learned level of the selected skill, this lead to cases where switching the selected skill wouldn't work. For example, if you had Fire Bolt Lv10 and Earth Spikes Lv5 (their max), Lv5 would always be less than Lv10, and would be blocked by the default block of every SC (in status.c, which prevents a lower val1 from overriding a higher val1).
Issues addressed:
None