Skip to content

Commit

Permalink
Merge pull request #4073 from wowsims/apl
Browse files Browse the repository at this point in the history
Improve panic message for invalid talents, and fix prot warrior bug w…
  • Loading branch information
jimmyt857 authored Dec 2, 2023
2 parents 65471fb + 054068f commit d3058b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sim/core/character.go
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,11 @@ func FillTalentsProto(data protoreflect.Message, talentsStr string, treeSizes [3
for treeIdx, treeStr := range treeStrs {
for talentIdx, talentValStr := range treeStr {
talentVal, _ := strconv.Atoi(string(talentValStr))
fd := fieldDescriptors.ByNumber(protowire.Number(offset + talentIdx + 1))
talentOffset := offset + talentIdx + 1
fd := fieldDescriptors.ByNumber(protowire.Number(talentOffset))
if fd == nil {
panic(fmt.Sprintf("Couldn't find proto field for talent #%d, full string: %s", talentOffset, talentsStr))
}
if fd.Kind() == protoreflect.BoolKind {
data.Set(fd, protoreflect.ValueOfBool(talentVal == 1))
} else { // Int32Kind
Expand Down
1 change: 1 addition & 0 deletions sim/warrior/protection/protection_warrior.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ func (war *ProtectionWarrior) Initialize() {
war.Warrior.Initialize()

war.RegisterHSOrCleave(false, war.Rotation.HsRageThreshold)
war.RegisterRendSpell(0, 0)
war.RegisterShieldWallCD()
war.RegisterShieldBlockCD()
war.DefensiveStanceAura.BuildPhase = core.CharacterBuildPhaseTalents
Expand Down

0 comments on commit d3058b5

Please sign in to comment.