Jump to content

[bug] Totem action bar


Recommended Posts

Posted

Hello,

There is problem with commit 9274:

[9274] Implement SPELL_EFFECT_SUMMON_ALL_TOTEMS

This implement work spells 66842, 66843, 66844.

Patch originall writed by Arthorius, with additional fixes from darkstalker

and hack removes from me

How does it work:

Totem action bar ignores spell cooldowns, so you can drop totems that are on CD.

There is no m_caster->HasSpellCooldown(spell_id) check for each totem slot.

How to reproduce: Assign any totem with cooldown, like grounding totem or stoneclaw, to proper slots.

Spam the drop all button. Both totems will drop each time although they clearly have 15 and 30 sec cooldown.

You can not drop them individually because of the cooldown, but with totem action button, you can.

How it should work:

You can use totem bar anytime, but totems that are already on cooldown must not drop.

I use this without any problems:

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 9e2192b..536ba48 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -6623,8 +6623,11 @@ void Spell::EffectSummonAllTotems(SpellEffectIndex eff_idx)
    for(int32 slot = 0; slot < amount_buttons; ++slot)
        if (ActionButton const* actionButton = ((Player*)m_caster)->GetActionButton(start_button+slot))
            if (actionButton->GetType()==ACTION_BUTTON_SPELL)
-                if (uint32 spell_id = actionButton->GetAction())
+            {
+                uint32 spell_id = actionButton->GetAction();
+                if (spell_id && !((Player*)m_caster)->HasSpellCooldown(spell_id))
                    m_caster->CastSpell(unitTarget,spell_id,true);
+            }
}

void Spell::EffectDestroyAllTotems(SpellEffectIndex /*eff_idx*/)

Core rev: 9407

Cheers

Posted

Sorry but i can't reproduce that problem.

On second,third etc. cast of Call of Elements i get message that spell not ready and totem on cooldown is not (re-)placed.

Clean MaNGOS [9419]

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use