CuteOne / BadRotations

GNU General Public License v3.0
170 stars 214 forks source link

call to br.player.power.runes causes stack overflow - Blood DK #1345

Closed BrewingCoder closed 8 months ago

BrewingCoder commented 9 months ago

steps to reproduce:

local runes = br.player.power.runes.amount()

results:

2175x [string "BadRotations/System/API/Power.lua"]:116: C stack overflow

...

[string "BrewBloodKnight.lua"]:189: in function run' [string "BadRotations/System/Loader/cCharacter.lua"]:222: in functionstartRotation' [string "BadRotations/System/Loader/cBuilder.lua"]:436: in function `update'

Locals: tbl =

{ frac = defined BadRotations/System/API/Power.lua:34 deficit = defined BadRotations/System/API/Power.lua:30 max = defined BadRotations/System/API/Power.lua:53 regen = defined BadRotations/System/API/Power.lua:65 percent = defined BadRotations/System/API/Power.lua:57 ttm = defined BadRotations/System/API/Power.lua:69 } key = "amount" (temporary) = nil (temporary) = defined BadRotations/System/API/Power.lua:114 (temporary) =
{ frac = defined BadRotations/System/API/Power.lua:34 deficit = defined BadRotations/System/API/Power.lua:30 max = defined BadRotations/System/API/Power.lua:53 regen = defined BadRotations/System/API/Power.lua:65 percent = defined BadRotations/System/API/Power.lua:57 ttm = defined BadRotations/System/API/Power.lua:69 } (temporary) = "amount" (*temporary) = "C stack overflow"

BrewingCoder commented 9 months ago

Current workaround:

local runes = UnitPower("player",Enum.PowerType.Runes) local runicPower = UnitPower("player",Enum.PowerType.RunicPower)

CuteOne commented 8 months ago

As I mentioned in Discord, the Power API changed, to get amount for power types just use the power type as a function:

local runicPower = br.player.power.runicPower() local runes = br.player.power.runes()