From d670a347172f254cbf7029923dee7c94e766802f Mon Sep 17 00:00:00 2001 From: Horatio Date: Sun, 29 Oct 2023 17:39:21 -0300 Subject: [PATCH 1/2] Fixed item swap, with changes to auto attack --- sim/core/item_swaps.go | 16 +++++++++++----- sim/shaman/fire_elemental_totem.go | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/sim/core/item_swaps.go b/sim/core/item_swaps.go index 1c247f2c04..f7fca3be32 100644 --- a/sim/core/item_swaps.go +++ b/sim/core/item_swaps.go @@ -197,13 +197,19 @@ func (swap *ItemSwap) swapWeapon(slot proto.ItemSlot) { switch slot { case proto.ItemSlot_ItemSlotMainHand: - character.AutoAttacks.SetMH(character.WeaponFromMainHand(swap.mhCritMultiplier)) + if character.AutoAttacks.AutoSwingMelee() { + character.AutoAttacks.SetMH(character.WeaponFromMainHand(swap.mhCritMultiplier)) + } case proto.ItemSlot_ItemSlotOffHand: - character.AutoAttacks.SetOH(character.WeaponFromOffHand(swap.ohCritMultiplier)) - //Special case for when the OHAuto Spell was set up with a non weapon and does not have a crit multiplier. - character.PseudoStats.CanBlock = character.OffHand().WeaponType == proto.WeaponType_WeaponTypeShield + if character.AutoAttacks.AutoSwingMelee() { + character.AutoAttacks.SetOH(character.WeaponFromOffHand(swap.ohCritMultiplier)) + //Special case for when the OHAuto Spell was set up with a non weapon and does not have a crit multiplier. + character.PseudoStats.CanBlock = character.OffHand().WeaponType == proto.WeaponType_WeaponTypeShield + } case proto.ItemSlot_ItemSlotRanged: - character.AutoAttacks.SetRanged(character.WeaponFromRanged(swap.rangedCritMultiplier)) + if character.AutoAttacks.AutoSwingRanged() { + character.AutoAttacks.SetRanged(character.WeaponFromRanged(swap.rangedCritMultiplier)) + } } character.AutoAttacks.isDualWielding = character.MainHand().SwingSpeed != 0 && character.OffHand().SwingSpeed != 0 diff --git a/sim/shaman/fire_elemental_totem.go b/sim/shaman/fire_elemental_totem.go index 272149a1b4..e130709280 100644 --- a/sim/shaman/fire_elemental_totem.go +++ b/sim/shaman/fire_elemental_totem.go @@ -75,7 +75,7 @@ func (shaman *Shaman) registerFireElementalTotem() { Type: core.CooldownTypeUnknown, ShouldActivate: func(sim *core.Simulation, character *core.Character) bool { success := false - if enhTier10Aura != nil && shaman.Totems.EnhTierTenBonus { + if enhTier10Aura != nil && shaman.Totems.EnhTierTenBonus && shaman.fireElementalSnapShot != nil { if enhTier10Aura.IsActive() { success = shaman.fireElementalSnapShot.CanSnapShot(sim, castWindow) } else if sim.CurrentTime+fireTotemDuration > sim.Encounter.Duration { From 63819625ca347a6ab640c1f4c655b87f11142067 Mon Sep 17 00:00:00 2001 From: Horatio Date: Sun, 29 Oct 2023 17:42:42 -0300 Subject: [PATCH 2/2] Removed a conditional check --- sim/core/item_swaps.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/sim/core/item_swaps.go b/sim/core/item_swaps.go index f7fca3be32..dfd8e23338 100644 --- a/sim/core/item_swaps.go +++ b/sim/core/item_swaps.go @@ -191,9 +191,6 @@ func (swap *ItemSwap) getItemStats(item Item) stats.Stats { func (swap *ItemSwap) swapWeapon(slot proto.ItemSlot) { character := swap.character - if !character.AutoAttacks.AutoSwingMelee() && !character.AutoAttacks.AutoSwingRanged() { - return - } switch slot { case proto.ItemSlot_ItemSlotMainHand: