diff options
author | megamage <none@none> | 2009-08-30 11:24:56 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-30 11:24:56 -0500 |
commit | c5fe21046198613f1fc85a6fbc918b7c4a002866 (patch) | |
tree | ed16a041812566d420b14998dec0e939c9232735 | |
parent | cceab34cff7384aa6a5fe23480b969e95ba5ec96 (diff) |
*Fix the error in 5477 which makes server freeze.
--HG--
branch : trunk
-rw-r--r-- | src/game/Level3.cpp | 4 | ||||
-rw-r--r-- | src/game/Player.cpp | 20 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 55ef44baa1b..ca14e02383e 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -2417,7 +2417,7 @@ bool ChatHandler::HandleLearnAllMyTalentsCommand(const char* /*args*/) // search highest talent rank uint32 spellId = 0; - for(uint8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) + for(int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { if(talentInfo->RankID[rank] != 0) { @@ -2493,7 +2493,7 @@ bool ChatHandler::HandleLearnAllMyPetTalentsCommand(const char* /*args*/) // search highest talent rank uint32 spellid = 0; - for(uint8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) + for(int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { if(talentInfo->RankID[rank]!=0) { diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 0c0c35c1bec..cf40e71a4cb 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -21114,7 +21114,7 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank) // find current max talent rank uint8 curtalent_maxrank = 0; - for(uint8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) + for(int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { if(talentInfo->RankID[rank] && HasSpell(talentInfo->RankID[rank])) { @@ -21251,7 +21251,7 @@ void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank) // find current max talent rank uint8 curtalent_maxrank = 0; - for(uint8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) + for(int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { if(talentInfo->RankID[rank] && pet->HasSpell(talentInfo->RankID[rank])) { @@ -21439,8 +21439,8 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket *data) continue; // find max talent rank - uint8 curtalent_maxrank = 0; - for(uint8 rank = MAX_TALENT_RANK-1; rank > 0; --rank) + int8 curtalent_maxrank = -1; + for(int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { if(talentInfo->RankID[rank] && HasTalent(talentInfo->RankID[rank], specIdx)) { @@ -21450,7 +21450,7 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket *data) } // not learned talent - if(!curtalent_maxrank) + if(curtalent_maxrank < 0) continue; *data << uint32(talentInfo->TalentID); // Talent.dbc @@ -21516,8 +21516,8 @@ void Player::BuildPetTalentsInfoData(WorldPacket *data) continue; // find max talent rank - uint8 curtalent_maxrank = 0; - for(uint8 rank = MAX_TALENT_RANK-1; rank > 0; --rank) + int8 curtalent_maxrank = -1; + for(int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { if(talentInfo->RankID[rank] && pet->HasSpell(talentInfo->RankID[rank])) { @@ -21527,7 +21527,7 @@ void Player::BuildPetTalentsInfoData(WorldPacket *data) } // not learned talent - if(!curtalent_maxrank) + if(curtalent_maxrank < 0) continue; *data << uint32(talentInfo->TalentID); // Talent.dbc @@ -21897,7 +21897,7 @@ void Player::ActivateSpec(uint8 spec) continue; // remove all talent ranks, starting at highest rank - for(uint8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) + for(int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { if(talentInfo->RankID[rank] != 0 && HasTalent(talentInfo->RankID[rank], m_activeSpec)) { @@ -21938,7 +21938,7 @@ void Player::ActivateSpec(uint8 spec) continue; // learn highest talent rank that exists in newly activated spec - for(uint8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) + for(int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { if(talentInfo->RankID[rank] && HasTalent(talentInfo->RankID[rank], m_activeSpec)) { |