From 545f1564490f613f3b70c6dcdbb5a12be5a3c39d Mon Sep 17 00:00:00 2001 From: James Tanner Date: Sat, 2 Dec 2023 13:21:23 -0800 Subject: [PATCH] Fix a few bugs --- sim/shaman/shaman.go | 2 +- sim/warrior/protection/protection_warrior.go | 3 --- ui/raid/raid_picker.ts | 12 ++++++------ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/sim/shaman/shaman.go b/sim/shaman/shaman.go index ba053aaea1..79f21578ba 100644 --- a/sim/shaman/shaman.go +++ b/sim/shaman/shaman.go @@ -264,7 +264,7 @@ func (shaman *Shaman) Initialize() { // Healing stream totem applies a HoT (aura) and so needs to be handled as a pre-pull action // instead of during init/reset. - if shaman.Totems.Water == proto.WaterTotem_HealingStreamTotem { + if !shaman.IsUsingAPL && shaman.Totems.Water == proto.WaterTotem_HealingStreamTotem { shaman.RegisterPrepullAction(0, func(sim *core.Simulation) { shaman.HealingStreamTotem.Cast(sim, &shaman.Unit) }) diff --git a/sim/warrior/protection/protection_warrior.go b/sim/warrior/protection/protection_warrior.go index 9b1be13d9a..9a7849ea1c 100644 --- a/sim/warrior/protection/protection_warrior.go +++ b/sim/warrior/protection/protection_warrior.go @@ -93,9 +93,6 @@ func (war *ProtectionWarrior) Initialize() { war.RegisterShieldBlockCD() war.DefensiveStanceAura.BuildPhase = core.CharacterBuildPhaseTalents - if !war.IsUsingAPL { - war.CustomRotation = war.makeCustomRotation() - } if war.Options.UseShatteringThrow { war.RegisterShatteringThrowCD() } diff --git a/ui/raid/raid_picker.ts b/ui/raid/raid_picker.ts index 949efe0d29..2f03bbd1dd 100644 --- a/ui/raid/raid_picker.ts +++ b/ui/raid/raid_picker.ts @@ -29,6 +29,8 @@ import { Tooltip } from 'bootstrap'; const NEW_PLAYER: number = -1; +const LATEST_PHASE_WITH_ALL_PRESETS = Math.min(...playerPresets.map(preset => Math.max(...Object.keys(preset.defaultGear[Faction.Alliance]).map(k => parseInt(k))))); + enum DragType { None, New, @@ -92,11 +94,10 @@ export class RaidPicker extends Component { }, }); - const latestPhaseWithAllPresets = Math.min(...playerPresets.map(preset => Math.max(...Object.keys(preset.defaultGear[Faction.Alliance]).map(k => parseInt(k))))); const _phaseSelector = new EnumPicker(raidControls, this.newPlayerPicker, { label: 'Default Gear', labelTooltip: 'Newly-created players will start with approximate BIS gear from this phase.', - values: [...Array(latestPhaseWithAllPresets).keys()].map(val => { + values: [...Array(LATEST_PHASE_WITH_ALL_PRESETS).keys()].map(val => { const phase = val + 1; return { name: 'Phase ' + phase, value: phase }; }), @@ -679,10 +680,9 @@ class NewPlayerPicker extends Component { // Need to wait because the gear might not be loaded yet. this.raidPicker.raid.sim.waitForInit().then(() => { - newPlayer.setGear( - eventID, - this.raidPicker.raid.sim.db.lookupEquipmentSpec( - matchingPreset.defaultGear[this.raidPicker.getCurrentFaction()][this.raidPicker.getCurrentPhase()])); + const phase = Math.min(this.raidPicker.getCurrentPhase(), LATEST_PHASE_WITH_ALL_PRESETS); + const gearSet = matchingPreset.defaultGear[this.raidPicker.getCurrentFaction()][phase]; + newPlayer.setGear(eventID, this.raidPicker.raid.sim.db.lookupEquipmentSpec(gearSet)); }); this.raidPicker.setDragPlayer(newPlayer, NEW_PLAYER, DragType.New);