Potion BUG (Health, MANA, RAGE etc.)

Issue #507 resolved
Jakob Sojak created an issue

Hi guys, I found a big bug. Potions don't compare max health or energy/mana/rage of caster/user, but they compare it by unit_target.

That means if you want to drink mana potion and you are in a combat with something that doesn't have a mana, you get a message "your mana is full" and potion wasn't used.

I wonder if anyone found this bug.

Here is fix:

(Spell.ccp)

@@ -4745,7 +4745,8 @@

                     if (m_spellInfo->Effect[i] == SPELL_EFFECT_HEAL)
                     {
-                        if (m_targets.getUnitTarget()->GetHealth() == m_targets.getUnitTarget()->GetMaxHealth())
+                        //if (m_targets.getUnitTarget()->GetHealth() == m_targets.getUnitTarget()->GetMaxHealth())
+                       if (p_caster->GetHealth() == p_caster->GetMaxHealth())
                         {
                             failReason = (uint8)SPELL_FAILED_ALREADY_AT_FULL_HEALTH;
                             continue;
@@ -4767,7 +4768,7 @@
                         }

                         Powers power = Powers(m_spellInfo->EffectMiscValue[i]);
-                        if (m_targets.getUnitTarget()->GetPower(power) == m_targets.getUnitTarget()->GetMaxPower(power))
+                        if (p_caster->GetPower(power) == p_caster->GetMaxPower(power))
                         {
                             failReason = (uint8)SPELL_FAILED_ALREADY_AT_FULL_POWER;
                             continue;

Please merge it into OregonCore, thx ;-)

Comments (9)

  1. Log in to comment