Skip to content

Commit

Permalink
Fix incorrect modflags for weaponcfg (#7738)
Browse files Browse the repository at this point in the history
* FIX: incorrect modflags for weaponcfg

* FIX: change the mods instead as suggested by Nostra
  • Loading branch information
Paliak authored Jul 21, 2024
1 parent 42a8447 commit 3943c6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
14 changes: 0 additions & 14 deletions src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -922,20 +922,6 @@ function calcs.defence(env, actor)
end
end

-- Spell Suppression
local weaponsCfg = {
flags = bit.bor(env.player.weaponData1 and env.player.weaponData1.type and ModFlag[env.player.weaponData1.type] or 0, env.player.weaponData2 and env.player.weaponData2.type and ModFlag[env.player.weaponData2.type] or 0)
}

-- Add weapon dependent mods as unflagged mods if the correct weapons are equipped
for _, value in ipairs(modDB:Tabulate("BASE", weaponsCfg, "SpellSuppressionChance")) do
if value.mod.flags ~= 0 and bit.band(value.mod.flags and weaponsCfg.flags) == value.mod.flags then
local mod = copyTable(value.mod)
mod.flags = 0
modDB:AddMod(mod)
end
end

local spellSuppressionChance = modDB:Sum("BASE", nil, "SpellSuppressionChance")
local totalSpellSuppressionChance = modDB:Override(nil, "SpellSuppressionChance") or spellSuppressionChance

Expand Down
4 changes: 2 additions & 2 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3333,8 +3333,8 @@ local specialModList = {
["evasion rating is doubled against projectile attacks"] = { mod("ProjectileEvasion", "MORE", 100) },
["evasion rating is doubled against melee attacks"] = { mod("MeleeEvasion", "MORE", 100) },
["+(%d+)%% chance to suppress spell damage for each dagger you're wielding"] = function(num) return {
mod("SpellSuppressionChance", "BASE", num, nil, ModFlag.Dagger ),
mod("SpellSuppressionChance", "BASE", num, nil, ModFlag.Dagger, { type = "Condition", var = "DualWieldingDaggers" })
mod("SpellSuppressionChance", "BASE", num, { type = "Condition", var = "UsingDagger" } ),
mod("SpellSuppressionChance", "BASE", num, { type = "Condition", var = "DualWieldingDaggers" }),
} end,
-- Buffs/debuffs
["phasing"] = { flag("Condition:Phasing") },
Expand Down

0 comments on commit 3943c6d

Please sign in to comment.