DennisWG / Roid-Macros

Vanilla macros on steroids!
MIT License
58 stars 16 forks source link

Focus conditional issue #17

Closed wardz closed 6 years ago

wardz commented 7 years ago

/cast [@focus] spellName

Focus conditional doesn't work properly when the focus unit no longer exists. Instead of not doing anything, it will deselect your current target and call TargetLastTarget() every time you press the macro. (Spell cast is also triggered, but im not sure if thats an issue caused by CastModifier or not) This happens with both ClassicFocus and FocusFrame compatibility.

How to reproduce:

  1. Set any unit as focus.
  2. Walk away until you get "Unknown Unit" error when pressing the macro posted above.
  3. Target a new unit with a different name and press the macro 2 times.

Just a note, changing return true; inside MMC.TryTargetFocus() to this: return UnitExists("target") and UnitName("target") == name seems to fix it. But it still bugs out when using multiple conditionals.

DennisWG commented 7 years ago

I'm not sure if there's a proper fix for this because of the way focus targeting works in vanilla. But I'll look into this when I find some time to do so.

DennisWG commented 6 years ago

I think I was able to fix this!