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

[Fix] Prevent lost talents #874

Closed Retriman closed 11 years ago

Retriman commented 11 years ago

Check Prevent lost talents points.

@@ -25255,10 +25255,16 @@ bool Player::LearnTalent(uint32 talentId, uint32 talentRank)
     learnSpell(spellid, false);
     AddTalent(spellid, GetActiveSpec(), true);

     sLog->outDetail("TalentID: %u Rank: %u Spell: %u Spec: %u\n", talentId, talentRank, spellid, GetActiveSpec());

+    // Save Talents 
+    SQLTransaction trans = CharacterDatabase.BeginTransaction();   
+    _SaveTalents(trans);   
+    _SaveSpells(trans);    
+    CharacterDatabase.CommitTransaction(trans);    
+
     // set talent tree for player
     if (!GetPrimaryTalentTree(GetActiveSpec()))
     {
         SetPrimaryTalentTree(GetActiveSpec(), talentInfo->TalentTab);
         std::vector<uint32> const* specSpells = GetTalentTreePrimarySpells(talentInfo->TalentTab);
Bootz commented 11 years ago

added in commit 7dc7df72c78f8dee9f0a744701b78cf51d1160db