[9653] Correctly update talent free points in diff cases.

Before at .unlearn or .learn all_mytalents commands free talent points not updated correctly.
Same for .learn all_mypettalents.
This commit is contained in:
VladimirMangos 2010-04-02 02:44:27 +04:00
parent d004549fd4
commit daaeb0a998
8 changed files with 86 additions and 49 deletions

View file

@ -665,14 +665,19 @@ TalentSpellPos const* GetTalentSpellPos(uint32 spellId)
return &itr->second;
}
uint32 GetTalentSpellCost(uint32 spellId)
uint32 GetTalentSpellCost(TalentSpellPos const* pos)
{
if(TalentSpellPos const* pos = GetTalentSpellPos(spellId))
if (pos)
return pos->rank+1;
return 0;
}
uint32 GetTalentSpellCost(uint32 spellId)
{
return GetTalentSpellCost(GetTalentSpellPos(spellId));
}
int32 GetAreaFlagByAreaID(uint32 area_id)
{
AreaFlagByAreaID::iterator i = sAreaFlagByAreaID.find(area_id);