Skip to content

Commit e42026e

Browse files
committed
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>
1 parent b439e04 commit e42026e

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/Modules/CalcTriggers.lua

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,18 +219,17 @@ 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 canSupport = env.player.mainSkill.triggeredBy.gemData and calcLib.canGrantedEffectSupportActiveSkill(env.player.mainSkill.triggeredBy.gemData.grantedEffect, skill)
228+
local slotMatch = slotMatch(env, skill)
229+
if not source and skill.skillData.triggerTime and canSupport and skill ~= env.player.mainSkill and slotMatch and not isTriggered(skill) then
230+
source = skill
232231
end
233-
if skill.skillData.triggeredWhileChannelling and (match1 or match2) then
232+
if skill.skillData.triggeredWhileChannelling and slotMatch then
234233
t_insert(triggeredSkills, packageSkillDataForSimulation(skill, env))
235234
end
236235
end

0 commit comments

Comments
 (0)