ProjectSkyfire / SkyFire.406a

SkyFireEMU is a full featured F/OSS World of Warcraft: Cataclysm emulator written in C++. || Compatible with World of Warcraft client 4.0.6a (Build:13623) || Public DB is located on forum
http://www.projectskyfire.org
GNU General Public License v3.0
343 stars 218 forks source link

[Fixed]Bug Dual talent Spec. #870

Closed Retriman closed 11 years ago

Retriman commented 11 years ago

Problem persist #645 branch to change your talents are not saved.

I have really no idea why this happens, I guess it must be some query the core that is not being applied.

I hope to find a solution to this or if not able to help see where the error

SkyFire commented 11 years ago

I will check this shortly.

Retriman commented 11 years ago

ok and other problem related talent points its there are talents that are learned but never learned (is a visual bug).

Ss for bug; http://www.ryohnosuke.net/img/2013/04/01/SA4m.jpg

ImageDev commented 11 years ago

yeah i seen this with my mages especially, how to reproduce for leet mage... build go fully ice tree. you'll have everything in ice spec plus mirror images and arcane bubble and... i can't pin down why this is happening though otherwise would aim to fix it. im sure if mages have this others do to, in retail im dual spec arc/pyro, in fire spec i don't get arcane abilities, so why would ice. ill check if it does it there too when i have the gold to change my talents. (pom pyro spec blows anyways right now (retail)) (Elemental spec just doesn't really work after like it used to either (retail))

Retriman commented 11 years ago

Fixed 2 bugs related ;)

@@ -26048,15 +26049,18 @@ void Player::ActivateSpec(uint8 spec)
         for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
         {
             // skip non-existant talent ranks
             if (talentInfo->RankID[rank] == 0)
                 continue;
-            removeSpell(talentInfo->RankID[rank], true); // removes the talent, and all dependant, learned, and chained spells..
-            if (const SpellInfo* _spellEntry = sSpellMgr->GetSpellInfo(talentInfo->RankID[rank]))
-                for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)                  // search through the SpellInfo for valid trigger spells
-                    if (_spellEntry->Effects[i].TriggerSpell > 0 && _spellEntry->Effects[i].Effect == SPELL_EFFECT_LEARN_SPELL)
-                        removeSpell(_spellEntry->Effects[i].TriggerSpell, true); // and remove any spells that the talent teaches
+            const SpellInfo* _spellEntry = sSpellMgr->GetSpellInfo(talentInfo->RankID[rank]);
+            if (!_spellEntry)
+                continue;
+            removeSpell(talentInfo->RankID[rank], true);
+            // search for spells that the talent teaches and unlearn them
+            for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+                if (_spellEntry->Effects[i].TriggerSpell > 0 && _spellEntry->Effects[i].Effect == SPELL_EFFECT_LEARN_SPELL)
+                    removeSpell(_spellEntry->Effects[i].TriggerSpell, true);
             // if this talent rank can be found in the PlayerTalentMap, mark the talent as removed so it gets deleted
             //PlayerTalentMap::iterator plrTalent = m_talents[m_activeSpec]->find(talentInfo->RankID[rank]);
             //if (plrTalent != m_talents[m_activeSpec]->end())
             //    plrTalent->second->state = PLAYERSPELL_REMOVED;
         }
Bootz commented 11 years ago

tested and added into commit 6f00f666db305c78f0ffc1a8a67c4559de0a32e4 seems during the time when we were having talent saving issues, i added that backwards when making the fix. very good catch... i never seen it.