Null Spellbook Cannot be Manually Cast & Update Animations for WalkMerge - #184
Merged
Merged
Conversation
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
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.
Summary
I finally got the hint when #181 was raised - the reason it was so inconsistent to reproduce these bugs (and #126) is that it would only occur when the spell book the player was using was Ancients. So once I had an easy reproducer it was much easier to debug.
The underlying cause of the bugs is because the guantlet staves and eye both (re)use the shadow spell sound effect. Therefore the plugin was mistakenly thinking the player had manually cast shadow spell.
There is two targeted fixes as a consequence.
matchesSpellbookfunction insrc\main\java\com\attacktimer\AttackSpeed.javathis incorrectly means that the plugin falls through and only relies on the sound effect to determine manual casting (incorrect). So an extra explicit guard is added to the function to returnfalseearly if the animation has anullspellbook as we know that this animation cannot possibly be a manual cast.WALKMERGE" animations which the staves can use. These causecurAnimationto be null since we don't have an enum for it and obviously can't match a powered stave fromsrc\main\java\com\attacktimer\PoweredStaves.javabecause we don't know about them. This then causes the plugin to fallthrough to thematchesSpellbookfunction which detects the shadow spell sound effect and then returns a manual cast. Therefore the fix here is simply too register theWALKMERGEanimations inAnimationDataand ensure the staves inPoweredStaveswhich all used to only refer toMAGIC_STANDARD_WAVE_STAFFnow also refer toMAGIC_STANDARD_WAVE_STAFF_WALK.Fixes #181
Fixes #165
Fixes #126
Testing
Gauntlet:
java_Pe7rJUzLJ6.mp4
Eye of Ayak
java_ZTe6s8Bh0L.mp4