Thread: Cirk's Fastcast
View Single Post
04-09-06, 10:18 AM   #45
Maia
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 15
Originally Posted by Cirk
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.
Hmm, so FastCast saves the function name and will prevent calling that function again until it thinks it may be called again? Because the function that is available via a keybinding in my addon does something like the following (pseudo-code):
Code:
function SpecialHeal()
   if _isCasting then
      if UnitIsOverhealed() then
         SpellStopCasting()
         _isCasting = false
      end
      return
   end
   local damage = UnitHealthMax("target") - UnitHealth("target")
   local spell = GetBestRank(damage)
   CastSpellByName(spell)
   _isCasting = true
end

function UnitIsOverhealed()
   -- guess you can imagine what happenes here, but lets do something simple:
   if UnitHealthMax("target") == UnitHealth("target") then
      return true
   else
      return false
   end
end
Did I understand it correctly that FastCast will magically hook that function on the fly and not execute it as long as it's preventing a spell from being cancelled?

Thanks again...

Last edited by Maia : 04-09-06 at 10:26 AM.
  Reply With Quote