Fix spellprac detection issues in th08 #7
Merged
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.
Apart from fixing the issue I described in #6, now flag 0x4000 is used instead of 128 to check whether spell practice is active. The difference from 128 is that it's always set when in spellprac mode, even when the spell is not active yet (and as far as I can tell, flag 0x4000 is how the game determines whether to load spell practice ECL files in the first place - in fact, that's how I found it). Apart from that, now a spellprac-specific spell ID variable is used when in spell practice - this one is set before the spell even begins. I believe the ECL scripts use this value to determine which spell to even start (not tested but likely).
The result of these changes is that both correct spell ID and spell practice being active are always detected as soon as spell practice starts.