Skip to content

Commit 9d99499

Browse files
authored
Fix CwC crash when using skills form items and multiple link groups (#9682)
* FIX: CwC crash when using skills form items and multiple link groups Due to the triggerTime being on the support part that supports the triggering channeled skill the CwC handler relies on the triggerTime property stored in the skillData table of the trigger source skill. This is problematic since the slotMatch logic for triggered skills coming from items checks all socket groups in a given item regardless of whether they are crosslinked with cast while channeling or not. This pr reworks the trigger source finding logic for cast while channeling to both speed it up and fix this issue. Signed-off-by: Paliak <91493239+Paliak@users.noreply.github.com> * FIX: only calc canSupport if not source Signed-off-by: Paliak <91493239+Paliak@users.noreply.github.com> * FIX: crash caused by phantasm support being copied with mirage skills that take over mainSKill --------- Signed-off-by: Paliak <91493239+Paliak@users.noreply.github.com>
1 parent 3d1d93c commit 9d99499

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/Modules/CalcTriggers.lua

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,18 +219,19 @@ end
219219
local function CWCHandler(env)
220220
if not env.player.mainSkill.skillFlags.minion and not env.player.mainSkill.skillFlags.disable then
221221
local triggeredSkills = {}
222-
local trigRate = 0
223222
local source = nil
224223
local triggerName = "Cast While Channeling"
225224
local output = env.player.output
226225
local breakdown = env.player.breakdown
227226
for _, skill in ipairs(env.player.activeSkillList) do
228-
local match1 = env.player.mainSkill.activeEffect.grantedEffect.fromItem and skill.socketGroup and skill.socketGroup.slot == env.player.mainSkill.socketGroup.slot
229-
local match2 = (not env.player.mainSkill.activeEffect.grantedEffect.fromItem) and skill.socketGroup == env.player.mainSkill.socketGroup
230-
if env.player.mainSkill.triggeredBy.gemData and calcLib.canGrantedEffectSupportActiveSkill(env.player.mainSkill.triggeredBy.gemData.grantedEffect, skill) and skill ~= env.player.mainSkill and (match1 or match2) and not isTriggered(skill) then
231-
source, trigRate = findTriggerSkill(env, skill, source, trigRate)
227+
local slotMatch = slotMatch(env, skill)
228+
if not source then
229+
local canSupport = env.player.mainSkill.triggeredBy.gemData and calcLib.canGrantedEffectSupportActiveSkill(env.player.mainSkill.triggeredBy.gemData.grantedEffect, skill)
230+
if skill.skillData.triggerTime and canSupport and skill ~= env.player.mainSkill and slotMatch and not isTriggered(skill) then
231+
source = skill
232+
end
232233
end
233-
if skill.skillData.triggeredWhileChannelling and (match1 or match2) then
234+
if skill.skillData.triggeredWhileChannelling and slotMatch then
234235
t_insert(triggeredSkills, packageSkillDataForSimulation(skill, env))
235236
end
236237
end

0 commit comments

Comments
 (0)