Skip to content

Commit

Permalink
FIX: manaforge nil deref due to wrong calc mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Paliak committed Jan 26, 2024
1 parent 58cd11e commit 9088c4c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Modules/CalcTriggers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -528,11 +528,12 @@ local function defaultTriggerHandler(env, config)

-- Handling for mana spending rate for Manaforged Arrows Support
if actor.mainSkill.skillData.triggeredByManaforged and trigRate > 0 then
local mode = env.mode == "CALCS" and "CALCS" or "MAIN"
local triggeredUUID = cacheSkillUUID(actor.mainSkill, env)
if not GlobalCache.cachedData["CACHE"][triggeredUUID] then
calcs.buildActiveSkill(env, "CACHE", actor.mainSkill, {[triggeredUUID] = true})
if not GlobalCache.cachedData[mode][triggeredUUID] then
calcs.buildActiveSkill(env, mode, actor.mainSkill, {[triggeredUUID] = true})
end
local triggeredManaCost = GlobalCache.cachedData["CACHE"][triggeredUUID].Env.player.output.ManaCost or 0
local triggeredManaCost = GlobalCache.cachedData[mode][triggeredUUID].Env.player.output.ManaCost or 0
if triggeredManaCost > 0 then
local manaSpentThreshold = triggeredManaCost * actor.mainSkill.skillData.ManaForgedArrowsPercentThreshold
local sourceManaCost = GlobalCache.cachedData["CACHE"][uuid].Env.player.output.ManaCost or 0
Expand Down

0 comments on commit 9088c4c

Please sign in to comment.