Skip to content

Commit

Permalink
Merge pull request #3978 from Horatio27/itemswap_fix
Browse files Browse the repository at this point in the history
Itemswap fix
  • Loading branch information
Horatio27 authored Oct 29, 2023
2 parents 06b9767 + 6381962 commit b95d5a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
19 changes: 11 additions & 8 deletions sim/core/item_swaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,19 +191,22 @@ 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:
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
Expand Down
2 changes: 1 addition & 1 deletion sim/shaman/fire_elemental_totem.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b95d5a7

Please sign in to comment.