cmangos / issues

This repository is used as a centralized point for all issues regarding CMaNGOS.
179 stars 47 forks source link

🐛 [Bug Report] Hunter - Pet Spellbook doesn't show on pet taming #3152

Open Heisen59 opened 1 year ago

Heisen59 commented 1 year ago

Bug Details

The pet spellbook doesn't show on pet taming.

Steps to Reproduce

  1. Create a hunter and learn Tame Beast (or do the quest at level 10)
  2. Tame a beast
  3. The pet spell book doesn't show image

Expected behavior

The pet spell book should update on taming like it does on Call Pet

After Dismiss Pet and Call Pet : image

Suggested Workaround

Can't find

Crash Log

No crash

Core SHA1 Commit Hash

3a81d86d7eb0428b66c10d67a764eca05a3dca13

Database SHA1 Commit Hash

667167d1ceb50e0864e308029cc48c1e72bf20d3

Operating System

Windows

Client Version

3.3.5a (Wrath of the Lich King)

aleigood commented 1 year ago

Comfirm, same in TBC

AnonXS commented 1 year ago

still a thing?

virusav commented 1 year ago

Core SHA: e034bb7dc7cc4a99469f45891675cf2386bb75ba. Wotlk-db SHA: 89c8fd519b0dd0bbf4d2f1131cba9833197110ad.

Pet taming: the pet's spell bar does not have its personal spells. WoWScrnShot_090223_162843

Summon pet: all spells in place.

If we compare the code Spell::EffectTameCreature with Spell::EffectSummonPet, we will see the difference in the order of function calls. In theory, there should be one function that combines common pieces of code that are executed when taming and summoning a pet.

If you make one change to tame a pet, similar to summoning, then the spells will be in place:

diff --git a/src/game/Spells/SpellEffects.cpp b/src/game/Spells/SpellEffects.cpp
index 572eeea0a..8f54ac737 100644
--- a/src/game/Spells/SpellEffects.cpp
+++ b/src/game/Spells/SpellEffects.cpp
@@ -7460,6 +7460,8 @@ void Spell::EffectTameCreature(SpellEffectIndex /*eff_idx*/)
     uint32 level = (cLevel + 5) < plLevel ? (plLevel - 5) : cLevel;
     pet->SetCanModifyStats(true);
     pet->InitStatsForLevel(level);
+    // this enables pet details window (Shift+P)
+    pet->InitPetCreateSpells();
     pet->InitLevelupSpellsForLevel();
     pet->InitTalentForLevel();

@@ -7480,9 +7482,6 @@ void Spell::EffectTameCreature(SpellEffectIndex /*eff_idx*/)
     // visual effect for levelup
     pet->SetUInt32Value(UNIT_FIELD_LEVEL, level);

-    // this enables pet details window (Shift+P)
-    pet->InitPetCreateSpells();
-
     // this add pet auras
     pet->LearnPetPassives();
     pet->CastPetAuras(true);

WoWScrnShot_090223_163514

I don't know if there should be any other changes to the pet taming code.

virusav commented 11 months ago

Core SHA: aba16223d5f5b6fb702fef5aabd6589d8d6d06f2. Wotlk-db SHA: f237ba8d0ca8c42aa9dec8e1f139180ef46c12d8.

  1. The pet spell panel is missing.
  2. Resistance immediately after taming is 2 times greater than after summoning an already tamed pet.

After applying the patch:

  1. The pet's spell panel is in place, as after the summoning.
  2. Resistances immediately after taming are equal to those displayed after summoning an already tamed pet.

What else needs to be checked to be sure that the patch fixes the specified problems and does not add new ones?