Auto attack feature interrupts macro spell casts
ShadowCat117 opened this issue ยท 4 comments
ArmSwingEvent
and UseItemEvent
are not triggered by our own spell macros or ones by other mods such as Wynncraft-Spell-Caster
@Xaryphon Do you think you would be able to look into this?
I see three options for this
- Just add a notice in the feature's config page that you should stop holding attack when quick casting, but people probably won't read it.
- Test if
QuickCastFeature.SPELL_PACKET_QUEUE
is empty. This is the most accurate one but obviously won't work with other mods and not sure if you want such cross feature accesses.SPELL_PACKET_QUEUE
is static so apublic static bool isPacketQueueEmpty()
should suffice. - Hook the respective packets, but this would share the same edge case as manual casting when starting a second spell cast before we get the completion for the first one leading to
preventWrongCast
being reset. These would probably have to be new events for both packets.
Not sure which one would be the best, maybe a combination or some other way?
Not a fan of option 1, as you say people probably won't read it. Option 2 could work, it's one of those times when I think it's warranted for a feature to access information about another, unless some of the logic was moved somewhere more accessible like SpellModel
but not really sure it belongs there either. Option 3 could also work.
I'll mention @kristofbolyai to see if they have any different thoughts to mine or another solution.
I did also have a look at the spell caster mod and they have their own hold to attack feature so perhaps users of that mod could simply be recommended to disable the wynntils version