-
Notifications
You must be signed in to change notification settings - Fork 25
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
[melody] Internal logic improvements / fixes #85
Conversation
Ran through the test cases in melody.cpp and all pass for me. |
Will check this out this evening seems decent enough but I'm only looking on my phone atm. |
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.
I think the changes are worthwhile overall and remove some assumptions in the previous code.
I left some nitpicky comments. The only one I particularly would prefer changed is the extra rewind logic, especially w/out any retry limit catch.
They are shorts only because it felt better checking for -1 vs word max 0xffff |
I'd just vote to be consistent, leaning towards whatever we set in EqStructures.h being the source of truth. I skimmed it and there are a fair number of SpellId entries all labeled as WORD, so I'd lean towards standardizing on WORD and defining that invalid (or none?) spell_id constant. |
I'm fine with either one. For now I went with WORD consistency within Melody, and it shouldn't have had any impact on the rest of the code. Broad consistency changes would maybe make sense in a different PR (e.g. standardizing ActorInfo->CastingSpellId to a |
The previous commit should have cleaned up all the feedback items. |
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.
Look good to me if, as long as Salty is happy with the EqStructures updates.
Yeah as far as the cast() and stop_cast() function changes in EqStructures:
|
Internal Logic Improvements and Cleanup for Melody
Summary
Internal Changes
These changes are aimed as fixing some current bugs and possible future bugs by future-proofing a lot of the logic in here to work even if non-songs are thrown into the mix of events happening.
casting_melody_spell_id
state variable to improve Melody rewind detection by always knowing what the current in-progress Melody song is, rather than relying on thecurrent_index
, which isn't always an accurate depiction of the casting state.stop_current_cast()
to interrupt whatever it is currently casting.handle_stop_cast_callback()
to correctly differentiate between the Melody song being interrupted versus some other spell ID that may trigger a stopcast event.Notes