diff --git a/src/Modules/CalcMirages.lua b/src/Modules/CalcMirages.lua index 1cb076837e..6e5cc51951 100644 --- a/src/Modules/CalcMirages.lua +++ b/src/Modules/CalcMirages.lua @@ -37,7 +37,8 @@ local function calculateMirage(env, config) if mirageSkill then local newSkill, newEnv = calcs.copyActiveSkill(env, env.mode, mirageSkill) newSkill.skillCfg.skillCond["usedByMirage"] = true - newSkill.skillData.limitedProcessing = true + newEnv.limitedSkills = newEnv.limitedSkills or {} + newEnv.limitedSkills[cacheSkillUUID(newSkill, newEnv)] = true newSkill.skillData.mirageUses = env.player.mainSkill.skillData.storedUses newSkill.skillTypes[SkillType.OtherThingUsesSkill] = true diff --git a/src/Modules/CalcPerform.lua b/src/Modules/CalcPerform.lua index bc24862dbc..8fba4c7c53 100644 --- a/src/Modules/CalcPerform.lua +++ b/src/Modules/CalcPerform.lua @@ -1805,7 +1805,7 @@ function calcs.perform(env, skipEHP) -- computed cached versions to satisfy the order of operations. -- See: https://github.com/PathOfBuildingCommunity/PathOfBuilding/pull/5164 for _, activeSkill in ipairs(env.player.activeSkillList) do - if not activeSkill.skillFlags.disable and not activeSkill.skillData.limitedProcessing then + if not activeSkill.skillFlags.disable and not (env.limitedSkills and env.limitedSkills[cacheSkillUUID(activeSkill, env)]) then if (activeSkill.activeEffect.grantedEffect.name == "Blight" or activeSkill.activeEffect.grantedEffect.name == "Blight of Contagion" or activeSkill.activeEffect.grantedEffect.name == "Blight of Atrophy") and activeSkill.skillPart == 2 then local rate, duration = getCachedOutputValue(env, activeSkill, "Speed", "Duration") local baseMaxStages = activeSkill.skillModList:Sum("BASE", env.player.mainSkill.skillCfg, "BlightBaseMaxStages") diff --git a/src/Modules/CalcTriggers.lua b/src/Modules/CalcTriggers.lua index 508d1010ce..4bcfd86730 100644 --- a/src/Modules/CalcTriggers.lua +++ b/src/Modules/CalcTriggers.lua @@ -1306,7 +1306,7 @@ local configTable = { end if env.player.mainSkill.activeEffect.grantedEffect.name == "Snipe" then - if env.player.mainSkill.skillData.limitedProcessing then + if (env.limitedSkills and env.limitedSkills[cacheSkillUUID(env.player.mainSkill, env)]) then -- Snipe is being used by some other skill. In this case snipe does not get more damage mods snipeStages = 0 else @@ -1420,7 +1420,7 @@ local function getUniqueItemTriggerName(skill) end function calcs.triggers(env, actor) - if actor and not actor.mainSkill.skillFlags.disable and not actor.mainSkill.skillData.limitedProcessing then + if actor and not actor.mainSkill.skillFlags.disable and not (env.limitedSkills and env.limitedSkills[cacheSkillUUID(actor.mainSkill, env)]) then local skillName = actor.mainSkill.activeEffect.grantedEffect.name local triggerName = actor.mainSkill.triggeredBy and actor.mainSkill.triggeredBy.grantedEffect.name local uniqueName = isTriggered(actor.mainSkill) and getUniqueItemTriggerName(actor.mainSkill) diff --git a/src/Modules/Calcs.lua b/src/Modules/Calcs.lua index fb3bf380f5..68f46b9189 100644 --- a/src/Modules/Calcs.lua +++ b/src/Modules/Calcs.lua @@ -403,12 +403,22 @@ end -- Process active skill function calcs.buildActiveSkill(env, mode, skill, targetUUID, limitedProcessingFlags) local fullEnv, _, _, _ = calcs.initEnv(env.build, mode, env.override) + + -- env.limitedSkills contains a map of uuids that should be limited in calculation + -- this is in order to prevent infinite recursion loops + fullEnv.limitedSkills = fullEnv.limitedSkills or {} + for uuid, _ in pairs(env.limitedSkills or {}) do + fullEnv.limitedSkills[uuid] = true + end + for uuid, _ in pairs(limitedProcessingFlags or {}) do + fullEnv.limitedSkills[uuid] = true + end + targetUUID = targetUUID or cacheSkillUUID(skill, env) for _, activeSkill in ipairs(fullEnv.player.activeSkillList) do local activeSkillUUID = cacheSkillUUID(activeSkill, fullEnv) if activeSkillUUID == targetUUID then fullEnv.player.mainSkill = activeSkill - fullEnv.player.mainSkill.skillData.limitedProcessing = limitedProcessingFlags and limitedProcessingFlags[activeSkillUUID] calcs.perform(fullEnv, true) return end