diff options
author | Machiavelli <none@none> | 2009-06-18 17:21:25 +0200 |
---|---|---|
committer | Machiavelli <none@none> | 2009-06-18 17:21:25 +0200 |
commit | 3a309abfab3762d1c3bc2f90b961582e83d5971a (patch) | |
tree | b04ae4230e1d2b67f78e4ce74b0ed6038c62be6d /src/game/Level3.cpp | |
parent | 85e59ecd578159a049295071f456c52e9d124de6 (diff) |
* In case of a 'for' loop, don't declare the iterator of a type that has a larger value range when the iterator can take a maximum value of a more efficient data type. (int to uint8 in most cases).
* Other minor cleanups, Null pointer checks etc.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Level3.cpp')
-rw-r--r-- | src/game/Level3.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 959e5dec7d3..6f98244a811 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -2421,7 +2421,7 @@ bool ChatHandler::HandleLearnAllMyTalentsCommand(const char* /*args*/) // search highest talent rank uint32 spellid = 0; - for(int rank = MAX_TALENT_RANK-1; rank >= 0; --rank) + for(uint8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { if(talentInfo->RankID[rank]!=0) { @@ -2497,7 +2497,7 @@ bool ChatHandler::HandleLearnAllMyPetTalentsCommand(const char* /*args*/) // search highest talent rank uint32 spellid = 0; - for(int rank = MAX_TALENT_RANK-1; rank >= 0; --rank) + for(uint8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank) { if(talentInfo->RankID[rank]!=0) { @@ -2524,7 +2524,7 @@ bool ChatHandler::HandleLearnAllMyPetTalentsCommand(const char* /*args*/) bool ChatHandler::HandleLearnAllLangCommand(const char* /*args*/) { // skipping UNIVERSAL language (0) - for(int i = 1; i < LANGUAGES_COUNT; ++i) + for(uint8 i = 1; i < LANGUAGES_COUNT; ++i) m_session->GetPlayer()->learnSpell(lang_description[i].spell_id,false); SendSysMessage(LANG_COMMAND_LEARN_ALL_LANG); @@ -6391,7 +6391,7 @@ bool ChatHandler::HandleMovegensCommand(const char* /*args*/) PSendSysMessage(LANG_MOVEGENS_LIST,(unit->GetTypeId()==TYPEID_PLAYER ? "Player" : "Creature" ),unit->GetGUIDLow()); MotionMaster* mm = unit->GetMotionMaster(); - for(int i = 0; i < MAX_MOTION_SLOT; ++i) + for(uint8 i = 0; i < MAX_MOTION_SLOT; ++i) { MovementGenerator* mg = mm->GetMotionSlot(i); if(!mg) |