Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[335] Hunter auto-shot should not display 'Interrupted' so often #15724

Open
MrSmite opened this issue Oct 17, 2015 · 8 comments
Open

[335] Hunter auto-shot should not display 'Interrupted' so often #15724

MrSmite opened this issue Oct 17, 2015 · 8 comments

Comments

@MrSmite
Copy link
Contributor

MrSmite commented Oct 17, 2015

Core: 747ea7c
DB: TDB_full_335.59_2015_07_14 + updates

Bug:

Hunter's auto-shot displays an inappropriate 'interrupted' error in the client for the following reasons:

  • When a target gets within melee range
    • This should only display an "interrupted" error if the player has not enabled the "Auto Shot / Auto Attack" option in the client. With this option enabled, the Hunter should switch between the two modes of attack seamlessly without an error displayed
  • When a Hunter switches targets by tabbing or right-click
    • The only time the error should be displayed in this case is if the new target is out of range or an invalid target

Details:

I found an old PTR video from 3.0.2 which shows a hunter moving in and out of shooting / melee. Notice there are no "Interrupted" errors displayed on the client.

@Langerz82
Copy link
Contributor

working on it. ^_^

@ghost
Copy link

ghost commented Feb 21, 2018

Maybe it needs a more active use of SPELL_FAILED_DONT_REPORT to drop messaging when target is dead?

@Langerz82
Copy link
Contributor

Needs further testing, I only briefly tested on a hunter, See Patch:
https://gist.github.com/Langerz82/fab95ee5755067a107a84722ebbb6942

@ghost
Copy link

ghost commented Feb 22, 2018

Going to set aside a couple of hours to test it during the weekend.
Looking forward to feedback from other testers & TC members too.

@MrSmite
Copy link
Contributor Author

MrSmite commented Feb 22, 2018

At a glance, you should also handle the other direction: melee to ranged. In the patch you posted, the flag hasSwitchedRangedToMelee never gets reset to FALSE unless the mob is already in melee range.

if (IsWithinMeleeRange(victim) && hasSwitchedRangedToMelee)
{
    hasSwitchedRangedToMelee = false;
}

If a mob starts to flee or the player tab-targets another mob, this flag would remain TRUE even though the player would auto-switch from melee to ranged.

Looks good though, you're definitely on the right track here.

@Langerz82
Copy link
Contributor

I have updated the patch to reflect the other case you mentioned. This is a better, cleaner, solution.

See:
https://gist.github.com/Langerz82/fab95ee5755067a107a84722ebbb6942

@MrSmite
Copy link
Contributor Author

MrSmite commented Feb 27, 2018

Have not tested in game but looks better. Please consider this one coding style change:

Change:

            // Prevents Interrupted packet if its an repeated Auto Ranged Spell.
            if (m_spellInfo->RangeEntry && m_spellInfo->RangeEntry->type == SPELL_RANGE_RANGED && m_spellInfo->IsAutoRepeatRangedSpell())
            {
            }
            else
            {
                // Send Interrupted info like normal.
                SendInterrupted(0);
                SendCastResult(SPELL_FAILED_INTERRUPTED);
            }

To

            // Prevents Interrupted packet if its a repeated Auto Ranged Spell to avoid "interrupted" message spam in client
            if !(m_spellInfo->RangeEntry && m_spellInfo->RangeEntry->type == SPELL_RANGE_RANGED && m_spellInfo->IsAutoRepeatRangedSpell())
            {
                // Send Interrupted info like normal.
                SendInterrupted(0);
                SendCastResult(SPELL_FAILED_INTERRUPTED);
            }

EDIT:

Oops, I forgot you can reply directly to a gist so I copied this message there...

@Langerz82
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants