Trinitycore: [335] Hunter auto-shot should not display 'Interrupted' so often

Created on 17 Oct 2015  路  8Comments  路  Source: TrinityCore/TrinityCore

Core: https://github.com/TrinityCore/TrinityCore/commit/747ea7ca2c2b757dc9c5a672746d801a8365ee98
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.

Branch-3.3.5a Comp-Core Feedback-FixOutdatedMissingWIP

Most helpful comment

working on it. ^_^

All 8 comments

working on it. ^_^

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

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

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

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.

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

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...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Rushor picture Rushor  路  3Comments

Tatara902 picture Tatara902  路  3Comments

Jonne733 picture Jonne733  路  3Comments

funjoker picture funjoker  路  3Comments

Rushor picture Rushor  路  3Comments