Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rare crash ccaused by forcing active an inactive group containing a trigger setup. #6898

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

Paliak
Copy link
Contributor

@Paliak Paliak commented Dec 4, 2023

Fixes #6862

Description of the problem being solved:

If a disabled group containing a triggered skill is forced active a crash can occur due to incorrect main socket group selection in CACHE mode. When a wrong socket group is considered main the player.mainSkill will not be in fullEnv.player.activeSkillList

function calcs.buildActiveSkill(env, mode, skill, limitedProcessingFlags)
local fullEnv, _, _, _ = calcs.initEnv(env.build, mode, env.override)
for _, activeSkill in ipairs(fullEnv.player.activeSkillList) do
if cacheSkillUUID(activeSkill, fullEnv) == cacheSkillUUID(skill, env) then
fullEnv.player.mainSkill = activeSkill
fullEnv.player.mainSkill.skillData.limitedProcessing = limitedProcessingFlags and limitedProcessingFlags[cacheSkillUUID(activeSkill, fullEnv)]
calcs.perform(fullEnv)
return
end
end
ConPrintf("[calcs.buildActiveSkill] Failed to process skill: " .. skill.activeEffect.grantedEffect.name)
end

causing the assumption in the manaforged mana cost pre calculation to cause a nil de reference:

if not GlobalCache.cachedData["CACHE"][triggeredUUID] then
calcs.buildActiveSkill(env, "CACHE", actor.mainSkill, {[triggeredUUID] = true})
end
local triggeredManaCost = GlobalCache.cachedData["CACHE"][triggeredUUID].Env.player.output.ManaCost or 0

Steps taken to verify a working solution:

@Paliak Paliak changed the title Fix rare crash causing by forcing active an inactive group containing a trigger setup. Fix rare crash ccaused by forcing active an inactive group containing a trigger setup. Dec 4, 2023
@Paliak Paliak added the crash Causes PoB to crash and is High Priority label Dec 4, 2023
@LocalIdentity LocalIdentity merged commit 360c87b into PathOfBuildingCommunity:dev Dec 4, 2023
@Paliak Paliak deleted the issue-6862 branch January 20, 2024 15:21
Paliak added a commit to Paliak/PathOfBuilding that referenced this pull request Aug 15, 2024
recursive calc.perform calls.

This fix may re-introduce PathOfBuildingCommunity#6898 in some cases.
LocalIdentity pushed a commit that referenced this pull request Aug 17, 2024
… crash (#8192)

* FIX: crash due to limited processing flag not persisting between
recursive calc.perform calls.

This fix may re-introduce #6898 in some cases.

* Revert "FIX: crash due to limited processing flag not persisting between"

This reverts commit 1a19ab0.

* FIX: limited processing flag not persisting through recursions

* FIX: spelling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Causes PoB to crash and is High Priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Will not import build properly from POE
2 participants