Thread: Cirk's Fastcast
View Single Post
04-05-06, 05:37 PM   #42
Cirk
A Cobalt Mageweaver
 
Cirk's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 226
Originally Posted by Maia
Well, so this is a either/or solution. Cast fast but not able to cancel or cast slow and be able to cancel? Hmm. Doesn't sound perfect.
No, not ideal I'm afraid. Even if I add functionality to Fastcast to support this (which I probably will soon), you'd still have the problem of dealing with older versions of Fastcast, and this approach would be your best one for those.


Originally Posted by Maia
I might have a different solution, not knowing if it will work though. Right now FastcastStopCasting() will not always cancel, but only if GetTime() > _actionEndTime. So my idea is something like the following to force a cancellation (this gets only called if I want to cancel an overheal):

...

well, this doesn't work at the moment, as _actionEndTime is local to your addon. But you could either add a flag to FastcastStopCasting to force a cancellation (e.g. FastcastStopCasting("forced")), or add a global flag, e.g. FastCast_CancelCurrentSpell = true which you could check for in FastcastStopCasting().

Think that's a possible solution?
Well FastcastStopCasting("force") would be just the same as calling SpellStopCasting() directly (which Fastcast never blocks from happening) but at any rate the issue isn't what you are doing inside the macro itself (or inside functions the macro calls), but that Fastcast won't run the macro at all! Basically since this macro started a spell-cast, Fastcast is protecting the spell the macro cast from being interrupted early by not running that same macro again until the minimum time (i.e., _actionEndTime) has been reached or the spell stopped casting already (see line 568 of Fastcast.lua). A simple way to check that is to just add some debug in your functions and see that the debug isn't being shown. That's why I suggested the alternative method of not calling CastSpellByName, since then Fastcast won't realize your macro started casting a spell and hence won't block it from running again.

I guess ideally I shouldn't be enforcing that check for macros anymore now that I've added the FastcastStopCasting function, but if I take it out again (i.e., macros will always run) then any existing macros using SpellStopCasting will break until they are modified to use FastcastStopCasting.

I'd suggest going with something like the solution I suggested for now, and when I update Fastcast, you'll be able to check for the new feature (somehow, I'll keep that requirement in mind) and do an either-or approach in your addon.

Cheers
-- Cirk
__________________
Cirk's Addons
  Reply With Quote