Skip to content

Commit b8e9992

Browse files
LocalIdentityLocalIdentity
andauthored
Fix some enemy modifiers not working (#9173)
enemyDB was not populated with `EnemyModifier` mods until doActorMisc was run on line 3078 so all the calls to enemyDB before that could be potentially missing mods We now pull the call out of doMisc and run it early in the pass so all the subsequent calls to enemyDB will include them Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent b8adac5 commit b8e9992

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/Modules/CalcPerform.lua

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -565,18 +565,20 @@ local function determineCursePriority(curseName, activeSkill)
565565
return basePriority + socketPriority + slotPriority + sourcePriority
566566
end
567567

568+
local function applyEnemyModifiers(actor)
569+
-- Process enemy modifiers
570+
for _, value in ipairs(actor.modDB:Tabulate(nil, nil, "EnemyModifier")) do
571+
actor.enemy.modDB:AddMod(modLib.setSource(value.value.mod, value.value.mod.source or value.mod.source))
572+
end
573+
end
574+
568575
-- Process enemy modifiers and other buffs
569576
local function doActorMisc(env, actor)
570577
local modDB = actor.modDB
571578
local enemyDB = actor.enemy.modDB
572579
local output = actor.output
573580
local condList = modDB.conditions
574581

575-
-- Process enemy modifiers
576-
for _, value in ipairs(modDB:Tabulate(nil, nil, "EnemyModifier")) do
577-
enemyDB:AddMod(modLib.setSource(value.value.mod, value.value.mod.source or value.mod.source))
578-
end
579-
580582
-- Add misc buffs/debuffs
581583
if env.mode_combat then
582584
if env.player.mainSkill.baseSkillModList:Flag(nil, "Cruelty") then
@@ -1168,6 +1170,12 @@ function calcs.perform(env, skipEHP)
11681170
output.WarcryPower = modDB:Override(nil, "WarcryPower") or modDB:Sum("BASE", nil, "WarcryPower") or 0
11691171
modDB.multipliers["WarcryPower"] = output.WarcryPower
11701172

1173+
applyEnemyModifiers(env.player)
1174+
if env.minion then
1175+
applyEnemyModifiers(env.minion)
1176+
end
1177+
applyEnemyModifiers(env.enemy)
1178+
11711179
for _, activeSkill in ipairs(env.player.activeSkillList) do
11721180
if activeSkill.skillTypes[SkillType.Brand] then
11731181
local attachLimit = activeSkill.skillModList:Sum("BASE", activeSkill.skillCfg, "BrandsAttachedLimit")

0 commit comments

Comments
 (0)