Skip to content

Commit

Permalink
Merge pull request #4122 from wowsims/fixes
Browse files Browse the repository at this point in the history
Fix crash caused by #4118
  • Loading branch information
jimmyt857 authored Jan 2, 2024
2 parents 9fcdb30 + 5ebadee commit 737f73f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions sim/core/apl.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,13 @@ func (unit *Unit) newAPLRotation(config *proto.APLRotation) *APLRotation {

// Remove MCDs that are referenced by APL actions, so that the Autocast Other Cooldowns
// action does not include them.
character := unit.Env.Raid.GetPlayerFromUnit(unit).GetCharacter()
for _, action := range rotation.allAPLActions() {
if castSpellAction, ok := action.impl.(*APLActionCastSpell); ok {
character.removeInitialMajorCooldown(castSpellAction.spell.ActionID)
agent := unit.Env.GetAgentFromUnit(unit)
if agent != nil {
character := agent.GetCharacter()
for _, action := range rotation.allAPLActions() {
if castSpellAction, ok := action.impl.(*APLActionCastSpell); ok {
character.removeInitialMajorCooldown(castSpellAction.spell.ActionID)
}
}
}

Expand Down

0 comments on commit 737f73f

Please sign in to comment.