From 401377b9ae839ab59e5cc4e7492e60e003dc23dd Mon Sep 17 00:00:00 2001 From: Maczuga Date: Thu, 27 May 2021 14:16:46 +0200 Subject: [PATCH] Fix Insufficient Resources condition. --- WeakAuras/Prototypes.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 39662c5c4b..340a3e5351 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -3557,7 +3557,10 @@ Private.event_prototypes = { test = "true", conditionType = "bool", conditionTest = function(state, needle) - return state and state.show and (select(2, IsUsableSpell(state.spellname)) == (needle == 1)); + local _, _, _, powerCost, _, powerIndex = GetSpellInfo(state.spellname) + local power = UnitPower("player" , powerIndex); + + return state and state.show and ((power < powerCost) == (needle == 1)); end, conditionEvents = { "SPELL_UPDATE_USABLE",