Skip to content

[3.3.5] Core/Pet: Fix pet action bar loosing autocast settings (#16211)#20110

Merged
Treeston merged 1 commit into
TrinityCore:3.3.5from
necropola:3.3.5
Aug 4, 2017
Merged

[3.3.5] Core/Pet: Fix pet action bar loosing autocast settings (#16211)#20110
Treeston merged 1 commit into
TrinityCore:3.3.5from
necropola:3.3.5

Conversation

@necropola

Copy link
Copy Markdown
Contributor

reverts one line of 6c21ddd
Target branch: 3.3.5
Issues addressed: Closes #16211
Tests performed: build succeeded and tested/verified in game (me and Eronox)

}

// if remove last rank or non-ranked then update action bar at server and client if need
if (m_charmInfo->RemoveSpellFromActionBar(spell_id) && !learn_prev && clear_ab)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are changing the sequencing of RemoveSpellFromActionBar w.r.t. learn_prev. Is this intentional?

@necropola necropola Aug 4, 2017

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it back to what is was. intentionally. order matters in short-circuit boolean evaluation and executing RemoveSpellFromActionBar() in any case broke the pet action bar autocast settings.
The case where it breaks is, when the pet has learned more than one Rank of an auto-castable spell like Growl or Bite.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

order matters in short-circuit boolean evaluation

That's the point. You're changing the order of the RemoveSpellFromActionBar invocation w.r.t. two different bools (clear_ab and learn_prev) - which of the two is the intended change (or is it both).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upon looking at diff history - both is intended.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want the function call to only happen when both clear_ab == true and !learn_pre == true (learn_prev == false) or rather I want the order to be restored to what it was before commit 6c21ddd. My patch simply reverts one line of this commit and thereby fixes an issue obviously caused by it, i.e it's 100% reproducable/fixed without/with my patch.
I would be happier myself, if I could give a better explanation, but I just started a few days ago to familiarize myself with the TrinityCore source, actually with the intention to fix this (and maybe some other) issue(s). .

@Treeston

Treeston commented Aug 4, 2017

Copy link
Copy Markdown
Contributor

@necropola btw to avoid cluttering the history of every PR you make by basing them all off the same branch, I'd recommend creating a separate branch based on 3.3.5 for every PR you make (f.ex., 3.3.5-petautocast, 3.3.5-thisawesomething etc) and then PRing from those.

@necropola

necropola commented Aug 4, 2017

Copy link
Copy Markdown
Contributor Author

Will do. I still need to learn a lot. but I'm getting there. I actually checked your TC fork yesterday and noticed all those 3.3.5-xyz branches. :-)

@Treeston

Treeston commented Aug 4, 2017

Copy link
Copy Markdown
Contributor

No worries, you'll get there.

PS: Consider getting on IRC.

@necropola

Copy link
Copy Markdown
Contributor Author

My second patch/commit is now in a separate 3.3.5-branch of my fork.
https://github.com/necropola/TrinityCore/tree/3.3.5-PetSpellMapSyncDB
Do I have to discard the current pull request and make a new one based on the new branch?
.. or is there a way to adjust the branch/commit in my current pull request?

@Treeston

Treeston commented Aug 5, 2017

Copy link
Copy Markdown
Contributor

No, sadly. Just keep the PR as-is and start using separate branches going forward.

Shauren pushed a commit that referenced this pull request Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants