*Fix possible freezing bug of last rev.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-31 00:59:02 -05:00
parent 29901b5389
commit fe3e40c284

View File

@@ -21127,9 +21127,9 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank)
if( (getClassMask() & talentTabInfo->ClassMask) == 0 )
return;
// find current max talent rank (1~5)
uint8 curtalent_maxrank = 0; // Maybe start at 6 and have rank start at MAX_TALENT_RANK-2? Not sure
for(uint8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
// find current max talent rank (0~5)
uint8 curtalent_maxrank = 0; // 0 = not learned any rank
for(int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
{
if(talentInfo->RankID[rank] && HasSpell(talentInfo->RankID[rank]))
{
@@ -21264,9 +21264,9 @@ void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank)
if(!((1 << pet_family->petTalentType) & talentTabInfo->petTalentMask))
return;
// find current max talent rank (1~5)
uint8 curtalent_maxrank = 0;
for(uint8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
// find current max talent rank (0~5)
uint8 curtalent_maxrank = 0; // 0 = not learned any rank
for(int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
{
if(talentInfo->RankID[rank] && pet->HasSpell(talentInfo->RankID[rank]))
{