diff --git a/src/bindings/universal/ScriptMgr.cpp b/src/bindings/universal/ScriptMgr.cpp index 5e55222d2..3d835f47d 100644 --- a/src/bindings/universal/ScriptMgr.cpp +++ b/src/bindings/universal/ScriptMgr.cpp @@ -26,7 +26,7 @@ #include "../../game/ScriptMgr.h" #include "../../game/SpellAuras.h" -//uint8 loglevel = 0; +// uint8 loglevel = 0; int nrscripts; Script* m_scripts[MAX_SCRIPTS]; @@ -376,10 +376,10 @@ bool EffectAuraDummy(const Aura* pAura, bool apply) void ScriptedAI::UpdateAI(const uint32) { - //Check if we have a current target + // Check if we have a current target if (m_creature->isAlive() && m_creature->SelectHostileTarget() && m_creature->getVictim()) { - //If we are within range melee the target + // If we are within range melee the target if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) { if (m_creature->isAttackReady()) diff --git a/src/bindings/universal/ScriptMgr.h b/src/bindings/universal/ScriptMgr.h index f4235651a..d75efe722 100644 --- a/src/bindings/universal/ScriptMgr.h +++ b/src/bindings/universal/ScriptMgr.h @@ -19,7 +19,7 @@ #ifndef SCRIPTMGR_H #define SCRIPTMGR_H -//Only required includes +// Only required includes #include "../../game/CreatureAI.h" #include "../../game/Creature.h" #include "../../game/InstanceData.h" diff --git a/src/framework/GameSystem/NGrid.h b/src/framework/GameSystem/NGrid.h index 4848abd8d..6323cd5e8 100644 --- a/src/framework/GameSystem/NGrid.h +++ b/src/framework/GameSystem/NGrid.h @@ -60,8 +60,8 @@ class GridInfo private: TimeTracker i_timer; - uint16 i_unloadActiveLockCount : 16; // lock from active object spawn points (prevent clone loading) - bool i_unloadExplicitLock : 1; // explicit manual lock or config setting + uint16 i_unloadActiveLockCount : 16; // lock from active object spawn points (prevent clone loading) + bool i_unloadExplicitLock : 1; // explicit manual lock or config setting }; typedef enum diff --git a/src/framework/GameSystem/TypeContainerFunctions.h b/src/framework/GameSystem/TypeContainerFunctions.h index f7967857f..99ac96cab 100644 --- a/src/framework/GameSystem/TypeContainerFunctions.h +++ b/src/framework/GameSystem/TypeContainerFunctions.h @@ -67,7 +67,7 @@ namespace MaNGOS template SPECIFIC_TYPE* Insert(ContainerMapList& elements, SPECIFIC_TYPE* obj) { - //elements._element[hdl] = obj; + // elements._element[hdl] = obj; obj->GetGridRef().link(&elements._element, obj); return obj; } diff --git a/src/framework/Platform/Define.h b/src/framework/Platform/Define.h index 89ea94e16..3ce41eab3 100644 --- a/src/framework/Platform/Define.h +++ b/src/framework/Platform/Define.h @@ -34,10 +34,10 @@ #if !defined(MANGOS_ENDIAN) # if defined (ACE_BIG_ENDIAN) # define MANGOS_ENDIAN MANGOS_BIGENDIAN -# else //ACE_BYTE_ORDER != ACE_BIG_ENDIAN +# else // ACE_BYTE_ORDER != ACE_BIG_ENDIAN # define MANGOS_ENDIAN MANGOS_LITTLEENDIAN -# endif //ACE_BYTE_ORDER -#endif //MANGOS_ENDIAN +# endif // ACE_BYTE_ORDER +#endif // MANGOS_ENDIAN typedef ACE_SHLIB_HANDLE MANGOS_LIBRARY_HANDLE; @@ -53,7 +53,7 @@ typedef ACE_SHLIB_HANDLE MANGOS_LIBRARY_HANDLE; #if PLATFORM == PLATFORM_WINDOWS # define MANGOS_EXPORT __declspec(dllexport) # define MANGOS_IMPORT __cdecl -#else //PLATFORM != PLATFORM_WINDOWS +#else // PLATFORM != PLATFORM_WINDOWS # define MANGOS_EXPORT export # if defined(__APPLE_CC__) && defined(BIG_ENDIAN) # define MANGOS_IMPORT __attribute__ ((longcall)) @@ -62,7 +62,7 @@ typedef ACE_SHLIB_HANDLE MANGOS_LIBRARY_HANDLE; # else # define MANGOS_IMPORT __attribute__ ((cdecl)) # endif //__APPLE_CC__ && BIG_ENDIAN -#endif //PLATFORM +#endif // PLATFORM #if PLATFORM == PLATFORM_WINDOWS # ifdef MANGOS_WIN32_DLL_IMPORT @@ -72,38 +72,38 @@ typedef ACE_SHLIB_HANDLE MANGOS_LIBRARY_HANDLE; # define MANGOS_DLL_DECL __declspec(dllexport) # else //!MANGOS_WIND_DLL_EXPORT # define MANGOS_DLL_DECL -# endif //MANGOS_WIND_DLL_EXPORT -# endif //MANGOS_WIN32_DLL_IMPORT -#else //PLATFORM != PLATFORM_WINDOWS +# endif // MANGOS_WIND_DLL_EXPORT +# endif // MANGOS_WIN32_DLL_IMPORT +#else // PLATFORM != PLATFORM_WINDOWS # define MANGOS_DLL_DECL -#endif //PLATFORM +#endif // PLATFORM #if PLATFORM == PLATFORM_WINDOWS # define MANGOS_DLL_SPEC __declspec(dllexport) # ifndef DECLSPEC_NORETURN # define DECLSPEC_NORETURN __declspec(noreturn) -# endif //DECLSPEC_NORETURN -#else //PLATFORM != PLATFORM_WINDOWS +# endif // DECLSPEC_NORETURN +#else // PLATFORM != PLATFORM_WINDOWS # define MANGOS_DLL_SPEC # define DECLSPEC_NORETURN -#endif //PLATFORM +#endif // PLATFORM #if !defined(DEBUG) # define MANGOS_INLINE inline -#else //DEBUG +#else // DEBUG # if !defined(MANGOS_DEBUG) # define MANGOS_DEBUG -# endif //MANGOS_DEBUG +# endif // MANGOS_DEBUG # define MANGOS_INLINE #endif //!DEBUG #if COMPILER == COMPILER_GNU # define ATTR_NORETURN __attribute__((noreturn)) # define ATTR_PRINTF(F,V) __attribute__ ((format (printf, F, V))) -#else //COMPILER != COMPILER_GNU +#else // COMPILER != COMPILER_GNU # define ATTR_NORETURN # define ATTR_PRINTF(F,V) -#endif //COMPILER == COMPILER_GNU +#endif // COMPILER == COMPILER_GNU typedef ACE_INT64 int64; typedef ACE_INT32 int32; @@ -117,7 +117,7 @@ typedef ACE_UINT8 uint8; #if COMPILER != COMPILER_MICROSOFT typedef uint16 WORD; typedef uint32 DWORD; -#endif //COMPILER +#endif // COMPILER #if COMPILER == COMPILER_GNU # if !defined(__GXX_EXPERIMENTAL_CXX0X__) || (__GNUC__ < 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ < 7) @@ -127,4 +127,4 @@ typedef uint32 DWORD; typedef uint64 OBJECT_HANDLE; -#endif //MANGOS_DEFINE_H +#endif // MANGOS_DEFINE_H diff --git a/src/framework/Policies/MemoryManagement.cpp b/src/framework/Policies/MemoryManagement.cpp index 9e2c36fad..91f32d429 100644 --- a/src/framework/Policies/MemoryManagement.cpp +++ b/src/framework/Policies/MemoryManagement.cpp @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -//lets use Intel scalable_allocator by default and -//switch to OS specific allocator only when _STANDARD_MALLOC is defined +// lets use Intel scalable_allocator by default and +// switch to OS specific allocator only when _STANDARD_MALLOC is defined #ifndef USE_STANDARD_MALLOC #include "../../dep/tbb/include/tbb/scalable_allocator.h" diff --git a/src/framework/Utilities/Callback.h b/src/framework/Utilities/Callback.h index 3f0238af3..7369a9d81 100644 --- a/src/framework/Utilities/Callback.h +++ b/src/framework/Utilities/Callback.h @@ -19,7 +19,7 @@ #ifndef MANGOS_CALLBACK_H #define MANGOS_CALLBACK_H -//defines to simplify multi param templates code and readablity +// defines to simplify multi param templates code and readablity #define TYPENAMES_1 typename T1 #define TYPENAMES_2 TYPENAMES_1, typename T2 #define TYPENAMES_3 TYPENAMES_2, typename T3 @@ -42,7 +42,7 @@ #define PARAMS_9 PARAMS_8, T9 param9 #define PARAMS_10 PARAMS_9, T10 param10 -//empty struct to use in templates instead of void type +// empty struct to use in templates instead of void type struct null { null() {} }; /// ------------ BASE CLASSES ------------ diff --git a/src/framework/Utilities/EventProcessor.cpp b/src/framework/Utilities/EventProcessor.cpp index 27d6bf8dc..873f3b1e5 100644 --- a/src/framework/Utilities/EventProcessor.cpp +++ b/src/framework/Utilities/EventProcessor.cpp @@ -75,7 +75,7 @@ void EventProcessor::KillAllEvents(bool force) { delete i_old->second; - if (!force) // need per-element cleanup + if (!force) // need per-element cleanup m_events.erase(i_old); } } diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp index 913fa62e7..cb2cecf80 100644 --- a/src/game/AchievementMgr.cpp +++ b/src/game/AchievementMgr.cpp @@ -481,7 +481,7 @@ void AchievementMgr::SaveToDB() if (!m_completedAchievements.empty()) { - //delete existing achievements in the loop + // delete existing achievements in the loop for (CompletedAchievementMap::iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter) { if (!iter->second.changed) @@ -500,7 +500,7 @@ void AchievementMgr::SaveToDB() if (!m_criteriaProgress.empty()) { - //insert achievements + // insert achievements for (CriteriaProgressMap::iterator iter = m_criteriaProgress.begin(); iter != m_criteriaProgress.end(); ++iter) { if (!iter->second.changed) @@ -1126,7 +1126,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!found) continue; - //FIXME: work only for instances where max==min for players + // FIXME: work only for instances where max==min for players if (map->GetMaxPlayers() != achievementCriteria->death_in_dungeon.manLimit) continue; @@ -1200,9 +1200,9 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui switch (achievement->ID) { case 31: - //case 1275: // these timed achievements have to be "started" on Quest Accept - //case 1276: - //case 1277: + // case 1275: // these timed achievements have to be "started" on Quest Accept + // case 1276: + // case 1277: case 1282: case 1789: { @@ -2472,9 +2472,9 @@ void AchievementGlobalMgr::LoadAchievementCriteriaRequirements() switch (achievement->ID) { case 31: - //case 1275: // these timed achievements are "started" on Quest Accept, and simple ended on quest-complete - //case 1276: - //case 1277: + // case 1275: // these timed achievements are "started" on Quest Accept, and simple ended on quest-complete + // case 1276: + // case 1277: case 1282: case 1789: break; @@ -2650,7 +2650,7 @@ void AchievementGlobalMgr::LoadRewards() } } - //check mail data before item for report including wrong item case + // check mail data before item for report including wrong item case if (reward.sender) { if (!ObjectMgr::GetCreatureTemplate(reward.sender)) @@ -2694,7 +2694,7 @@ void AchievementGlobalMgr::LoadRewards() void AchievementGlobalMgr::LoadRewardLocales() { - m_achievementRewardLocales.clear(); // need for reload case + m_achievementRewardLocales.clear(); // need for reload case QueryResult* result = WorldDatabase.Query("SELECT entry,gender,subject_loc1,text_loc1,subject_loc2,text_loc2,subject_loc3,text_loc3,subject_loc4,text_loc4,subject_loc5,text_loc5,subject_loc6,text_loc6,subject_loc7,text_loc7,subject_loc8,text_loc8 FROM locales_achievement_reward"); diff --git a/src/game/AggressorAI.cpp b/src/game/AggressorAI.cpp index 59506cac1..eb5af8fb5 100644 --- a/src/game/AggressorAI.cpp +++ b/src/game/AggressorAI.cpp @@ -100,8 +100,8 @@ void AggressorAI::EnterEvadeMode() else { DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Creature stopped attacking, victim out run him [guid=%u]", m_creature->GetGUIDLow()); - //i_state = STATE_LOOK_AT_VICTIM; - //i_tracker.Reset(TIME_INTERVAL_LOOK); + // i_state = STATE_LOOK_AT_VICTIM; + // i_tracker.Reset(TIME_INTERVAL_LOOK); } if (!m_creature->isCharmed()) diff --git a/src/game/ArenaTeam.cpp b/src/game/ArenaTeam.cpp index 550a93119..c699b098c 100644 --- a/src/game/ArenaTeam.cpp +++ b/src/game/ArenaTeam.cpp @@ -209,7 +209,7 @@ bool ArenaTeam::LoadArenaTeamFromDB(QueryResult* arenaTeamDataResult) m_EmblemColor = fields[6].GetUInt32(); m_BorderStyle = fields[7].GetUInt32(); m_BorderColor = fields[8].GetUInt32(); - //load team stats + // load team stats m_stats.rating = fields[9].GetUInt32(); m_stats.games_week = fields[10].GetUInt32(); m_stats.wins_week = fields[11].GetUInt32(); @@ -230,20 +230,20 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult* arenaTeamMembersResult) do { Field* fields = arenaTeamMembersResult->Fetch(); - //prevent crash if db records are broken, when all members in result are already processed and current team hasn't got any members + // prevent crash if db records are broken, when all members in result are already processed and current team hasn't got any members if (!fields) break; uint32 arenaTeamId = fields[0].GetUInt32(); if (arenaTeamId < m_TeamId) { - //there is in table arena_team_member record which doesn't have arenateamid in arena_team table, report error + // there is in table arena_team_member record which doesn't have arenateamid in arena_team table, report error sLog.outErrorDb("ArenaTeam %u does not exist but it has record in arena_team_member table, deleting it!", arenaTeamId); CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u'", arenaTeamId); continue; } if (arenaTeamId > m_TeamId) - //we loaded all members for this arena_team already, break cycle + // we loaded all members for this arena_team already, break cycle break; ArenaTeamMember newmember; @@ -256,7 +256,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult* arenaTeamMembersResult) newmember.name = fields[7].GetCppString(); newmember.Class = fields[8].GetUInt8(); - //check if member exists in characters table + // check if member exists in characters table if (newmember.name.empty()) { sLog.outErrorDb("ArenaTeam %u has member with empty name - probably player %s doesn't exist, deleting him from memberlist!", arenaTeamId, newmember.guid.GetString().c_str()); @@ -735,7 +735,7 @@ void ArenaTeam::UpdateArenaPointsHelper(std::map& PlayerPoints) std::map::iterator plr_itr = PlayerPoints.find(itr->guid.GetCounter()); if (plr_itr != PlayerPoints.end()) { - //check if there is already more points + // check if there is already more points if (plr_itr->second < points_to_add) PlayerPoints[itr->guid.GetCounter()] = points_to_add; } @@ -759,8 +759,8 @@ void ArenaTeam::SaveToDB() void ArenaTeam::FinishWeek() { - m_stats.games_week = 0; // played this week - m_stats.wins_week = 0; // wins this week + m_stats.games_week = 0; // played this week + m_stats.wins_week = 0; // wins this week for (MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr) { itr->games_week = 0; diff --git a/src/game/ArenaTeamHandler.cpp b/src/game/ArenaTeamHandler.cpp index 9f822bc06..eab3891df 100644 --- a/src/game/ArenaTeamHandler.cpp +++ b/src/game/ArenaTeamHandler.cpp @@ -299,7 +299,7 @@ void WorldSession::HandleArenaTeamLeaderOpcode(WorldPacket& recv_data) recv_data >> name; ArenaTeam* at = sObjectMgr.GetArenaTeamById(ArenaTeamId); - if (!at) // arena team not found + if (!at) // arena team not found return; if (at->GetCaptainGuid() != _player->GetObjectGuid()) diff --git a/src/game/AuctionHouseBot/AuctionHouseBot.cpp b/src/game/AuctionHouseBot/AuctionHouseBot.cpp index 0f87e56f6..603d37151 100644 --- a/src/game/AuctionHouseBot/AuctionHouseBot.cpp +++ b/src/game/AuctionHouseBot/AuctionHouseBot.cpp @@ -294,10 +294,10 @@ void AuctionBotConfig::setConfig(AuctionBotConfigBoolValues index, char const* f setConfig(index, m_AhBotCfg.GetBoolDefault(fieldname, defvalue)); } -//Get AuctionHousebot configuration file +// Get AuctionHousebot configuration file void AuctionBotConfig::GetConfigFromFile() { - //Check config file version + // Check config file version if (m_AhBotCfg.GetIntDefault("ConfVersion", 0) != AUCTIONHOUSEBOT_CONF_VERSION) sLog.outError("AHBot: Configuration file version doesn't match expected version. Some config variables may be wrong or missing."); @@ -476,7 +476,7 @@ bool AuctionBotBuyer::Initialize() if (!active_house) return false; - //load Check interval + // load Check interval m_CheckInterval = sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_BUYER_RECHECK_INTERVAL) * MINUTE; DETAIL_FILTER_LOG(LOG_FILTER_AHBOT_BUYER, "AHBot buyer interval between 2 check = %u", m_CheckInterval); sLog.SetLogFilter(LOG_FILTER_AHBOT_BUYER, !sAuctionBotConfig.getConfig(CONFIG_BOOL_AHBOT_DEBUG_BUYER)); @@ -1387,7 +1387,7 @@ void AuctionBotSeller::LoadSellerValues(AHB_Seller_Config& config) config.SetPriceRatioPerQuality(AUCTION_QUALITY_ORANGE, PriceRatio); config.SetPriceRatioPerQuality(AUCTION_QUALITY_YELLOW, PriceRatio); - //load min and max auction times + // load min and max auction times config.SetMinTime(sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_MINTIME)); config.SetMaxTime(sAuctionBotConfig.getConfig(CONFIG_UINT32_AHBOT_MAXTIME)); diff --git a/src/game/AuctionHouseHandler.cpp b/src/game/AuctionHouseHandler.cpp index dcdb6ffb5..5edd9432a 100644 --- a/src/game/AuctionHouseHandler.cpp +++ b/src/game/AuctionHouseHandler.cpp @@ -461,7 +461,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket& recv_data) uint32 auctionId; recv_data >> auctioneerGuid; recv_data >> auctionId; - //DEBUG_LOG("Cancel AUCTION AuctionID: %u", auctionId); + // DEBUG_LOG("Cancel AUCTION AuctionID: %u", auctionId); AuctionHouseEntry const* auctionHouseEntry = GetCheckedAuctionHouseForAuctioneer(auctioneerGuid); if (!auctionHouseEntry) @@ -672,7 +672,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket& recv_data) if (GetPlayer()->hasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); - //DEBUG_LOG("Auctionhouse search %s list from: %u, searchedname: %s, levelmin: %u, levelmax: %u, auctionSlotID: %u, auctionMainCategory: %u, auctionSubCategory: %u, quality: %u, usable: %u", + // DEBUG_LOG("Auctionhouse search %s list from: %u, searchedname: %s, levelmin: %u, levelmax: %u, auctionSlotID: %u, auctionMainCategory: %u, auctionSubCategory: %u, quality: %u, usable: %u", // auctioneerGuid.GetString().c_str(), listfrom, searchedname.c_str(), levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable); WorldPacket data(SMSG_AUCTION_LIST_RESULT, (4 + 4 + 4)); diff --git a/src/game/AuctionHouseMgr.cpp b/src/game/AuctionHouseMgr.cpp index bf9661ff9..3af8f1f99 100644 --- a/src/game/AuctionHouseMgr.cpp +++ b/src/game/AuctionHouseMgr.cpp @@ -418,7 +418,7 @@ void AuctionHouseMgr::LoadAuctions() auction->itemCount = pItem->GetCount(); auction->itemRandomPropertyId = pItem->GetItemRandomPropertyId(); - //No SQL injection (no strings) + // No SQL injection (no strings) CharacterDatabase.PExecute("UPDATE auction SET item_template = %u, item_count = %u, item_randompropertyid = %i WHERE itemguid = %u", auction->itemTemplate, auction->itemCount, auction->itemRandomPropertyId, auction->itemGuidLow); } @@ -443,7 +443,7 @@ void AuctionHouseMgr::LoadAuctions() auction->itemGuidLow = 0; // item will deleted or added to received mail list - MailDraft(msgAuctionCanceledOwner.str(), "") // TODO: fix body + MailDraft(msgAuctionCanceledOwner.str(), "")// TODO: fix body .AddItem(pItem) .SendMailTo(MailReceiver(ObjectGuid(HIGHGUID_PLAYER, auction->owner)), auction, MAIL_CHECK_MASK_COPIED); } @@ -971,13 +971,13 @@ uint32 AuctionEntry::GetAuctionOutBid() const void AuctionEntry::DeleteFromDB() const { - //No SQL injection (Id is integer) + // No SQL injection (Id is integer) CharacterDatabase.PExecute("DELETE FROM auction WHERE id = '%u'", Id); } void AuctionEntry::SaveToDB() const { - //No SQL injection (no strings) + // No SQL injection (no strings) CharacterDatabase.PExecute("INSERT INTO auction (id,houseid,itemguid,item_template,item_count,item_randompropertyid,itemowner,buyoutprice,time,moneyTime,buyguid,lastbid,startbid,deposit) " "VALUES ('%u', '%u', '%u', '%u', '%u', '%i', '%u', '%u', '" UI64FMTD "', '" UI64FMTD "', '%u', '%u', '%u', '%u')", Id, auctionHouseEntry->houseId, itemGuidLow, itemTemplate, itemCount, itemRandomPropertyId, owner, buyout, (uint64)expireTime, (uint64)moneyDeliveryTime, bidder, bid, startbid, deposit); diff --git a/src/game/AuctionHouseMgr.h b/src/game/AuctionHouseMgr.h index 771a7ec29..fd4b7b51a 100644 --- a/src/game/AuctionHouseMgr.h +++ b/src/game/AuctionHouseMgr.h @@ -87,7 +87,7 @@ struct AuctionEntry bool UpdateBid(uint32 newbid, Player* newbidder = NULL);// true if normal bid, false if buyout, bidder==NULL for generated bid }; -//this class is used as auctionhouse instance +// this class is used as auctionhouse instance class AuctionHouseObject { public: @@ -176,7 +176,7 @@ class AuctionHouseMgr return NULL; } - //auction messages + // auction messages void SendAuctionWonMail(AuctionEntry* auction); void SendAuctionSuccessfulMail(AuctionEntry* auction); void SendAuctionExpiredMail(AuctionEntry* auction); @@ -186,7 +186,7 @@ class AuctionHouseMgr static AuctionHouseEntry const* GetAuctionHouseEntry(Unit* unit); public: - //load first auction items, because of check if item exists, when loading + // load first auction items, because of check if item exists, when loading void LoadAuctionItems(); void LoadAuctions(); diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp index da1d12032..bd5afa3c4 100644 --- a/src/game/BattleGround.cpp +++ b/src/game/BattleGround.cpp @@ -109,7 +109,7 @@ namespace MaNGOS private: void do_helper(WorldPacket& data, char const* text) { - //copyied from BuildMonsterChat + // copyied from BuildMonsterChat data << uint8(CHAT_MSG_MONSTER_YELL); data << uint32(i_language); data << ObjectGuid(i_source->GetObjectGuid()); @@ -119,7 +119,7 @@ namespace MaNGOS data << ObjectGuid(); // Unit Target - isn't important for bgs data << uint32(strlen(text) + 1); data << text; - data << uint8(0); // ChatTag - for bgs allways 0? + data << uint8(0); // ChatTag - for bgs allways 0? } uint32 i_language; @@ -176,7 +176,7 @@ namespace MaNGOS char str [2048]; snprintf(str, 2048, text, arg1str, arg2str); - //copyied from BuildMonsterChat + // copyied from BuildMonsterChat data << uint8(CHAT_MSG_MONSTER_YELL); data << uint32(i_language); data << ObjectGuid(i_source->GetObjectGuid()); @@ -269,7 +269,7 @@ BattleGround::BattleGround() m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_1M; m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_30S; m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; - //we must set to some default existing values + // we must set to some default existing values m_StartMessageIds[BG_STARTING_EVENT_FIRST] = 0; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE; @@ -334,7 +334,7 @@ void BattleGround::Update(uint32 diff) { RemovePlayerAtLeave(itr->first, true, true);// remove player from BG m_OfflineQueue.pop_front(); // remove from offline queue - //do not use itr for anything, because it is erased in RemovePlayerAtLeave() + // do not use itr for anything, because it is erased in RemovePlayerAtLeave() } } } @@ -374,7 +374,7 @@ void BattleGround::Update(uint32 diff) } else { - //announce every 15 seconds + // announce every 15 seconds if (newtime / (15 * IN_MILLISECONDS) != m_PrematureCountDownTimer / (15 * IN_MILLISECONDS)) PSendMessageToAll(LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS, CHAT_MSG_SYSTEM, NULL, (uint32)(m_PrematureCountDownTimer / IN_MILLISECONDS)); } @@ -419,7 +419,7 @@ void BattleGround::Update(uint32 diff) StartingEventCloseDoors(); SetStartDelayTime(m_StartDelayTimes[BG_STARTING_EVENT_FIRST]); - //first start warning - 2 or 1 minute, only if defined + // first start warning - 2 or 1 minute, only if defined if (m_StartMessageIds[BG_STARTING_EVENT_FIRST]) SendMessageToAll(m_StartMessageIds[BG_STARTING_EVENT_FIRST], CHAT_MSG_BG_SYSTEM_NEUTRAL); } @@ -465,7 +465,7 @@ void BattleGround::Update(uint32 diff) for (BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) if (Player* plr = sObjectMgr.GetPlayer(itr->first)) plr->RemoveAurasDueToSpell(SPELL_PREPARATION); - //Announce BG starting + // Announce BG starting if (sWorld.getConfig(CONFIG_BOOL_BATTLEGROUND_QUEUE_ANNOUNCER_START)) { sWorld.SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel()); @@ -490,14 +490,14 @@ void BattleGround::Update(uint32 diff) { next = itr; ++next; - //itr is erased here! + // itr is erased here! RemovePlayerAtLeave(itr->first, true, true);// remove player from BG // do not change any battleground's private variables } } } - //update start time + // update start time m_StartTime += diff; } @@ -698,7 +698,7 @@ void BattleGround::EndBattleGround(Team winner) SetWinner(winner); SetStatus(STATUS_WAIT_LEAVE); - //we must set it this way, because end time is sent in packet! + // we must set it this way, because end time is sent in packet! m_EndTime = TIME_TO_AUTOREMOVE; // arena rating calculation @@ -729,7 +729,7 @@ void BattleGround::EndBattleGround(Team winner) if (itr->second.OfflineRemoveTime) { - //if rated arena match - make member lost! + // if rated arena match - make member lost! if (isArena() && isRated() && winner_arena_team && loser_arena_team) { if (team == winner) @@ -758,13 +758,13 @@ void BattleGround::EndBattleGround(Team winner) } else { - //needed cause else in av some creatures will kill the players at the end + // needed cause else in av some creatures will kill the players at the end plr->CombatStop(); plr->getHostileRefManager().deleteReferences(); } - //this line is obsolete - team is set ALWAYS - //if(!team) team = plr->GetTeam(); + // this line is obsolete - team is set ALWAYS + // if(!team) team = plr->GetTeam(); // per player calculation if (isArena() && isRated() && winner_arena_team && loser_arena_team) @@ -818,8 +818,8 @@ void BattleGround::EndBattleGround(Team winner) if (isArena() && isRated() && winner_arena_team && loser_arena_team) { // update arena points only after increasing the player's match count! - //obsolete: winner_arena_team->UpdateArenaPointsHelper(); - //obsolete: loser_arena_team->UpdateArenaPointsHelper(); + // obsolete: winner_arena_team->UpdateArenaPointsHelper(); + // obsolete: loser_arena_team->UpdateArenaPointsHelper(); // save the stat changes winner_arena_team->SaveToDB(); loser_arena_team->SaveToDB(); @@ -835,7 +835,7 @@ void BattleGround::EndBattleGround(Team winner) uint32 BattleGround::GetBonusHonorFromKill(uint32 kills) const { - //variable kills means how many honorable kills you scored (so we need kills * honor_for_one_kill) + // variable kills means how many honorable kills you scored (so we need kills * honor_for_one_kill) return (uint32)MaNGOS::Honor::hk_honor_at_level(GetMaxLevel(), kills); } @@ -1046,7 +1046,7 @@ void BattleGround::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool Sen if (isRated() && GetStatus() == STATUS_IN_PROGRESS) { - //left a rated match while the encounter was in progress, consider as loser + // left a rated match while the encounter was in progress, consider as loser ArenaTeam* winner_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team))); ArenaTeam* loser_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(team)); if (winner_arena_team && loser_arena_team) @@ -1068,7 +1068,7 @@ void BattleGround::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool Sen { if (isRated() && GetStatus() == STATUS_IN_PROGRESS) { - //left a rated match while the encounter was in progress, consider as loser + // left a rated match while the encounter was in progress, consider as loser ArenaTeam* others_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(team))); ArenaTeam* players_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(team)); if (others_arena_team && players_arena_team) @@ -1086,7 +1086,7 @@ void BattleGround::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool Sen } } DecreaseInvitedCount(team); - //we should update battleground queue, but only if bg isn't ending + // we should update battleground queue, but only if bg isn't ending if (isBattleGround() && GetStatus() < STATUS_WAIT_LEAVE) { // a player has left the battleground, so there are free slots -> add to queue @@ -1113,7 +1113,7 @@ void BattleGround::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool Sen DETAIL_LOG("BATTLEGROUND: Removed player %s from BattleGround.", plr->GetName()); } - //battleground object will be deleted next BattleGround::Update() call + // battleground object will be deleted next BattleGround::Update() call } // this method is called when no players remains in battleground @@ -1334,7 +1334,7 @@ void BattleGround::RemoveFromBGFreeSlotQueue() // returns the number how many players can join battleground to MaxPlayersPerTeam uint32 BattleGround::GetFreeSlotsForTeam(Team team) const { - //return free slot count to MaxPlayerPerTeam + // return free slot count to MaxPlayerPerTeam if (GetStatus() == STATUS_WAIT_JOIN || GetStatus() == STATUS_IN_PROGRESS) return (GetInvitedCount(team) < GetMaxPlayersPerTeam()) ? GetMaxPlayersPerTeam() - GetInvitedCount(team) : 0; @@ -1348,7 +1348,7 @@ bool BattleGround::HasFreeSlots() const void BattleGround::UpdatePlayerScore(Player* Source, uint32 type, uint32 value) { - //this procedure is called from virtual function implemented in bg subclass + // this procedure is called from virtual function implemented in bg subclass BattleGroundScoreMap::const_iterator itr = m_PlayerScores.find(Source->GetObjectGuid()); if (itr == m_PlayerScores.end()) // player not found... @@ -1374,7 +1374,7 @@ void BattleGround::UpdatePlayerScore(Player* Source, uint32 type, uint32 value) itr->second->BonusHonor += value; } break; - //used only in EY, but in MSG_PVP_LOG_DATA opcode + // used only in EY, but in MSG_PVP_LOG_DATA opcode case SCORE_DAMAGE_DONE: // Damage Done itr->second->DamageDone += value; break; @@ -1429,17 +1429,17 @@ bool BattleGround::AddObject(uint32 type, uint32 entry, float x, float y, float return true; } -//some doors aren't despawned so we cannot handle their closing in gameobject::update() -//it would be nice to correctly implement GO_ACTIVATED state and open/close doors in gameobject code +// some doors aren't despawned so we cannot handle their closing in gameobject::update() +// it would be nice to correctly implement GO_ACTIVATED state and open/close doors in gameobject code void BattleGround::DoorClose(ObjectGuid guid) { GameObject* obj = GetBgMap()->GetGameObject(guid); if (obj) { - //if doors are open, close it + // if doors are open, close it if (obj->getLootState() == GO_ACTIVATED && obj->GetGoState() != GO_STATE_READY) { - //change state to allow door to be closed + // change state to allow door to be closed obj->SetLootState(GO_READY); obj->UseDoorOrButton(RESPAWN_ONE_DAY); } @@ -1453,7 +1453,7 @@ void BattleGround::DoorOpen(ObjectGuid guid) GameObject* obj = GetBgMap()->GetGameObject(guid); if (obj) { - //change state to be sure they will be opened + // change state to be sure they will be opened obj->SetLootState(GO_READY); obj->UseDoorOrButton(RESPAWN_ONE_DAY); } @@ -1562,7 +1562,7 @@ void BattleGround::SpawnBGObject(ObjectGuid guid, uint32 respawntime) return; if (respawntime == 0) { - //we need to change state from GO_JUST_DEACTIVATED to GO_READY in case battleground is starting again + // we need to change state from GO_JUST_DEACTIVATED to GO_READY in case battleground is starting again if (obj->getLootState() == GO_JUST_DEACTIVATED) obj->SetLootState(GO_READY); obj->SetRespawnTime(0); @@ -1699,14 +1699,14 @@ void BattleGround::HandleTriggerBuff(ObjectGuid go_guid) return; } - //randomly select new buff + // randomly select new buff uint8 buff = urand(0, 2); uint32 entry = obj->GetEntry(); if (m_BuffChange && entry != Buff_Entries[buff]) { - //despawn current buff + // despawn current buff SpawnBGObject(m_BgObjects[index], RESPAWN_ONE_DAY); - //set index for new one + // set index for new one for (uint8 currBuffTypeIndex = 0; currBuffTypeIndex < 3; ++currBuffTypeIndex) { if (entry == Buff_Entries[currBuffTypeIndex]) diff --git a/src/game/BattleGround.h b/src/game/BattleGround.h index f33746ec9..b6778fca8 100644 --- a/src/game/BattleGround.h +++ b/src/game/BattleGround.h @@ -178,16 +178,16 @@ enum ScoreType SCORE_DEATHS = 2, SCORE_HONORABLE_KILLS = 3, SCORE_BONUS_HONOR = 4, - //EY, but in MSG_PVP_LOG_DATA opcode! + // EY, but in MSG_PVP_LOG_DATA opcode! SCORE_DAMAGE_DONE = 5, SCORE_HEALING_DONE = 6, - //WS + // WS SCORE_FLAG_CAPTURES = 7, SCORE_FLAG_RETURNS = 8, - //AB + // AB SCORE_BASES_ASSAULTED = 9, SCORE_BASES_DEFENDED = 10, - //AV + // AV SCORE_GRAVEYARDS_ASSAULTED = 11, SCORE_GRAVEYARDS_DEFENDED = 12, SCORE_TOWERS_ASSAULTED = 13, @@ -254,7 +254,7 @@ class BattleGroundScore BattleGroundScore() : KillingBlows(0), Deaths(0), HonorableKills(0), BonusHonor(0), DamageDone(0), HealingDone(0) {} - virtual ~BattleGroundScore() {} //virtual destructor is used when deleting score from scores map + virtual ~BattleGroundScore() {} // virtual destructor is used when deleting score from scores map uint32 KillingBlows; uint32 Deaths; @@ -323,7 +323,7 @@ class BattleGround // Set methods: void SetName(char const* Name) { m_Name = Name; } void SetTypeID(BattleGroundTypeId TypeID) { m_TypeID = TypeID; } - //here we can count minlevel and maxlevel for players + // here we can count minlevel and maxlevel for players void SetBracket(PvPDifficultyEntry const* bracketEntry); void SetStatus(BattleGroundStatus Status) { m_Status = Status; } void SetClientInstanceID(uint32 InstanceID) { m_ClientInstanceID = InstanceID; } @@ -343,8 +343,8 @@ class BattleGround void SetMaxPlayersPerTeam(uint32 MaxPlayers) { m_MaxPlayersPerTeam = MaxPlayers; } void SetMinPlayersPerTeam(uint32 MinPlayers) { m_MinPlayersPerTeam = MinPlayers; } - void AddToBGFreeSlotQueue(); //this queue will be useful when more battlegrounds instances will be available - void RemoveFromBGFreeSlotQueue(); //this method could delete whole BG instance, if another free is available + void AddToBGFreeSlotQueue(); // this queue will be useful when more battlegrounds instances will be available + void RemoveFromBGFreeSlotQueue(); // this method could delete whole BG instance, if another free is available void DecreaseInvitedCount(Team team) { (team == ALLIANCE) ? --m_InvitedAlliance : --m_InvitedHorde; } void IncreaseInvitedCount(Team team) { (team == ALLIANCE) ? ++m_InvitedAlliance : ++m_InvitedHorde; } @@ -535,7 +535,7 @@ class BattleGround protected: - //this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends BattleGround + // this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends BattleGround void EndNow(); void PlayerAddedToBGCheckIfBGIsRunning(Player* plr); @@ -553,7 +553,7 @@ class BattleGround */ uint8 m_Events; BattleGroundStartTimeIntervals m_StartDelayTimes[BG_STARTING_EVENT_COUNT]; - //this must be filled in constructors! + // this must be filled in constructors! uint32 m_StartMessageIds[BG_STARTING_EVENT_COUNT]; bool m_BuffChange; @@ -562,7 +562,7 @@ class BattleGround /* Battleground */ BattleGroundTypeId m_TypeID; BattleGroundStatus m_Status; - uint32 m_ClientInstanceID; //the instance-id which is sent to the client and without any other internal use + uint32 m_ClientInstanceID; // the instance-id which is sent to the client and without any other internal use uint32 m_StartTime; bool m_ArenaBuffSpawned; // to cache if arenabuff event is started (cause bool is faster than checking IsActiveEvent) int32 m_EndTime; // it is set to 120000 when bg is ending and it decreases itself @@ -588,7 +588,7 @@ class BattleGround uint32 m_InvitedHorde; /* Raid Group */ - Group* m_BgRaids[BG_TEAMS_COUNT]; // 0 - alliance, 1 - horde + Group* m_BgRaids[BG_TEAMS_COUNT]; // 0 - alliance, 1 - horde /* Players count by team */ uint32 m_PlayersCount[BG_TEAMS_COUNT]; diff --git a/src/game/BattleGroundAA.cpp b/src/game/BattleGroundAA.cpp index 2b33ab44d..a00039fa7 100644 --- a/src/game/BattleGroundAA.cpp +++ b/src/game/BattleGroundAA.cpp @@ -28,7 +28,7 @@ BattleGroundAA::BattleGroundAA() m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S; m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; - //we must set messageIds + // we must set messageIds m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS; @@ -56,7 +56,7 @@ void BattleGroundAA::StartingEventOpenDoors() void BattleGroundAA::AddPlayer(Player* plr) { BattleGround::AddPlayer(plr); - //create score and add it to map, default values are set in constructor + // create score and add it to map, default values are set in constructor BattleGroundAAScore* sc = new BattleGroundAAScore; m_PlayerScores[plr->GetObjectGuid()] = sc; diff --git a/src/game/BattleGroundAA.h b/src/game/BattleGroundAA.h index 60b3ef524..0627f0332 100644 --- a/src/game/BattleGroundAA.h +++ b/src/game/BattleGroundAA.h @@ -25,7 +25,7 @@ class BattleGroundAAScore : public BattleGroundScore public: BattleGroundAAScore() {}; virtual ~BattleGroundAAScore() {}; - //TODO fix me + // TODO fix me }; class BattleGroundAA : public BattleGround diff --git a/src/game/BattleGroundAB.cpp b/src/game/BattleGroundAB.cpp index d73332759..c107e1499 100644 --- a/src/game/BattleGroundAB.cpp +++ b/src/game/BattleGroundAB.cpp @@ -170,7 +170,7 @@ void BattleGroundAB::StartingEventOpenDoors() { for (uint8 i = 0; i < BG_AB_NODES_MAX; ++i) { - //randomly select buff to spawn + // randomly select buff to spawn uint8 buff = urand(0, 2); SpawnBGObject(m_BgObjects[BG_AB_OBJECT_SPEEDBUFF_STABLES + buff + i * 3], RESPAWN_IMMEDIATELY); } @@ -183,7 +183,7 @@ void BattleGroundAB::StartingEventOpenDoors() void BattleGroundAB::AddPlayer(Player* plr) { BattleGround::AddPlayer(plr); - //create score and add it to map, default values are set in the constructor + // create score and add it to map, default values are set in the constructor BattleGroundABScore* sc = new BattleGroundABScore; m_PlayerScores[plr->GetObjectGuid()] = sc; @@ -217,10 +217,10 @@ void BattleGroundAB::HandleAreaTrigger(Player* source, uint32 trigger) case 3870: // Black Smith case 4020: // Unk1 case 4021: // Unk2 - //break; + // break; default: - //sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", trigger); - //source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", trigger); + // sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", trigger); + // source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", trigger); break; } } @@ -443,7 +443,7 @@ void BattleGroundAB::EventPlayerClickedOnFlag(Player* source, GameObject* target bool BattleGroundAB::SetupBattleGround() { - //buffs + // buffs for (uint8 i = 0; i < BG_AB_NODES_MAX; ++i) { if (!AddObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + 3 * i, Buff_Entries[0], BG_AB_BuffPositions[i][0], BG_AB_BuffPositions[i][1], BG_AB_BuffPositions[i][2], BG_AB_BuffPositions[i][3], 0, 0, sin(BG_AB_BuffPositions[i][3] / 2), cos(BG_AB_BuffPositions[i][3] / 2), RESPAWN_ONE_DAY) @@ -458,7 +458,7 @@ bool BattleGroundAB::SetupBattleGround() void BattleGroundAB::Reset() { - //call parent's class reset + // call parent's class reset BattleGround::Reset(); for (uint8 i = 0; i < BG_TEAMS_COUNT; ++i) @@ -490,12 +490,12 @@ void BattleGroundAB::Reset() void BattleGroundAB::EndBattleGround(Team winner) { - //win reward + // win reward if (winner == ALLIANCE) RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE); if (winner == HORDE) RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE); - //complete map_end rewards (even if no team wins) + // complete map_end rewards (even if no team wins) RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE); RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE); @@ -544,7 +544,7 @@ WorldSafeLocsEntry const* BattleGroundAB::GetClosestGraveYard(Player* player) void BattleGroundAB::UpdatePlayerScore(Player* source, uint32 type, uint32 value) { BattleGroundScoreMap::iterator itr = m_PlayerScores.find(source->GetObjectGuid()); - if (itr == m_PlayerScores.end()) // player not found... + if (itr == m_PlayerScores.end()) // player not found... return; switch (type) diff --git a/src/game/BattleGroundAB.h b/src/game/BattleGroundAB.h index 60016074c..1bbed9bda 100644 --- a/src/game/BattleGroundAB.h +++ b/src/game/BattleGroundAB.h @@ -30,32 +30,32 @@ enum BG_AB_WorldStates BG_AB_OP_RESOURCES_MAX = 1780, BG_AB_OP_RESOURCES_WARNING = 1955 /* - BG_AB_OP_STABLE_ICON = 1842, //Stable map icon (NONE) - BG_AB_OP_STABLE_STATE_ALIENCE = 1767, //Stable map state (ALIENCE) - BG_AB_OP_STABLE_STATE_HORDE = 1768, //Stable map state (HORDE) - BG_AB_OP_STABLE_STATE_CON_ALI = 1769, //Stable map state (CON ALIENCE) - BG_AB_OP_STABLE_STATE_CON_HOR = 1770, //Stable map state (CON HORDE) - BG_AB_OP_FARM_ICON = 1845, //Farm map icon (NONE) - BG_AB_OP_FARM_STATE_ALIENCE = 1772, //Farm state (ALIENCE) - BG_AB_OP_FARM_STATE_HORDE = 1773, //Farm state (HORDE) - BG_AB_OP_FARM_STATE_CON_ALI = 1774, //Farm state (CON ALIENCE) - BG_AB_OP_FARM_STATE_CON_HOR = 1775, //Farm state (CON HORDE) + BG_AB_OP_STABLE_ICON = 1842, // Stable map icon (NONE) + BG_AB_OP_STABLE_STATE_ALIENCE = 1767, // Stable map state (ALIENCE) + BG_AB_OP_STABLE_STATE_HORDE = 1768, // Stable map state (HORDE) + BG_AB_OP_STABLE_STATE_CON_ALI = 1769, // Stable map state (CON ALIENCE) + BG_AB_OP_STABLE_STATE_CON_HOR = 1770, // Stable map state (CON HORDE) + BG_AB_OP_FARM_ICON = 1845, // Farm map icon (NONE) + BG_AB_OP_FARM_STATE_ALIENCE = 1772, // Farm state (ALIENCE) + BG_AB_OP_FARM_STATE_HORDE = 1773, // Farm state (HORDE) + BG_AB_OP_FARM_STATE_CON_ALI = 1774, // Farm state (CON ALIENCE) + BG_AB_OP_FARM_STATE_CON_HOR = 1775, // Farm state (CON HORDE) - BG_AB_OP_BLACKSMITH_ICON = 1846, //Blacksmith map icon (NONE) - BG_AB_OP_BLACKSMITH_STATE_ALIENCE = 1782, //Blacksmith map state (ALIENCE) - BG_AB_OP_BLACKSMITH_STATE_HORDE = 1783, //Blacksmith map state (HORDE) - BG_AB_OP_BLACKSMITH_STATE_CON_ALI = 1784, //Blacksmith map state (CON ALIENCE) - BG_AB_OP_BLACKSMITH_STATE_CON_HOR = 1785, //Blacksmith map state (CON HORDE) - BG_AB_OP_LUMBERMILL_ICON = 1844, //Lumber Mill map icon (NONE) - BG_AB_OP_LUMBERMILL_STATE_ALIENCE = 1792, //Lumber Mill map state (ALIENCE) - BG_AB_OP_LUMBERMILL_STATE_HORDE = 1793, //Lumber Mill map state (HORDE) - BG_AB_OP_LUMBERMILL_STATE_CON_ALI = 1794, //Lumber Mill map state (CON ALIENCE) - BG_AB_OP_LUMBERMILL_STATE_CON_HOR = 1795, //Lumber Mill map state (CON HORDE) - BG_AB_OP_GOLDMINE_ICON = 1843, //Gold Mine map icon (NONE) - BG_AB_OP_GOLDMINE_STATE_ALIENCE = 1787, //Gold Mine map state (ALIENCE) - BG_AB_OP_GOLDMINE_STATE_HORDE = 1788, //Gold Mine map state (HORDE) - BG_AB_OP_GOLDMINE_STATE_CON_ALI = 1789, //Gold Mine map state (CON ALIENCE - BG_AB_OP_GOLDMINE_STATE_CON_HOR = 1790, //Gold Mine map state (CON HORDE) + BG_AB_OP_BLACKSMITH_ICON = 1846, // Blacksmith map icon (NONE) + BG_AB_OP_BLACKSMITH_STATE_ALIENCE = 1782, // Blacksmith map state (ALIENCE) + BG_AB_OP_BLACKSMITH_STATE_HORDE = 1783, // Blacksmith map state (HORDE) + BG_AB_OP_BLACKSMITH_STATE_CON_ALI = 1784, // Blacksmith map state (CON ALIENCE) + BG_AB_OP_BLACKSMITH_STATE_CON_HOR = 1785, // Blacksmith map state (CON HORDE) + BG_AB_OP_LUMBERMILL_ICON = 1844, // Lumber Mill map icon (NONE) + BG_AB_OP_LUMBERMILL_STATE_ALIENCE = 1792, // Lumber Mill map state (ALIENCE) + BG_AB_OP_LUMBERMILL_STATE_HORDE = 1793, // Lumber Mill map state (HORDE) + BG_AB_OP_LUMBERMILL_STATE_CON_ALI = 1794, // Lumber Mill map state (CON ALIENCE) + BG_AB_OP_LUMBERMILL_STATE_CON_HOR = 1795, // Lumber Mill map state (CON HORDE) + BG_AB_OP_GOLDMINE_ICON = 1843, // Gold Mine map icon (NONE) + BG_AB_OP_GOLDMINE_STATE_ALIENCE = 1787, // Gold Mine map state (ALIENCE) + BG_AB_OP_GOLDMINE_STATE_HORDE = 1788, // Gold Mine map state (HORDE) + BG_AB_OP_GOLDMINE_STATE_CON_ALI = 1789, // Gold Mine map state (CON ALIENCE + BG_AB_OP_GOLDMINE_STATE_CON_HOR = 1790, // Gold Mine map state (CON HORDE) */ }; @@ -66,7 +66,7 @@ const uint32 BG_AB_OP_NODEICONS[5] = {1842, 1846, 1845, 1844, 1843}; enum BG_AB_ObjectType { // TODO drop them (pool-system should be used for this) - //buffs + // buffs BG_AB_OBJECT_SPEEDBUFF_STABLES = 1, BG_AB_OBJECT_REGENBUFF_STABLES = 2, BG_AB_OBJECT_BERSERKBUFF_STABLES = 3, diff --git a/src/game/BattleGroundAV.cpp b/src/game/BattleGroundAV.cpp index e90309767..ed4444c59 100644 --- a/src/game/BattleGroundAV.cpp +++ b/src/game/BattleGroundAV.cpp @@ -147,7 +147,7 @@ void BattleGroundAV::HandleQuestComplete(uint32 questid, Player* player) break; case BG_AV_QUEST_A_BOSS1: case BG_AV_QUEST_H_BOSS1: - m_Team_QuestStatus[teamIdx][4] += 4; // there are 2 quests where you can turn in 5 or 1 item.. ( + 4 cause +1 will be done some lines below) + m_Team_QuestStatus[teamIdx][4] += 4; // there are 2 quests where you can turn in 5 or 1 item.. ( + 4 cause +1 will be done some lines below) reputation = 4; case BG_AV_QUEST_A_BOSS2: case BG_AV_QUEST_H_BOSS2: @@ -382,7 +382,7 @@ void BattleGroundAV::HandleAreaTrigger(Player* source, uint32 trigger) case 3329: case 3330: case 3331: - //source->Unmount(); + // source->Unmount(); break; default: DEBUG_LOG("BattleGroundAV: WARNING: Unhandled AreaTrigger in Battleground: %u", trigger); @@ -591,7 +591,7 @@ void BattleGroundAV::EventPlayerAssaultsPoint(Player* player, BG_AV_Nodes node) if (m_Nodes[node].Owner == BattleGroundAVTeamIndex(teamIdx) || BattleGroundAVTeamIndex(teamIdx) == m_Nodes[node].TotalOwner) return; - AssaultNode(node, teamIdx); // update nodeinfo variables + AssaultNode(node, teamIdx); // update nodeinfo variables UpdateNodeWorldState(node); // send mapicon PopulateNode(node); diff --git a/src/game/BattleGroundBE.cpp b/src/game/BattleGroundBE.cpp index ec754a95b..d8c6e1f19 100644 --- a/src/game/BattleGroundBE.cpp +++ b/src/game/BattleGroundBE.cpp @@ -30,7 +30,7 @@ BattleGroundBE::BattleGroundBE() m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S; m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; - //we must set messageIds + // we must set messageIds m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS; @@ -63,7 +63,7 @@ void BattleGroundBE::StartingEventOpenDoors() void BattleGroundBE::AddPlayer(Player* plr) { BattleGround::AddPlayer(plr); - //create score and add it to map, default values are set in constructor + // create score and add it to map, default values are set in constructor BattleGroundBEScore* sc = new BattleGroundBEScore; m_PlayerScores[plr->GetObjectGuid()] = sc; @@ -114,15 +114,15 @@ void BattleGroundBE::HandleAreaTrigger(Player* source, uint32 trigger) if (GetStatus() != STATUS_IN_PROGRESS) return; - //uint32 spellId = 0; - //uint64 buff_guid = 0; + // uint32 spellId = 0; + // uint64 buff_guid = 0; switch (trigger) { case 4538: // buff trigger? - //buff_guid = m_BgObjects[BG_BE_OBJECT_BUFF_1]; + // buff_guid = m_BgObjects[BG_BE_OBJECT_BUFF_1]; break; case 4539: // buff trigger? - //buff_guid = m_BgObjects[BG_BE_OBJECT_BUFF_2]; + // buff_guid = m_BgObjects[BG_BE_OBJECT_BUFF_2]; break; default: sLog.outError("WARNING: Unhandled AreaTrigger in Battleground: %u", trigger); @@ -130,7 +130,7 @@ void BattleGroundBE::HandleAreaTrigger(Player* source, uint32 trigger) break; } - //if (buff_guid) + // if (buff_guid) // HandleTriggerBuff(buff_guid, source); } @@ -143,7 +143,7 @@ void BattleGroundBE::FillInitialWorldStates(WorldPacket& data, uint32& count) void BattleGroundBE::Reset() { - //call parent's class reset + // call parent's class reset BattleGround::Reset(); } @@ -159,7 +159,7 @@ void BattleGroundBE::UpdatePlayerScore(Player* source, uint32 type, uint32 value if (itr == m_PlayerScores.end()) // player not found... return; - //there is nothing special in this score + // there is nothing special in this score BattleGround::UpdatePlayerScore(source, type, value); } diff --git a/src/game/BattleGroundDS.cpp b/src/game/BattleGroundDS.cpp index 7fbc78f4e..a6c496c0a 100644 --- a/src/game/BattleGroundDS.cpp +++ b/src/game/BattleGroundDS.cpp @@ -28,7 +28,7 @@ BattleGroundDS::BattleGroundDS() m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S; m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; - //we must set messageIds + // we must set messageIds m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS; @@ -56,7 +56,7 @@ void BattleGroundDS::StartingEventOpenDoors() void BattleGroundDS::AddPlayer(Player* plr) { BattleGround::AddPlayer(plr); - //create score and add it to map, default values are set in constructor + // create score and add it to map, default values are set in constructor BattleGroundDSScore* sc = new BattleGroundDSScore; m_PlayerScores[plr->GetObjectGuid()] = sc; diff --git a/src/game/BattleGroundDS.h b/src/game/BattleGroundDS.h index 117280a93..498440a1d 100644 --- a/src/game/BattleGroundDS.h +++ b/src/game/BattleGroundDS.h @@ -25,7 +25,7 @@ class BattleGroundDSScore : public BattleGroundScore public: BattleGroundDSScore() {}; virtual ~BattleGroundDSScore() {}; - //TODO fix me + // TODO fix me }; class BattleGroundDS : public BattleGround diff --git a/src/game/BattleGroundEY.cpp b/src/game/BattleGroundEY.cpp index 8500a6182..9dd6ddf63 100644 --- a/src/game/BattleGroundEY.cpp +++ b/src/game/BattleGroundEY.cpp @@ -81,12 +81,12 @@ void BattleGroundEY::Update(uint32 diff) m_TowerCapCheckTimer -= diff; if (m_TowerCapCheckTimer <= 0) { - //check if player joined point + // check if player joined point /*I used this order of calls, because although we will check if one player is in gameobject's distance 2 times but we can count of players on current point in CheckSomeoneLeftPoint */ CheckSomeoneJoinedPoint(); - //check if player left point + // check if player left point CheckSomeoneLeftPoint(); UpdatePointStatuses(); m_TowerCapCheckTimer = BG_EY_FPOINTS_TICK_TIME; @@ -105,7 +105,7 @@ void BattleGroundEY::StartingEventOpenDoors() for (uint8 i = 0; i < BG_EY_NODES_MAX; ++i) { - //randomly spawn buff + // randomly spawn buff uint8 buff = urand(0, 2); SpawnBGObject(m_BgObjects[BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + buff + i * 3], RESPAWN_IMMEDIATELY); } @@ -144,14 +144,14 @@ void BattleGroundEY::CheckSomeoneJoinedPoint() if (plr->CanUseCapturePoint() && plr->IsWithinDist3d(BG_EY_NodePositions[i][0], BG_EY_NodePositions[i][1], BG_EY_NodePositions[i][2], BG_EY_POINT_RADIUS)) { - //player joined point! - //show progress bar + // player joined point! + // show progress bar UpdateWorldStateForPlayer(PROGRESS_BAR_PERCENT_GREY, BG_EY_PROGRESS_BAR_PERCENT_GREY, plr); UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[i], plr); UpdateWorldStateForPlayer(PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_SHOW, plr); - //add player to point + // add player to point m_PlayersNearPoint[i].push_back(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS][j]); - //remove player from "free space" + // remove player from "free space" m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].erase(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].begin() + j); } else @@ -162,7 +162,7 @@ void BattleGroundEY::CheckSomeoneJoinedPoint() void BattleGroundEY::CheckSomeoneLeftPoint() { - //reset current point counts + // reset current point counts for (uint8 i = 0; i < 2 * BG_EY_NODES_MAX; ++i) m_CurrentPointPlayersCount[i] = 0; for (uint8 i = 0; i < BG_EY_NODES_MAX; ++i) @@ -174,7 +174,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint() if (!plr) { sLog.outError("BattleGroundEY:CheckSomeoneLeftPoint %s not found!", m_PlayersNearPoint[i][j].GetString().c_str()); - //move nonexistent player to "free space" - this will cause many error showing in log, but it is a very important bug + // move nonexistent player to "free space" - this will cause many error showing in log, but it is a very important bug m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(m_PlayersNearPoint[i][j]); m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j); ++j; @@ -182,7 +182,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint() } if (!plr->CanUseCapturePoint() || !plr->IsWithinDist3d(BG_EY_NodePositions[i][0], BG_EY_NodePositions[i][1], BG_EY_NodePositions[i][2], BG_EY_POINT_RADIUS)) - //move player out of point (add him to players that are out of points + // move player out of point (add him to players that are out of points { m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(m_PlayersNearPoint[i][j]); m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j); @@ -190,7 +190,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint() } else { - //player is neat flag, so update count: + // player is neat flag, so update count: m_CurrentPointPlayersCount[2 * i + GetTeamIndexByTeamId(plr->GetTeam())]++; ++j; } @@ -204,18 +204,18 @@ void BattleGroundEY::UpdatePointStatuses() { if (m_PlayersNearPoint[point].empty()) continue; - //count new point bar status: + // count new point bar status: m_PointBarStatus[point] += (m_CurrentPointPlayersCount[2 * point] - m_CurrentPointPlayersCount[2 * point + 1] < BG_EY_POINT_MAX_CAPTURERS_COUNT) ? m_CurrentPointPlayersCount[2 * point] - m_CurrentPointPlayersCount[2 * point + 1] : BG_EY_POINT_MAX_CAPTURERS_COUNT; if (m_PointBarStatus[point] > BG_EY_PROGRESS_BAR_ALI_CONTROLLED) - //point is fully alliance's + // point is fully alliance's m_PointBarStatus[point] = BG_EY_PROGRESS_BAR_ALI_CONTROLLED; if (m_PointBarStatus[point] < BG_EY_PROGRESS_BAR_HORDE_CONTROLLED) - //point is fully horde's + // point is fully horde's m_PointBarStatus[point] = BG_EY_PROGRESS_BAR_HORDE_CONTROLLED; Team pointOwnerTeamId; - //find which team should own this point + // find which team should own this point if (m_PointBarStatus[point] <= BG_EY_PROGRESS_BAR_NEUTRAL_LOW) pointOwnerTeamId = HORDE; else if (m_PointBarStatus[point] >= BG_EY_PROGRESS_BAR_NEUTRAL_HIGH) @@ -228,14 +228,14 @@ void BattleGroundEY::UpdatePointStatuses() if (Player* plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[point][i])) { UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[point], plr); - //if point owner changed we must evoke event! + // if point owner changed we must evoke event! if (pointOwnerTeamId != m_PointOwnedByTeam[point]) { - //point was uncontrolled and player is from team which captured point + // point was uncontrolled and player is from team which captured point if (m_PointState[point] == EY_POINT_STATE_UNCONTROLLED && plr->GetTeam() == pointOwnerTeamId) EventTeamCapturedPoint(plr, point); - //point was under control and player isn't from team which controlled it + // point was under control and player isn't from team which controlled it if (m_PointState[point] == EY_POINT_UNDER_CONTROL && plr->GetTeam() != m_PointOwnedByTeam[point]) EventTeamLostPoint(plr, point); } @@ -262,12 +262,12 @@ void BattleGroundEY::UpdateTeamScore(Team team) void BattleGroundEY::EndBattleGround(Team winner) { - //win reward + // win reward if (winner == ALLIANCE) RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE); if (winner == HORDE) RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE); - //complete map reward + // complete map reward RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE); RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE); @@ -306,7 +306,7 @@ void BattleGroundEY::UpdatePointsIcons(Team team, uint32 point) void BattleGroundEY::AddPlayer(Player* plr) { BattleGround::AddPlayer(plr); - //create score and add it to map + // create score and add it to map BattleGroundEYScore* sc = new BattleGroundEYScore; m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(plr->GetObjectGuid()); @@ -343,7 +343,7 @@ void BattleGroundEY::HandleAreaTrigger(Player* source, uint32 trigger) if (GetStatus() != STATUS_IN_PROGRESS) return; - if (!source->isAlive()) //hack code, must be removed later + if (!source->isAlive()) // hack code, must be removed later return; switch (trigger) @@ -389,7 +389,7 @@ void BattleGroundEY::HandleAreaTrigger(Player* source, uint32 trigger) bool BattleGroundEY::SetupBattleGround() { - //buffs + // buffs for (uint8 i = 0; i < BG_EY_NODES_MAX; ++i) { AreaTriggerEntry const* at = sAreaTriggerStore.LookupEntry(m_Points_Trigger[i]); @@ -410,7 +410,7 @@ bool BattleGroundEY::SetupBattleGround() void BattleGroundEY::Reset() { - //call parent's class reset + // call parent's class reset BattleGround::Reset(); m_TeamScores[BG_TEAM_ALLIANCE] = 0; @@ -433,7 +433,7 @@ void BattleGroundEY::Reset() m_PointState[i] = EY_POINT_STATE_UNCONTROLLED; m_PointBarStatus[i] = BG_EY_PROGRESS_BAR_STATE_MIDDLE; m_PlayersNearPoint[i].clear(); - m_PlayersNearPoint[i].reserve(15); //tip size + m_PlayersNearPoint[i].reserve(15); // tip size m_ActiveEvents[i] = BG_EYE_NEUTRAL_TEAM; // neutral team owns every node } // the flag in the middle is spawned at beginning @@ -506,7 +506,7 @@ void BattleGroundEY::EventPlayerDroppedFlag(Player* source) m_FlagsTimer = BG_EY_FLAG_RESPAWN_TIME; source->CastSpell(source, SPELL_RECENTLY_DROPPED_FLAG, true); source->CastSpell(source, BG_EY_PLAYER_DROPPED_FLAG_SPELL, true); - //this does not work correctly :( (it should remove flag carrier name) + // this does not work correctly :( (it should remove flag carrier name) UpdateWorldState(NETHERSTORM_FLAG_STATE_HORDE, BG_EY_FLAG_STATE_WAIT_RESPAWN); UpdateWorldState(NETHERSTORM_FLAG_STATE_ALLIANCE, BG_EY_FLAG_STATE_WAIT_RESPAWN); @@ -540,7 +540,7 @@ void BattleGroundEY::EventPlayerClickedOnFlag(Player* source, GameObject* target SpawnEvent(BG_EY_EVENT_CAPTURE_FLAG, BG_EY_EVENT2_FLAG_CENTER, false); SetFlagPicker(source->GetObjectGuid()); - //get flag aura on player + // get flag aura on player source->CastSpell(source, BG_EY_NETHERSTORM_FLAG_SPELL, true); source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT); @@ -573,7 +573,7 @@ void BattleGroundEY::EventTeamLostPoint(Player* source, uint32 point) SpawnEvent(point, BG_EYE_NEUTRAL_TEAM, true); // will despawn alliance/horde - //buff isn't despawned + // buff isn't despawned if (team == ALLIANCE) SendMessageToAll(LoosingPointTypes[point].MessageIdAlliance, CHAT_MSG_BG_SYSTEM_ALLIANCE, source); @@ -594,7 +594,7 @@ void BattleGroundEY::EventTeamCapturedPoint(Player* source, uint32 point) ++m_TeamPointsCount[GetTeamIndexByTeamId(team)]; SpawnEvent(point, GetTeamIndexByTeamId(team), true); - //buff isn't respawned + // buff isn't respawned m_PointOwnedByTeam[point] = team; m_PointState[point] = EY_POINT_UNDER_CONTROL; diff --git a/src/game/BattleGroundEY.h b/src/game/BattleGroundEY.h index 9bf3b4057..876488e38 100644 --- a/src/game/BattleGroundEY.h +++ b/src/game/BattleGroundEY.h @@ -23,8 +23,8 @@ class BattleGround; -#define BG_EY_FLAG_RESPAWN_TIME (10*IN_MILLISECONDS) //10 seconds -#define BG_EY_FPOINTS_TICK_TIME (2*IN_MILLISECONDS) //2 seconds +#define BG_EY_FLAG_RESPAWN_TIME (10*IN_MILLISECONDS)//10 seconds +#define BG_EY_FPOINTS_TICK_TIME (2*IN_MILLISECONDS) //2 seconds enum BG_EY_WorldStates { @@ -48,7 +48,7 @@ enum BG_EY_WorldStates PROGRESS_BAR_STATUS = 2719, //50 init!, 48 ... hordak bere .. 33 .. 0 = full 100% hordacky , 100 = full alliance PROGRESS_BAR_SHOW = 2718, //1 init, 0 druhy send - bez messagu, 1 = controlled alliance NETHERSTORM_FLAG = 2757, - //set to 2 when flag is picked up, and to 1 if it is dropped + // set to 2 when flag is picked up, and to 1 if it is dropped NETHERSTORM_FLAG_STATE_ALLIANCE = 2769, NETHERSTORM_FLAG_STATE_HORDE = 2770 }; @@ -69,7 +69,7 @@ enum BG_EY_ProgressBarConsts enum BG_EY_Sounds { - //strange ids, but sure about them + // strange ids, but sure about them BG_EY_SOUND_FLAG_PICKED_UP_ALLIANCE = 8212, BG_EY_SOUND_FLAG_CAPTURED_HORDE = 8213, BG_EY_SOUND_FLAG_PICKED_UP_HORDE = 8174, @@ -137,7 +137,7 @@ const float BG_EY_NodePositions[BG_EY_NODES_MAX][3] = enum EYBattleGroundObjectTypes { - //buffs + // buffs BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER = 1, BG_EY_OBJECT_REGENBUFF_FEL_REAVER = 2, BG_EY_OBJECT_BERSERKBUFF_FEL_REAVER = 3, @@ -210,7 +210,7 @@ struct BattleGroundEYCapturingPointStruct const uint8 BG_EY_TickPoints[BG_EY_NODES_MAX] = {1, 2, 5, 10}; const uint32 BG_EY_FlagPoints[BG_EY_NODES_MAX] = {75, 85, 100, 500}; -//constant arrays: +// constant arrays: const BattleGroundEYPointIconsStruct PointsIconStruct[BG_EY_NODES_MAX] = { BattleGroundEYPointIconsStruct(FEL_REAVER_UNCONTROL, FEL_REAVER_ALLIANCE_CONTROL, FEL_REAVER_HORDE_CONTROL), diff --git a/src/game/BattleGroundHandler.cpp b/src/game/BattleGroundHandler.cpp index 6e4ff8c86..fbf612aef 100644 --- a/src/game/BattleGroundHandler.cpp +++ b/src/game/BattleGroundHandler.cpp @@ -137,7 +137,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recv_data) } // check if already in queue if (_player->GetBattleGroundQueueIndex(bgQueueTypeId) < PLAYER_MAX_BATTLEGROUND_QUEUES) - //player is already in this queue + // player is already in this queue return; // check if has free queue slots if (!_player->HasFreeBattleGroundQueueId()) @@ -264,12 +264,12 @@ void WorldSession::HandleBattleGroundPlayerPositionsOpcode(WorldPacket& /*recv_d } break; case BATTLEGROUND_EY: - //TODO : fix me! + // TODO : fix me! break; case BATTLEGROUND_AB: case BATTLEGROUND_AV: { - //for other BG types - send default + // for other BG types - send default WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4 + 4)); data << uint32(0); data << uint32(0); @@ -277,7 +277,7 @@ void WorldSession::HandleBattleGroundPlayerPositionsOpcode(WorldPacket& /*recv_d } break; default: - //maybe it is sent also in arena - do nothing + // maybe it is sent also in arena - do nothing break; } } @@ -356,11 +356,11 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket& recv_data) return; } - //get GroupQueueInfo from BattleGroundQueue + // get GroupQueueInfo from BattleGroundQueue BattleGroundTypeId bgTypeId = BattleGroundTypeId(bgTypeId_); BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId, ArenaType(type)); BattleGroundQueue& bgQueue = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId]; - //we must use temporary variable, because GroupQueueInfo pointer can be deleted in BattleGroundQueue::RemovePlayer() function + // we must use temporary variable, because GroupQueueInfo pointer can be deleted in BattleGroundQueue::RemovePlayer() function GroupQueueInfo ginfo; if (!bgQueue.GetPlayerGroupInfoData(_player->GetObjectGuid(), &ginfo)) { @@ -390,20 +390,20 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket& recv_data) if (!bracketEntry) return; - //some checks if player isn't cheating - it is not exactly cheating, but we cannot allow it + // some checks if player isn't cheating - it is not exactly cheating, but we cannot allow it if (action == 1 && ginfo.arenaType == ARENA_TYPE_NONE) { - //if player is trying to enter battleground (not arena!) and he has deserter debuff, we must just remove him from queue + // if player is trying to enter battleground (not arena!) and he has deserter debuff, we must just remove him from queue if (!_player->CanJoinToBattleground()) { - //send bg command result to show nice message + // send bg command result to show nice message WorldPacket data2; sBattleGroundMgr.BuildGroupJoinedBattlegroundPacket(&data2, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); _player->GetSession()->SendPacket(&data2); action = 0; DEBUG_LOG("Battleground: player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName(), _player->GetGUIDLow()); } - //if player don't match battleground max level, then do not allow him to enter! (this might happen when player leveled up during his waiting in queue + // if player don't match battleground max level, then do not allow him to enter! (this might happen when player leveled up during his waiting in queue if (_player->getLevel() > bg->GetMaxLevel()) { sLog.outError("Battleground: Player %s (%u) has level (%u) higher than maxlevel (%u) of battleground (%u)! Do not port him to battleground!", @@ -490,7 +490,7 @@ void WorldSession::HandleLeaveBattlefieldOpcode(WorldPacket& recv_data) recv_data.read_skip(); // BattleGroundTypeId recv_data.read_skip(); // unk3 - //if(bgTypeId >= MAX_BATTLEGROUND_TYPES) // cheating? but not important in this case + // if(bgTypeId >= MAX_BATTLEGROUND_TYPES) // cheating? but not important in this case // return; // not allow leave battleground in combat @@ -521,8 +521,8 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket& /*recv_data*/) if (bgTypeId == _player->GetBattleGroundTypeId()) { bg = _player->GetBattleGround(); - //i cannot check any variable from player class because player class doesn't know if player is in 2v2 / 3v3 or 5v5 arena - //so i must use bg pointer to get that information + // i cannot check any variable from player class because player class doesn't know if player is in 2v2 / 3v3 or 5v5 arena + // so i must use bg pointer to get that information if (bg && bg->GetArenaType() == arenaType) { // this line is checked, i only don't know if GetStartTime is changing itself after bg end! @@ -532,8 +532,8 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket& /*recv_data*/) continue; } } - //we are sending update to player about queue - he can be invited there! - //get GroupQueueInfo for queue status + // we are sending update to player about queue - he can be invited there! + // get GroupQueueInfo for queue status BattleGroundQueue& bgQueue = sBattleGroundMgr.m_BattleGroundQueues[bgQueueTypeId]; GroupQueueInfo ginfo; if (!bgQueue.GetPlayerGroupInfoData(_player->GetObjectGuid(), &ginfo)) @@ -612,7 +612,7 @@ void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket& recv_data) void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recv_data) { DEBUG_LOG("WORLD: CMSG_BATTLEMASTER_JOIN_ARENA"); - //recv_data.hexlike(); + // recv_data.hexlike(); ObjectGuid guid; // arena Battlemaster guid uint8 arenaslot; // 2v2, 3v3 or 5v5 @@ -678,7 +678,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recv_data) // check if already in queue if (_player->GetBattleGroundQueueIndex(bgQueueTypeId) < PLAYER_MAX_BATTLEGROUND_QUEUES) - //player is already in this queue + // player is already in this queue return; // check if has free queue slots if (!_player->HasFreeBattleGroundQueueId()) diff --git a/src/game/BattleGroundIC.cpp b/src/game/BattleGroundIC.cpp index d0d9f7ce1..b95b2e50a 100644 --- a/src/game/BattleGroundIC.cpp +++ b/src/game/BattleGroundIC.cpp @@ -23,7 +23,7 @@ BattleGroundIC::BattleGroundIC() { - //TODO FIX ME! + // TODO FIX ME! m_StartMessageIds[BG_STARTING_EVENT_FIRST] = 0; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE; @@ -51,7 +51,7 @@ void BattleGroundIC::StartingEventOpenDoors() void BattleGroundIC::AddPlayer(Player* plr) { BattleGround::AddPlayer(plr); - //create score and add it to map, default values are set in constructor + // create score and add it to map, default values are set in constructor BattleGroundICScore* sc = new BattleGroundICScore; m_PlayerScores[plr->GetObjectGuid()] = sc; diff --git a/src/game/BattleGroundIC.h b/src/game/BattleGroundIC.h index e0559980f..e12ba00f6 100644 --- a/src/game/BattleGroundIC.h +++ b/src/game/BattleGroundIC.h @@ -44,7 +44,7 @@ class BattleGroundIC : public BattleGround void RemovePlayer(Player* plr, ObjectGuid guid); void HandleAreaTrigger(Player* source, uint32 trigger); - //bool SetupBattleGround(); + // bool SetupBattleGround(); /* Scorekeeping */ void UpdatePlayerScore(Player* source, uint32 type, uint32 value); diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index e421d9153..fb00c1b63 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -96,7 +96,7 @@ void BattleGroundQueue::SelectionPool::Init() // sometimes it can be called on empty selection pool bool BattleGroundQueue::SelectionPool::KickGroup(uint32 size) { - //find maxgroup or LAST group with size == size and kick it + // find maxgroup or LAST group with size == size and kick it bool found = false; GroupsQueueType::iterator groupToKick = SelectedGroups.begin(); for (GroupsQueueType::iterator itr = groupToKick; itr != SelectedGroups.end(); ++itr) @@ -109,14 +109,14 @@ bool BattleGroundQueue::SelectionPool::KickGroup(uint32 size) else if (!found && (*itr)->Players.size() >= (*groupToKick)->Players.size()) groupToKick = itr; } - //if pool is empty, do nothing + // if pool is empty, do nothing if (GetPlayerCount()) { - //update player count + // update player count GroupQueueInfo* ginfo = (*groupToKick); SelectedGroups.erase(groupToKick); PlayerCount -= ginfo->Players.size(); - //return false if we kicked smaller group or there are enough players in selection pool + // return false if we kicked smaller group or there are enough players in selection pool if (ginfo->Players.size() <= size + 1) return false; } @@ -129,7 +129,7 @@ bool BattleGroundQueue::SelectionPool::KickGroup(uint32 size) // returns false when selection pool is full bool BattleGroundQueue::SelectionPool::AddGroup(GroupQueueInfo* ginfo, uint32 desiredCount) { - //if group is larger than desired count - don't allow to add it to pool + // if group is larger than desired count - don't allow to add it to pool if (!ginfo->IsInvitedToBGInstanceGUID && desiredCount >= PlayerCount + ginfo->Players.size()) { SelectedGroups.push_back(ginfo); @@ -166,7 +166,7 @@ GroupQueueInfo* BattleGroundQueue::AddGroup(Player* leader, Group* grp, BattleGr ginfo->Players.clear(); - //compute index (if group is premade or joined a rated match) to queues + // compute index (if group is premade or joined a rated match) to queues uint32 index = 0; if (!isRated && !isPremade) index += BG_TEAMS_COUNT; // BG_QUEUE_PREMADE_* -> BG_QUEUE_NORMAL_* @@ -178,15 +178,15 @@ GroupQueueInfo* BattleGroundQueue::AddGroup(Player* leader, Group* grp, BattleGr uint32 lastOnlineTime = WorldTimer::getMSTime(); - //announce world (this don't need mutex) + // announce world (this don't need mutex) if (isRated && sWorld.getConfig(CONFIG_BOOL_ARENA_QUEUE_ANNOUNCER_JOIN)) { sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, ginfo->arenaType, ginfo->arenaType, ginfo->ArenaTeamRating); } - //add players from group to ginfo + // add players from group to ginfo { - //ACE_Guard guard(m_Lock); + // ACE_Guard guard(m_Lock); if (grp) { for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) @@ -209,10 +209,10 @@ GroupQueueInfo* BattleGroundQueue::AddGroup(Player* leader, Group* grp, BattleGr ginfo->Players[leader->GetObjectGuid()] = &pl_info; } - //add GroupInfo to m_QueuedGroups + // add GroupInfo to m_QueuedGroups m_QueuedGroups[bracketId][index].push_back(ginfo); - //announce to world, this code needs mutex + // announce to world, this code needs mutex if (arenaType == ARENA_TYPE_NONE && !isRated && !isPremade && sWorld.getConfig(CONFIG_UINT32_BATTLEGROUND_QUEUE_ANNOUNCER_JOIN)) { if (BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(ginfo->BgTypeId)) @@ -245,7 +245,7 @@ GroupQueueInfo* BattleGroundQueue::AddGroup(Player* leader, Group* grp, BattleGr } } } - //release mutex + // release mutex } return ginfo; @@ -254,7 +254,7 @@ GroupQueueInfo* BattleGroundQueue::AddGroup(Player* leader, Group* grp, BattleGr void BattleGroundQueue::PlayerInvitedToBGUpdateAverageWaitTime(GroupQueueInfo* ginfo, BattleGroundBracketId bracket_id) { uint32 timeInQueue = WorldTimer::getMSTimeDiff(ginfo->JoinTime, WorldTimer::getMSTime()); - uint8 team_index = BG_TEAM_ALLIANCE; //default set to BG_TEAM_ALLIANCE - or non rated arenas! + uint8 team_index = BG_TEAM_ALLIANCE; // default set to BG_TEAM_ALLIANCE - or non rated arenas! if (ginfo->arenaType == ARENA_TYPE_NONE) { if (ginfo->GroupTeam == HORDE) @@ -263,25 +263,25 @@ void BattleGroundQueue::PlayerInvitedToBGUpdateAverageWaitTime(GroupQueueInfo* g else { if (ginfo->IsRated) - team_index = BG_TEAM_HORDE; //for rated arenas use BG_TEAM_HORDE + team_index = BG_TEAM_HORDE; // for rated arenas use BG_TEAM_HORDE } - //store pointer to arrayindex of player that was added first + // store pointer to arrayindex of player that was added first uint32* lastPlayerAddedPointer = &(m_WaitTimeLastPlayer[team_index][bracket_id]); - //remove his time from sum + // remove his time from sum m_SumOfWaitTimes[team_index][bracket_id] -= m_WaitTimes[team_index][bracket_id][(*lastPlayerAddedPointer)]; - //set average time to new + // set average time to new m_WaitTimes[team_index][bracket_id][(*lastPlayerAddedPointer)] = timeInQueue; - //add new time to sum + // add new time to sum m_SumOfWaitTimes[team_index][bracket_id] += timeInQueue; - //set index of last player added to next one + // set index of last player added to next one (*lastPlayerAddedPointer)++; (*lastPlayerAddedPointer) %= COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME; } uint32 BattleGroundQueue::GetAverageQueueWaitTime(GroupQueueInfo* ginfo, BattleGroundBracketId bracket_id) { - uint8 team_index = BG_TEAM_ALLIANCE; //default set to BG_TEAM_ALLIANCE - or non rated arenas! + uint8 team_index = BG_TEAM_ALLIANCE; // default set to BG_TEAM_ALLIANCE - or non rated arenas! if (ginfo->arenaType == ARENA_TYPE_NONE) { if (ginfo->GroupTeam == HORDE) @@ -290,26 +290,26 @@ uint32 BattleGroundQueue::GetAverageQueueWaitTime(GroupQueueInfo* ginfo, BattleG else { if (ginfo->IsRated) - team_index = BG_TEAM_HORDE; //for rated arenas use BG_TEAM_HORDE + team_index = BG_TEAM_HORDE; // for rated arenas use BG_TEAM_HORDE } - //check if there is enought values(we always add values > 0) + // check if there is enought values(we always add values > 0) if (m_WaitTimes[team_index][bracket_id][COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME - 1]) return (m_SumOfWaitTimes[team_index][bracket_id] / COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME); else - //if there aren't enough values return 0 - not available + // if there aren't enough values return 0 - not available return 0; } -//remove player from queue and from group info, if group info is empty then remove it too +// remove player from queue and from group info, if group info is empty then remove it too void BattleGroundQueue::RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount) { - //Player *plr = sObjectMgr.GetPlayer(guid); - //ACE_Guard guard(m_Lock); + // Player *plr = sObjectMgr.GetPlayer(guid); + // ACE_Guard guard(m_Lock); - int32 bracket_id = -1; // signed for proper for-loop finish + int32 bracket_id = -1; // signed for proper for-loop finish QueuedPlayersMap::iterator itr; - //remove player from map, if he's there + // remove player from map, if he's there itr = m_QueuedPlayers.find(guid); if (itr == m_QueuedPlayers.end()) { @@ -326,8 +326,8 @@ void BattleGroundQueue::RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount) for (int8 bracket_id_tmp = MAX_BATTLEGROUND_BRACKETS - 1; bracket_id_tmp >= 0 && bracket_id == -1; --bracket_id_tmp) { - //we must check premade and normal team's queue - because when players from premade are joining bg, - //they leave groupinfo so we can't use its players size to find out index + // we must check premade and normal team's queue - because when players from premade are joining bg, + // they leave groupinfo so we can't use its players size to find out index for (uint8 j = index; j < BG_QUEUE_GROUP_TYPES_COUNT; j += BG_QUEUE_NORMAL_ALLIANCE) { for (group_itr_tmp = m_QueuedGroups[bracket_id_tmp][j].begin(); group_itr_tmp != m_QueuedGroups[bracket_id_tmp][j].end(); ++group_itr_tmp) @@ -336,14 +336,14 @@ void BattleGroundQueue::RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount) { bracket_id = bracket_id_tmp; group_itr = group_itr_tmp; - //we must store index to be able to erase iterator + // we must store index to be able to erase iterator index = j; break; } } } } - //player can't be in queue without group, but just in case + // player can't be in queue without group, but just in case if (bracket_id == -1) { sLog.outError("BattleGroundQueue: ERROR Cannot find groupinfo for %s", guid.GetString().c_str()); @@ -376,7 +376,7 @@ void BattleGroundQueue::RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount) if (group->arenaType != ARENA_TYPE_NONE && group->IsRated && group->Players.empty() && sWorld.getConfig(CONFIG_BOOL_ARENA_QUEUE_ANNOUNCER_EXIT)) sWorld.SendWorldText(LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, group->arenaType, group->arenaType, group->ArenaTeamRating); - //if player leaves queue and he is invited to rated arena match, then he have to loose + // if player leaves queue and he is invited to rated arena match, then he have to loose if (group->IsInvitedToBGInstanceGUID && group->IsRated && decreaseInvitedCount) { ArenaTeam* at = sObjectMgr.GetArenaTeamById(group->ArenaTeamId); @@ -421,10 +421,10 @@ void BattleGroundQueue::RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount) } } -//returns true when player pl_guid is in queue and is invited to bgInstanceGuid +// returns true when player pl_guid is in queue and is invited to bgInstanceGuid bool BattleGroundQueue::IsPlayerInvited(ObjectGuid pl_guid, const uint32 bgInstanceGuid, const uint32 removeTime) { - //ACE_Guard g(m_Lock); + // ACE_Guard g(m_Lock); QueuedPlayersMap::const_iterator qItr = m_QueuedPlayers.find(pl_guid); return (qItr != m_QueuedPlayers.end() && qItr->second.GroupInfo->IsInvitedToBGInstanceGUID == bgInstanceGuid @@ -433,7 +433,7 @@ bool BattleGroundQueue::IsPlayerInvited(ObjectGuid pl_guid, const uint32 bgInsta bool BattleGroundQueue::GetPlayerGroupInfoData(ObjectGuid guid, GroupQueueInfo* ginfo) { - //ACE_Guard g(m_Lock); + // ACE_Guard g(m_Lock); QueuedPlayersMap::const_iterator qItr = m_QueuedPlayers.find(guid); if (qItr == m_QueuedPlayers.end()) return false; @@ -473,7 +473,7 @@ bool BattleGroundQueue::InviteGroupToBG(GroupQueueInfo* ginfo, BattleGround* bg, // invite the player PlayerInvitedToBGUpdateAverageWaitTime(ginfo, bracket_id); - //sBattleGroundMgr.InvitePlayer(plr, bg, ginfo->Team); + // sBattleGroundMgr.InvitePlayer(plr, bg, ginfo->Team); // set invited player counters bg->IncreaseInvitedCount(ginfo->GroupTeam); @@ -514,22 +514,22 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BattleGroundBracketId int32 hordeFree = bg->GetFreeSlotsForTeam(HORDE); int32 aliFree = bg->GetFreeSlotsForTeam(ALLIANCE); - //iterator for iterating through bg queue + // iterator for iterating through bg queue GroupsQueueType::const_iterator Ali_itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].begin(); - //count of groups in queue - used to stop cycles + // count of groups in queue - used to stop cycles uint32 aliCount = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].size(); - //index to queue which group is current + // index to queue which group is current uint32 aliIndex = 0; for (; aliIndex < aliCount && m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*Ali_itr), aliFree); ++aliIndex) ++Ali_itr; - //the same thing for horde + // the same thing for horde GroupsQueueType::const_iterator Horde_itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].begin(); uint32 hordeCount = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].size(); uint32 hordeIndex = 0; for (; hordeIndex < hordeCount && m_SelectionPools[BG_TEAM_HORDE].AddGroup((*Horde_itr), hordeFree); ++hordeIndex) ++Horde_itr; - //if ofc like BG queue invitation is set in config, then we are happy + // if ofc like BG queue invitation is set in config, then we are happy if (sWorld.getConfig(CONFIG_UINT32_BATTLEGROUND_INVITATION_TYPE) == 0) return; @@ -546,16 +546,16 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BattleGroundBracketId int32 diffHorde = hordeFree - int32(m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount()); while (abs(diffAli - diffHorde) > 1 && (m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() > 0 || m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() > 0)) { - //each cycle execution we need to kick at least 1 group + // each cycle execution we need to kick at least 1 group if (diffAli < diffHorde) { - //kick alliance group, add to pool new group if needed + // kick alliance group, add to pool new group if needed if (m_SelectionPools[BG_TEAM_ALLIANCE].KickGroup(diffHorde - diffAli)) { for (; aliIndex < aliCount && m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*Ali_itr), (aliFree >= diffHorde) ? aliFree - diffHorde : 0); ++aliIndex) ++Ali_itr; } - //if ali selection is already empty, then kick horde group, but if there are less horde than ali in bg - break; + // if ali selection is already empty, then kick horde group, but if there are less horde than ali in bg - break; if (!m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount()) { if (aliFree <= diffHorde + 1) @@ -565,7 +565,7 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BattleGroundBracketId } else { - //kick horde group, add to pool new group if needed + // kick horde group, add to pool new group if needed if (m_SelectionPools[BG_TEAM_HORDE].KickGroup(diffAli - diffHorde)) { for (; hordeIndex < hordeCount && m_SelectionPools[BG_TEAM_HORDE].AddGroup((*Horde_itr), (hordeFree >= diffAli) ? hordeFree - diffAli : 0); ++hordeIndex) @@ -578,7 +578,7 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BattleGroundBracketId m_SelectionPools[BG_TEAM_ALLIANCE].KickGroup(diffAli - diffHorde); } } - //count diffs after small update + // count diffs after small update diffAli = aliFree - int32(m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount()); diffHorde = hordeFree - int32(m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount()); } @@ -589,11 +589,11 @@ void BattleGroundQueue::FillPlayersToBG(BattleGround* bg, BattleGroundBracketId // it tries to invite as much players as it can - to MaxPlayersPerTeam, because premade groups have more than MinPlayersPerTeam players bool BattleGroundQueue::CheckPremadeMatch(BattleGroundBracketId bracket_id, uint32 MinPlayersPerTeam, uint32 MaxPlayersPerTeam) { - //check match + // check match if (!m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].empty() && !m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_HORDE].empty()) { - //start premade match - //if groups aren't invited + // start premade match + // if groups aren't invited GroupsQueueType::const_iterator ali_group, horde_group; for (ali_group = m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].begin(); ali_group != m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].end(); ++ali_group) if (!(*ali_group)->IsInvitedToBGInstanceGUID) @@ -606,19 +606,19 @@ bool BattleGroundQueue::CheckPremadeMatch(BattleGroundBracketId bracket_id, uint { m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*ali_group), MaxPlayersPerTeam); m_SelectionPools[BG_TEAM_HORDE].AddGroup((*horde_group), MaxPlayersPerTeam); - //add groups/players from normal queue to size of bigger group + // add groups/players from normal queue to size of bigger group uint32 maxPlayers = std::max(m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount(), m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount()); GroupsQueueType::const_iterator itr; for (uint8 i = 0; i < BG_TEAMS_COUNT; ++i) { for (itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + i].begin(); itr != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + i].end(); ++itr) { - //if itr can join BG and player count is less that maxPlayers, then add group to selectionpool + // if itr can join BG and player count is less that maxPlayers, then add group to selectionpool if (!(*itr)->IsInvitedToBGInstanceGUID && !m_SelectionPools[i].AddGroup((*itr), maxPlayers)) break; } } - //premade selection pools are set + // premade selection pools are set return true; } } @@ -634,13 +634,13 @@ bool BattleGroundQueue::CheckPremadeMatch(BattleGroundBracketId bracket_id, uint GroupsQueueType::iterator itr = m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE + i].begin(); if (!(*itr)->IsInvitedToBGInstanceGUID && ((*itr)->JoinTime < time_before || (*itr)->Players.size() < MinPlayersPerTeam)) { - //we must insert group to normal queue and erase pointer from premade queue + // we must insert group to normal queue and erase pointer from premade queue m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + i].push_front((*itr)); m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE + i].erase(itr); } } } - //selection pools are not set + // selection pools are not set return false; } @@ -661,15 +661,15 @@ bool BattleGroundQueue::CheckNormalMatch(BattleGround* bg_template, BattleGround } } } - //try to invite same number of players - this cycle may cause longer wait time even if there are enough players in queue, but we want ballanced bg + // try to invite same number of players - this cycle may cause longer wait time even if there are enough players in queue, but we want ballanced bg uint32 j = BG_TEAM_ALLIANCE; if (m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() < m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount()) j = BG_TEAM_HORDE; if (sWorld.getConfig(CONFIG_UINT32_BATTLEGROUND_INVITATION_TYPE) != 0 && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() >= minPlayers && m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() >= minPlayers) { - //we will try to invite more groups to team with less players indexed by j - ++(itr_team[j]); //this will not cause a crash, because for cycle above reached break; + // we will try to invite more groups to team with less players indexed by j + ++(itr_team[j]); // this will not cause a crash, because for cycle above reached break; for (; itr_team[j] != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + j].end(); ++(itr_team[j])) { if (!(*(itr_team[j]))->IsInvitedToBGInstanceGUID) @@ -680,10 +680,10 @@ bool BattleGroundQueue::CheckNormalMatch(BattleGround* bg_template, BattleGround if (abs((int32)(m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() - m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount())) > 2) return false; } - //allow 1v0 if debug bg + // allow 1v0 if debug bg if (sBattleGroundMgr.isTesting() && bg_template->isBattleGround() && (m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() || m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount())) return true; - //return true if there are enough players in selection pools - enable to work .debug bg command correctly + // return true if there are enough players in selection pools - enable to work .debug bg command correctly return m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() >= minPlayers && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount() >= minPlayers; } @@ -701,11 +701,11 @@ bool BattleGroundQueue::CheckSkirmishForSameFaction(BattleGroundBracketId bracke otherTeamIdx = BG_TEAM_ALLIANCE; otherTeamId = ALLIANCE; } - //clear other team's selection + // clear other team's selection m_SelectionPools[otherTeamIdx].Init(); - //store last ginfo pointer + // store last ginfo pointer GroupQueueInfo* ginfo = m_SelectionPools[teamIdx].SelectedGroups.back(); - //set itr_team to group that was added to selection pool latest + // set itr_team to group that was added to selection pool latest GroupsQueueType::iterator itr_team = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIdx].begin(); for (; itr_team != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIdx].end(); ++itr_team) if (ginfo == *itr_team) @@ -714,24 +714,24 @@ bool BattleGroundQueue::CheckSkirmishForSameFaction(BattleGroundBracketId bracke return false; GroupsQueueType::iterator itr_team2 = itr_team; ++itr_team2; - //invite players to other selection pool + // invite players to other selection pool for (; itr_team2 != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIdx].end(); ++itr_team2) { - //if selection pool is full then break; + // if selection pool is full then break; if (!(*itr_team2)->IsInvitedToBGInstanceGUID && !m_SelectionPools[otherTeamIdx].AddGroup(*itr_team2, minPlayersPerTeam)) break; } if (m_SelectionPools[otherTeamIdx].GetPlayerCount() != minPlayersPerTeam) return false; - //here we have correct 2 selections and we need to change one teams team and move selection pool teams to other team's queue + // here we have correct 2 selections and we need to change one teams team and move selection pool teams to other team's queue for (GroupsQueueType::iterator itr = m_SelectionPools[otherTeamIdx].SelectedGroups.begin(); itr != m_SelectionPools[otherTeamIdx].SelectedGroups.end(); ++itr) { - //set correct team + // set correct team (*itr)->GroupTeam = otherTeamId; - //add team to other queue + // add team to other queue m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + otherTeamIdx].push_front(*itr); - //remove team from old queue + // remove team from old queue GroupsQueueType::iterator itr2 = itr_team; ++itr2; for (; itr2 != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + teamIdx].end(); ++itr2) @@ -753,15 +753,15 @@ should be called from BattleGround::RemovePlayer function in some cases */ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketId bracket_id, ArenaType arenaType, bool isRated, uint32 arenaRating) { - //ACE_Guard guard(m_Lock); - //if no players in queue - do nothing + // ACE_Guard guard(m_Lock); + // if no players in queue - do nothing if (m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].empty() && m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_HORDE].empty() && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE].empty() && m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_HORDE].empty()) return; - //battleground with free slot for player should be always in the beggining of the queue + // battleground with free slot for player should be always in the beggining of the queue // maybe it would be better to create bgfreeslotqueue for each bracket_id BGFreeSlotQueueType::iterator itr, next; for (itr = sBattleGroundMgr.BGFreeSlotQueue[bgTypeId].begin(); itr != sBattleGroundMgr.BGFreeSlotQueue[bgTypeId].end(); itr = next) @@ -772,7 +772,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI if ((*itr)->isBattleGround() && (*itr)->GetTypeID() == bgTypeId && (*itr)->GetBracketId() == bracket_id && (*itr)->GetStatus() > STATUS_WAIT_QUEUE && (*itr)->GetStatus() < STATUS_WAIT_LEAVE) { - BattleGround* bg = *itr; //we have to store battleground pointer here, because when battleground is full, it is removed from free queue (not yet implemented!!) + BattleGround* bg = *itr; // we have to store battleground pointer here, because when battleground is full, it is removed from free queue (not yet implemented!!) // and iterator is invalid // clear selection pools @@ -826,7 +826,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI } else { - //this switch can be much shorter + // this switch can be much shorter MaxPlayersPerTeam = arenaType; MinPlayersPerTeam = arenaType; /*switch(arenaType) @@ -852,23 +852,23 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI if (bg_template->isBattleGround()) { - //check if there is premade against premade match + // check if there is premade against premade match if (CheckPremadeMatch(bracket_id, MinPlayersPerTeam, MaxPlayersPerTeam)) { - //create new battleground + // create new battleground BattleGround* bg2 = sBattleGroundMgr.CreateNewBattleGround(bgTypeId, bracketEntry, ARENA_TYPE_NONE, false); if (!bg2) { sLog.outError("BattleGroundQueue::Update - Cannot create battleground: %u", bgTypeId); return; } - //invite those selection pools + // invite those selection pools for (uint8 i = 0; i < BG_TEAMS_COUNT; ++i) for (GroupsQueueType::const_iterator citr = m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.begin(); citr != m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.end(); ++citr) InviteGroupToBG((*citr), bg2, (*citr)->GroupTeam); - //start bg + // start bg bg2->StartBattleGround(); - //clear structures + // clear structures m_SelectionPools[BG_TEAM_ALLIANCE].Init(); m_SelectionPools[BG_TEAM_HORDE].Init(); } @@ -922,10 +922,10 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI arenaRating = front1->ArenaTeamRating; } else if (!front1 && !front2) - return; //queues are empty + return; // queues are empty } - //set rating range + // set rating range uint32 arenaMinRating = (arenaRating <= sBattleGroundMgr.GetMaxRatingDifference()) ? 0 : arenaRating - sBattleGroundMgr.GetMaxRatingDifference(); uint32 arenaMaxRating = arenaRating + sBattleGroundMgr.GetMaxRatingDifference(); // if max rating difference is set and the time past since server startup is greater than the rating discard time @@ -938,7 +938,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI GroupsQueueType::iterator itr_team[BG_TEAMS_COUNT]; - //optimalization : --- we dont need to use selection_pools - each update we select max 2 groups + // optimalization : --- we dont need to use selection_pools - each update we select max 2 groups for (uint8 i = BG_QUEUE_PREMADE_ALLIANCE; i < BG_QUEUE_NORMAL_ALLIANCE; ++i) { @@ -993,7 +993,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BattleGroundBracketI } } - //if we have 2 teams, then start new arena and invite players! + // if we have 2 teams, then start new arena and invite players! if (m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount() && m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount()) { BattleGround* arena = sBattleGroundMgr.CreateNewBattleGround(bgTypeId, bracketEntry, arenaType, true); @@ -1045,7 +1045,7 @@ bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) return true; BattleGround* bg = sBattleGroundMgr.GetBattleGround(m_BgInstanceGUID, m_BgTypeId); - //if battleground ended and its instance deleted - do nothing + // if battleground ended and its instance deleted - do nothing if (!bg) return true; @@ -1058,17 +1058,17 @@ bool BGQueueInviteEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) if (bgQueue.IsPlayerInvited(m_PlayerGuid, m_BgInstanceGUID, m_RemoveTime)) { WorldPacket data; - //we must send remaining time in queue + // we must send remaining time in queue sBattleGroundMgr.BuildBattleGroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, 0, m_ArenaType); plr->GetSession()->SendPacket(&data); } } - return true; //event will be deleted + return true; // event will be deleted } void BGQueueInviteEvent::Abort(uint64 /*e_time*/) { - //do nothing + // do nothing } /* @@ -1088,8 +1088,8 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) return true; BattleGround* bg = sBattleGroundMgr.GetBattleGround(m_BgInstanceGUID, m_BgTypeId); - //battleground can be deleted already when we are removing queue info - //bg pointer can be NULL! so use it carefully! + // battleground can be deleted already when we are removing queue info + // bg pointer can be NULL! so use it carefully! uint32 queueSlot = plr->GetBattleGroundQueueIndex(m_BgQueueTypeId); if (queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES) // player is in queue, or in Battleground @@ -1102,7 +1102,7 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) plr->RemoveBattleGroundQueueId(m_BgQueueTypeId); bgQueue.RemovePlayer(m_PlayerGuid, true); - //update queues if battleground isn't ended + // update queues if battleground isn't ended if (bg && bg->isBattleGround() && bg->GetStatus() != STATUS_WAIT_LEAVE) sBattleGroundMgr.ScheduleQueueUpdate(0, ARENA_TYPE_NONE, m_BgQueueTypeId, m_BgTypeId, bg->GetBracketId()); @@ -1112,13 +1112,13 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) } } - //event will be deleted + // event will be deleted return true; } void BGQueueRemoveEvent::Abort(uint64 /*e_time*/) { - //do nothing + // do nothing } /*********************************************************/ @@ -1160,12 +1160,12 @@ void BattleGroundMgr::Update(uint32 diff) { std::vector scheduled; { - //create mutex - //ACE_Guard guard(SchedulerLock); - //copy vector and clear the other + // create mutex + // ACE_Guard guard(SchedulerLock); + // copy vector and clear the other scheduled = std::vector(m_QueueUpdateScheduler); m_QueueUpdateScheduler.clear(); - //release lock + // release lock } for (uint8 i = 0; i < scheduled.size(); ++i) @@ -1277,9 +1277,9 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket* data, BattleGround* bg) uint32 pointsLost = bg->m_ArenaTeamRatingChanges[i] < 0 ? abs(bg->m_ArenaTeamRatingChanges[i]) : 0; uint32 pointsGained = bg->m_ArenaTeamRatingChanges[i] > 0 ? bg->m_ArenaTeamRatingChanges[i] : 0; - *data << uint32(pointsLost); // Rating Lost - *data << uint32(pointsGained); // Rating gained - *data << uint32(0); // Matchmaking Value + *data << uint32(pointsLost); // Rating Lost + *data << uint32(pointsGained); // Rating gained + *data << uint32(0); // Matchmaking Value DEBUG_LOG("rating change: %d", bg->m_ArenaTeamRatingChanges[i]); } for (uint8 i = 1; i >= 0; --i) @@ -1327,9 +1327,9 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket* data, BattleGround* bg) else *data << uint8(0); } - *data << (int32)itr->second->DamageDone; // damage done - *data << (int32)itr->second->HealingDone; // healing done - switch (bg->GetTypeID()) // battleground specific things + *data << (int32)itr->second->DamageDone; // damage done + *data << (int32)itr->second->HealingDone; // healing done + switch (bg->GetTypeID()) // battleground specific things { case BATTLEGROUND_AV: *data << (uint32)0x00000005; // count of next fields @@ -1407,8 +1407,8 @@ void BattleGroundMgr::BuildPlayerJoinedBattleGroundPacket(WorldPacket* data, Pla BattleGround* BattleGroundMgr::GetBattleGroundThroughClientInstance(uint32 instanceId, BattleGroundTypeId bgTypeId) { - //cause at HandleBattleGroundJoinOpcode the clients sends the instanceid he gets from - //SMSG_BATTLEFIELD_LIST we need to find the battleground with this clientinstance-id + // cause at HandleBattleGroundJoinOpcode the clients sends the instanceid he gets from + // SMSG_BATTLEFIELD_LIST we need to find the battleground with this clientinstance-id BattleGround* bg = GetBattleGroundTemplate(bgTypeId); if (!bg) return NULL; @@ -1426,7 +1426,7 @@ BattleGround* BattleGroundMgr::GetBattleGroundThroughClientInstance(uint32 insta BattleGround* BattleGroundMgr::GetBattleGround(uint32 InstanceID, BattleGroundTypeId bgTypeId) { - //search if needed + // search if needed BattleGroundSet::iterator itr; if (bgTypeId == BATTLEGROUND_TYPE_NONE) { @@ -1444,14 +1444,14 @@ BattleGround* BattleGroundMgr::GetBattleGround(uint32 InstanceID, BattleGroundTy BattleGround* BattleGroundMgr::GetBattleGroundTemplate(BattleGroundTypeId bgTypeId) { - //map is sorted and we can be sure that lowest instance id has only BG template + // map is sorted and we can be sure that lowest instance id has only BG template return m_BattleGrounds[bgTypeId].empty() ? NULL : m_BattleGrounds[bgTypeId].begin()->second; } uint32 BattleGroundMgr::CreateClientVisibleInstanceId(BattleGroundTypeId bgTypeId, BattleGroundBracketId bracket_id) { if (IsArenaType(bgTypeId)) - return 0; //arenas don't have client-instanceids + return 0; // arenas don't have client-instanceids // we create here an instanceid, which is just for // displaying this to the client and without any other use.. @@ -1463,7 +1463,7 @@ uint32 BattleGroundMgr::CreateClientVisibleInstanceId(BattleGroundTypeId bgTypeI ClientBattleGroundIdSet& ids = m_ClientBattleGroundIds[bgTypeId][bracket_id]; for (ClientBattleGroundIdSet::const_iterator itr = ids.begin(); itr != ids.end();) { - if ((++lastId) != *itr) //if there is a gap between the ids, we will break.. + if ((++lastId) != *itr) // if there is a gap between the ids, we will break.. break; lastId = *itr; } @@ -1482,7 +1482,7 @@ BattleGround* BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeId return NULL; } - //for arenas there is random map used + // for arenas there is random map used if (bg_template->isArena()) { BattleGroundTypeId arenas[] = { BATTLEGROUND_NA, BATTLEGROUND_BE, BATTLEGROUND_RL/*, BATTLEGROUND_DS, BATTLEGROUND_RV*/ }; @@ -1539,7 +1539,7 @@ BattleGround* BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeId bg = new BattleGroundRB(*(BattleGroundRB*)bg_template); break; default: - //error, but it is handled few lines above + // error, but it is handled few lines above return 0; } @@ -1645,7 +1645,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds() uint32 MinPlayersPerTeam = fields[1].GetUInt32(); uint32 MaxPlayersPerTeam = fields[2].GetUInt32(); - //check values from DB + // check values from DB if (MaxPlayersPerTeam == 0 || MinPlayersPerTeam == 0) { sLog.outErrorDb("Table `battleground_template` for id %u have wrong min/max players per team settings. BG not created.", bgTypeID); @@ -1704,7 +1704,7 @@ void BattleGroundMgr::CreateInitialBattleGrounds() continue; } - //sLog.outDetail("Creating battleground %s, %u-%u", bl->name[sWorld.GetDBClang()], MinLvl, MaxLvl); + // sLog.outDetail("Creating battleground %s, %u-%u", bl->name[sWorld.GetDBClang()], MinLvl, MaxLvl); if (!CreateBattleGround(bgTypeID, IsArena, MinPlayersPerTeam, MaxPlayersPerTeam, bl->minLevel, bl->maxLevel, bl->name[sWorld.GetDefaultDbcLocale()], bl->mapid[0], AStartLoc[0], AStartLoc[1], AStartLoc[2], AStartLoc[3], HStartLoc[0], HStartLoc[1], HStartLoc[2], HStartLoc[3])) continue; @@ -1746,10 +1746,10 @@ void BattleGroundMgr::DistributeArenaPoints() sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_START); - //temporary structure for storing maximum points to add values for all players + // temporary structure for storing maximum points to add values for all players std::map PlayerPoints; - //at first update all points for all team members + // at first update all points for all team members for (ObjectMgr::ArenaTeamMap::iterator team_itr = sObjectMgr.GetArenaTeamMapBegin(); team_itr != sObjectMgr.GetArenaTeamMapEnd(); ++team_itr) { if (ArenaTeam* at = team_itr->second) @@ -1758,12 +1758,12 @@ void BattleGroundMgr::DistributeArenaPoints() } } - //cycle that gives points to all players + // cycle that gives points to all players for (std::map::iterator plr_itr = PlayerPoints.begin(); plr_itr != PlayerPoints.end(); ++plr_itr) { - //update to database + // update to database CharacterDatabase.PExecute("UPDATE characters SET arenaPoints = arenaPoints + '%u' WHERE guid = '%u'", plr_itr->second, plr_itr->first); - //add points if player is online + // add points if player is online if (Player* pl = sObjectMgr.GetPlayer(ObjectGuid(HIGHGUID_PLAYER, plr_itr->first))) pl->ModifyArenaPoints(plr_itr->second); } @@ -1982,8 +1982,8 @@ void BattleGroundMgr::ToggleArenaTesting() void BattleGroundMgr::ScheduleQueueUpdate(uint32 arenaRating, ArenaType arenaType, BattleGroundQueueTypeId bgQueueTypeId, BattleGroundTypeId bgTypeId, BattleGroundBracketId bracket_id) { - //ACE_Guard guard(SchedulerLock); - //we will use only 1 number created of bgTypeId and bracket_id + // ACE_Guard guard(SchedulerLock); + // we will use only 1 number created of bgTypeId and bracket_id uint64 schedule_id = ((uint64)arenaRating << 32) | (arenaType << 24) | (bgQueueTypeId << 16) | (bgTypeId << 8) | bracket_id; bool found = false; for (uint8 i = 0; i < m_QueueUpdateScheduler.size(); ++i) diff --git a/src/game/BattleGroundMgr.h b/src/game/BattleGroundMgr.h index 40fcfc5bf..9e8277a59 100644 --- a/src/game/BattleGroundMgr.h +++ b/src/game/BattleGroundMgr.h @@ -29,7 +29,7 @@ typedef std::map BattleGroundSet; -//this container can't be deque, because deque doesn't like removing the last element - if you remove it, it invalidates next iterator and crash appears +// this container can't be deque, because deque doesn't like removing the last element - if you remove it, it invalidates next iterator and crash appears typedef std::list BGFreeSlotQueueType; typedef UNORDERED_MAP BattleMastersMap; @@ -93,14 +93,14 @@ class BattleGroundQueue uint32 GetAverageQueueWaitTime(GroupQueueInfo* ginfo, BattleGroundBracketId bracket_id); private: - //mutex that should not allow changing private data, nor allowing to update Queue during private data change. + // mutex that should not allow changing private data, nor allowing to update Queue during private data change. ACE_Recursive_Thread_Mutex m_Lock; typedef std::map QueuedPlayersMap; QueuedPlayersMap m_QueuedPlayers; - //we need constant add to begin and constant remove / add from the end, therefore deque suits our problem well + // we need constant add to begin and constant remove / add from the end, therefore deque suits our problem well typedef std::list GroupsQueueType; /* @@ -128,7 +128,7 @@ class BattleGroundQueue uint32 PlayerCount; }; - //one selection pool for horde, other one for alliance + // one selection pool for horde, other one for alliance SelectionPool m_SelectionPools[BG_TEAMS_COUNT]; bool InviteGroupToBG(GroupQueueInfo* ginfo, BattleGround* bg, Team side); @@ -204,7 +204,7 @@ class BattleGroundMgr /* Battlegrounds */ BattleGround* GetBattleGroundThroughClientInstance(uint32 instanceId, BattleGroundTypeId bgTypeId); - BattleGround* GetBattleGround(uint32 InstanceID, BattleGroundTypeId bgTypeId); //there must be uint32 because MAX_BATTLEGROUND_TYPE_ID means unknown + BattleGround* GetBattleGround(uint32 InstanceID, BattleGroundTypeId bgTypeId); // there must be uint32 because MAX_BATTLEGROUND_TYPE_ID means unknown BattleGround* GetBattleGroundTemplate(BattleGroundTypeId bgTypeId); BattleGround* CreateNewBattleGround(BattleGroundTypeId bgTypeId, PvPDifficultyEntry const* bracketEntry, ArenaType arenaType, bool isRated); @@ -225,7 +225,7 @@ class BattleGroundMgr void SendToBattleGround(Player* pl, uint32 InstanceID, BattleGroundTypeId bgTypeId); /* Battleground queues */ - //these queues are instantiated when creating BattlegroundMrg + // these queues are instantiated when creating BattlegroundMrg BattleGroundQueue m_BattleGroundQueues[MAX_BATTLEGROUND_QUEUE_TYPES]; // public, because we need to access them in BG handler code BGFreeSlotQueueType BGFreeSlotQueue[MAX_BATTLEGROUND_TYPE_ID]; @@ -287,7 +287,7 @@ class BattleGroundMgr BattleGroundSet m_BattleGrounds[MAX_BATTLEGROUND_TYPE_ID]; std::vector m_QueueUpdateScheduler; typedef std::set ClientBattleGroundIdSet; - ClientBattleGroundIdSet m_ClientBattleGroundIds[MAX_BATTLEGROUND_TYPE_ID][MAX_BATTLEGROUND_BRACKETS]; //the instanceids just visible for the client + ClientBattleGroundIdSet m_ClientBattleGroundIds[MAX_BATTLEGROUND_TYPE_ID][MAX_BATTLEGROUND_BRACKETS]; // the instanceids just visible for the client uint32 m_NextRatingDiscardUpdate; time_t m_NextAutoDistributionTime; uint32 m_AutoDistributionTimeChecker; diff --git a/src/game/BattleGroundNA.cpp b/src/game/BattleGroundNA.cpp index 35788c3d6..447fe9909 100644 --- a/src/game/BattleGroundNA.cpp +++ b/src/game/BattleGroundNA.cpp @@ -30,7 +30,7 @@ BattleGroundNA::BattleGroundNA() m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S; m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; - //we must set messageIds + // we must set messageIds m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS; @@ -64,7 +64,7 @@ void BattleGroundNA::StartingEventOpenDoors() void BattleGroundNA::AddPlayer(Player* plr) { BattleGround::AddPlayer(plr); - //create score and add it to map, default values are set in constructor + // create score and add it to map, default values are set in constructor BattleGroundNAScore* sc = new BattleGroundNAScore; m_PlayerScores[plr->GetObjectGuid()] = sc; @@ -114,8 +114,8 @@ void BattleGroundNA::HandleAreaTrigger(Player* source, uint32 trigger) if (GetStatus() != STATUS_IN_PROGRESS) return; - //uint32 spellId = 0; - //uint64 buff_guid = 0; + // uint32 spellId = 0; + // uint64 buff_guid = 0; switch (trigger) { case 4536: // buff trigger? @@ -127,7 +127,7 @@ void BattleGroundNA::HandleAreaTrigger(Player* source, uint32 trigger) break; } - //if (buff_guid) + // if (buff_guid) // HandleTriggerBuff(buff_guid, source); } @@ -140,7 +140,7 @@ void BattleGroundNA::FillInitialWorldStates(WorldPacket& data, uint32& count) void BattleGroundNA::Reset() { - //call parent's class reset + // call parent's class reset BattleGround::Reset(); } diff --git a/src/game/BattleGroundNA.h b/src/game/BattleGroundNA.h index 94e3ad43a..ddda65e05 100644 --- a/src/game/BattleGroundNA.h +++ b/src/game/BattleGroundNA.h @@ -25,7 +25,7 @@ class BattleGroundNAScore : public BattleGroundScore public: BattleGroundNAScore() {}; virtual ~BattleGroundNAScore() {}; - //TODO fix me + // TODO fix me }; class BattleGroundNA : public BattleGround diff --git a/src/game/BattleGroundRB.cpp b/src/game/BattleGroundRB.cpp index 89bd3e55e..734d1eee8 100644 --- a/src/game/BattleGroundRB.cpp +++ b/src/game/BattleGroundRB.cpp @@ -23,7 +23,7 @@ BattleGroundRB::BattleGroundRB() { - //TODO FIX ME! + // TODO FIX ME! m_StartMessageIds[BG_STARTING_EVENT_FIRST] = 0; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE; @@ -51,7 +51,7 @@ void BattleGroundRB::StartingEventOpenDoors() void BattleGroundRB::AddPlayer(Player* plr) { BattleGround::AddPlayer(plr); - //create score and add it to map, default values are set in constructor + // create score and add it to map, default values are set in constructor BattleGroundABGScore* sc = new BattleGroundABGScore; m_PlayerScores[plr->GetObjectGuid()] = sc; diff --git a/src/game/BattleGroundRB.h b/src/game/BattleGroundRB.h index 5a2910d6c..24ecb17ee 100644 --- a/src/game/BattleGroundRB.h +++ b/src/game/BattleGroundRB.h @@ -44,7 +44,7 @@ class BattleGroundRB : public BattleGround void RemovePlayer(Player* plr, ObjectGuid guid); void HandleAreaTrigger(Player* source, uint32 trigger); - //bool SetupBattleGround(); + // bool SetupBattleGround(); /* Scorekeeping */ void UpdatePlayerScore(Player* source, uint32 type, uint32 value); diff --git a/src/game/BattleGroundRL.cpp b/src/game/BattleGroundRL.cpp index 256b41727..f481b5870 100644 --- a/src/game/BattleGroundRL.cpp +++ b/src/game/BattleGroundRL.cpp @@ -30,7 +30,7 @@ BattleGroundRL::BattleGroundRL() m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S; m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; - //we must set messageIds + // we must set messageIds m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS; @@ -63,7 +63,7 @@ void BattleGroundRL::StartingEventOpenDoors() void BattleGroundRL::AddPlayer(Player* plr) { BattleGround::AddPlayer(plr); - //create score and add it to map, default values are set in constructor + // create score and add it to map, default values are set in constructor BattleGroundRLScore* sc = new BattleGroundRLScore; m_PlayerScores[plr->GetObjectGuid()] = sc; @@ -114,8 +114,8 @@ void BattleGroundRL::HandleAreaTrigger(Player* source, uint32 trigger) if (GetStatus() != STATUS_IN_PROGRESS) return; - //uint32 spellId = 0; - //uint64 buff_guid = 0; + // uint32 spellId = 0; + // uint64 buff_guid = 0; switch (trigger) { case 4696: // buff trigger? @@ -127,7 +127,7 @@ void BattleGroundRL::HandleAreaTrigger(Player* source, uint32 trigger) break; } - //if (buff_guid) + // if (buff_guid) // HandleTriggerBuff(buff_guid, source); } @@ -140,7 +140,7 @@ void BattleGroundRL::FillInitialWorldStates(WorldPacket& data, uint32& count) void BattleGroundRL::Reset() { - //call parent's reset + // call parent's reset BattleGround::Reset(); } diff --git a/src/game/BattleGroundRL.h b/src/game/BattleGroundRL.h index f5d747688..b8f4160ef 100644 --- a/src/game/BattleGroundRL.h +++ b/src/game/BattleGroundRL.h @@ -25,7 +25,7 @@ class BattleGroundRLScore : public BattleGroundScore public: BattleGroundRLScore() {}; virtual ~BattleGroundRLScore() {}; - //TODO fix me + // TODO fix me }; class BattleGroundRL : public BattleGround diff --git a/src/game/BattleGroundRV.cpp b/src/game/BattleGroundRV.cpp index a80627912..39e1d28fc 100644 --- a/src/game/BattleGroundRV.cpp +++ b/src/game/BattleGroundRV.cpp @@ -28,7 +28,7 @@ BattleGroundRV::BattleGroundRV() m_StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S; m_StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S; m_StartDelayTimes[BG_STARTING_EVENT_FOURTH] = BG_START_DELAY_NONE; - //we must set messageIds + // we must set messageIds m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_ARENA_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_ARENA_THIRTY_SECONDS; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_ARENA_FIFTEEN_SECONDS; @@ -56,7 +56,7 @@ void BattleGroundRV::StartingEventOpenDoors() void BattleGroundRV::AddPlayer(Player* plr) { BattleGround::AddPlayer(plr); - //create score and add it to map, default values are set in constructor + // create score and add it to map, default values are set in constructor BattleGroundRVScore* sc = new BattleGroundRVScore; m_PlayerScores[plr->GetObjectGuid()] = sc; diff --git a/src/game/BattleGroundRV.h b/src/game/BattleGroundRV.h index 165bebb37..a84f73e40 100644 --- a/src/game/BattleGroundRV.h +++ b/src/game/BattleGroundRV.h @@ -25,7 +25,7 @@ class BattleGroundRVScore : public BattleGroundScore public: BattleGroundRVScore() {}; virtual ~BattleGroundRVScore() {}; - //TODO fix me + // TODO fix me }; class BattleGroundRV : public BattleGround diff --git a/src/game/BattleGroundSA.cpp b/src/game/BattleGroundSA.cpp index 311b199ee..5321ecf01 100644 --- a/src/game/BattleGroundSA.cpp +++ b/src/game/BattleGroundSA.cpp @@ -23,7 +23,7 @@ BattleGroundSA::BattleGroundSA() { - //TODO FIX ME! + // TODO FIX ME! m_StartMessageIds[BG_STARTING_EVENT_FIRST] = 0; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_WS_START_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_WS_START_HALF_MINUTE; @@ -51,7 +51,7 @@ void BattleGroundSA::StartingEventOpenDoors() void BattleGroundSA::AddPlayer(Player* plr) { BattleGround::AddPlayer(plr); - //create score and add it to map, default values are set in constructor + // create score and add it to map, default values are set in constructor BattleGroundSAScore* sc = new BattleGroundSAScore; m_PlayerScores[plr->GetObjectGuid()] = sc; diff --git a/src/game/BattleGroundSA.h b/src/game/BattleGroundSA.h index 1ab408172..f4f0244a7 100644 --- a/src/game/BattleGroundSA.h +++ b/src/game/BattleGroundSA.h @@ -47,7 +47,7 @@ class BattleGroundSA : public BattleGround void RemovePlayer(Player* plr, ObjectGuid guid); void HandleAreaTrigger(Player* source, uint32 trigger); - //bool SetupBattleGround(); + // bool SetupBattleGround(); /* Scorekeeping */ void UpdatePlayerScore(Player* source, uint32 type, uint32 value); diff --git a/src/game/BattleGroundWS.cpp b/src/game/BattleGroundWS.cpp index 96a0c3f59..061a5486b 100644 --- a/src/game/BattleGroundWS.cpp +++ b/src/game/BattleGroundWS.cpp @@ -135,7 +135,7 @@ void BattleGroundWS::StartingEventOpenDoors() void BattleGroundWS::AddPlayer(Player* plr) { BattleGround::AddPlayer(plr); - //create score and add it to map, default values are set in constructor + // create score and add it to map, default values are set in constructor BattleGroundWGScore* sc = new BattleGroundWGScore; m_PlayerScores[plr->GetObjectGuid()] = sc; @@ -158,7 +158,7 @@ void BattleGroundWS::RespawnFlag(Team team, bool captured) if (captured) { - //when map_update will be allowed for battlegrounds this code will be useless + // when map_update will be allowed for battlegrounds this code will be useless SpawnEvent(WS_EVENT_FLAG_A, 0, true); SpawnEvent(WS_EVENT_FLAG_H, 0, true); SendMessageToAll(LANG_BG_WS_F_PLACED, CHAT_MSG_BG_SYSTEM_NEUTRAL); @@ -226,7 +226,7 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player* source) PlaySoundToAll(BG_WS_SOUND_FLAG_CAPTURED_HORDE); RewardReputationToTeam(889, m_ReputationCapture, HORDE); } - //for flag capture is reward 2 honorable kills + // for flag capture is reward 2 honorable kills RewardHonorToTeam(GetBonusHonorFromKill(2), source->GetTeam()); // despawn flags @@ -352,7 +352,7 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player* source, GameObject* target uint8 event = (sBattleGroundMgr.GetGameObjectEventIndex(target_obj->GetGUIDLow())).event1; - //alliance flag picked up from base + // alliance flag picked up from base if (source->GetTeam() == HORDE && GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_BASE && event == WS_EVENT_FLAG_A) { @@ -362,13 +362,13 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player* source, GameObject* target SpawnEvent(WS_EVENT_FLAG_A, 0, false); SetAllianceFlagPicker(source->GetObjectGuid()); m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_PLAYER; - //update world state to show correct flag carrier + // update world state to show correct flag carrier UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER); UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 1); source->CastSpell(source, BG_WS_SPELL_SILVERWING_FLAG, true); } - //horde flag picked up from base + // horde flag picked up from base if (source->GetTeam() == ALLIANCE && GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_BASE && event == WS_EVENT_FLAG_H) { @@ -378,13 +378,13 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player* source, GameObject* target SpawnEvent(WS_EVENT_FLAG_H, 0, false); SetHordeFlagPicker(source->GetObjectGuid()); m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_PLAYER; - //update world state to show correct flag carrier + // update world state to show correct flag carrier UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER); UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 1); source->CastSpell(source, BG_WS_SPELL_WARSONG_FLAG, true); } - //Alliance flag on ground(not in base) (returned or picked up again from ground!) + // Alliance flag on ground(not in base) (returned or picked up again from ground!) if (GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && source->IsWithinDistInMap(target_obj, 10)) { if (source->GetTeam() == ALLIANCE) @@ -408,11 +408,11 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player* source, GameObject* target UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER); UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 1); } - //called in HandleGameObjectUseOpcode: - //target_obj->Delete(); + // called in HandleGameObjectUseOpcode: + // target_obj->Delete(); } - //Horde flag on ground(not in base) (returned or picked up again) + // Horde flag on ground(not in base) (returned or picked up again) if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && source->IsWithinDistInMap(target_obj, 10)) { if (source->GetTeam() == HORDE) @@ -436,8 +436,8 @@ void BattleGroundWS::EventPlayerClickedOnFlag(Player* source, GameObject* target UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER); UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 1); } - //called in HandleGameObjectUseOpcode: - //target_obj->Delete(); + // called in HandleGameObjectUseOpcode: + // target_obj->Delete(); } if (!message_id) @@ -496,8 +496,8 @@ void BattleGroundWS::HandleAreaTrigger(Player* source, uint32 trigger) if (GetStatus() != STATUS_IN_PROGRESS) return; - //uint32 SpellId = 0; - //uint64 buff_guid = 0; + // uint32 SpellId = 0; + // uint64 buff_guid = 0; switch (trigger) { case 3686: // Alliance elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in BattleGround::Update(). @@ -536,7 +536,7 @@ bool BattleGroundWS::SetupBattleGround() void BattleGroundWS::Reset() { - //call parent's class reset + // call parent's class reset BattleGround::Reset(); // spiritguides and flags not spawned at beginning @@ -562,12 +562,12 @@ void BattleGroundWS::Reset() void BattleGroundWS::EndBattleGround(Team winner) { - //win reward + // win reward if (winner == ALLIANCE) RewardHonorToTeam(GetBonusHonorFromKill(m_HonorWinKills), ALLIANCE); if (winner == HORDE) RewardHonorToTeam(GetBonusHonorFromKill(m_HonorWinKills), HORDE); - //complete map_end rewards (even if no team wins) + // complete map_end rewards (even if no team wins) RewardHonorToTeam(GetBonusHonorFromKill(m_HonorEndKills), ALLIANCE); RewardHonorToTeam(GetBonusHonorFromKill(m_HonorEndKills), HORDE); @@ -607,11 +607,11 @@ void BattleGroundWS::UpdatePlayerScore(Player* source, uint32 type, uint32 value WorldSafeLocsEntry const* BattleGroundWS::GetClosestGraveYard(Player* player) { - //if status in progress, it returns main graveyards with spiritguides - //else it will return the graveyard in the flagroom - this is especially good - //if a player dies in preparation phase - then the player can't cheat - //and teleport to the graveyard outside the flagroom - //and start running around, while the doors are still closed + // if status in progress, it returns main graveyards with spiritguides + // else it will return the graveyard in the flagroom - this is especially good + // if a player dies in preparation phase - then the player can't cheat + // and teleport to the graveyard outside the flagroom + // and start running around, while the doors are still closed if (player->GetTeam() == ALLIANCE) { if (GetStatus() == STATUS_IN_PROGRESS) diff --git a/src/game/CalendarHandler.cpp b/src/game/CalendarHandler.cpp index bef36cc18..88838e65e 100644 --- a/src/game/CalendarHandler.cpp +++ b/src/game/CalendarHandler.cpp @@ -67,26 +67,26 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recv_data*/) /* for(uint32 i = 0; i < holidays_count; ++i) { - data << uint32(0); // Holidays.dbc ID - data << uint32(0); // Holidays.dbc region - data << uint32(0); // Holidays.dbc looping - data << uint32(0); // Holidays.dbc priority - data << uint32(0); // Holidays.dbc calendarFilterType + data << uint32(0); // Holidays.dbc ID + data << uint32(0); // Holidays.dbc region + data << uint32(0); // Holidays.dbc looping + data << uint32(0); // Holidays.dbc priority + data << uint32(0); // Holidays.dbc calendarFilterType for(uint32 j = 0; j < 26; ++j) - data << uint32(0); // Holidays.dbc date + data << uint32(0); // Holidays.dbc date for(uint32 j = 0; j < 10; ++j) - data << uint32(0); // Holidays.dbc duration + data << uint32(0); // Holidays.dbc duration for(uint32 j = 0; j < 10; ++j) - data << uint32(0); // Holidays.dbc calendarFlags + data << uint32(0); // Holidays.dbc calendarFlags - data << ""; // Holidays.dbc textureFilename + data << ""; // Holidays.dbc textureFilename } */ - //DEBUG_LOG("Sending calendar"); - //data.hexlike(); + // DEBUG_LOG("Sending calendar"); + // data.hexlike(); SendPacket(&data); } @@ -119,20 +119,20 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket& recv_data) recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam - //std::string unk1, unk2; - //recv_data >> (std::string)unk1; - //recv_data >> (std::string)unk2; + // std::string unk1, unk2; + // recv_data >> (std::string)unk1; + // recv_data >> (std::string)unk2; - //uint8 unk3, unk4; - //uint32 unk5, unk6, unk7, unk8, unk9, count = 0; - //recv_data >> (uint8)unk3; - //recv_data >> (uint8)unk4; - //recv_data >> (uint32)unk5; - //recv_data >> (uint32)unk6; - //recv_data >> (uint32)unk7; - //recv_data >> (uint32)unk8; - //recv_data >> (uint32)unk9; - //if (!((unk9 >> 6) & 1)) + // uint8 unk3, unk4; + // uint32 unk5, unk6, unk7, unk8, unk9, count = 0; + // recv_data >> (uint8)unk3; + // recv_data >> (uint8)unk4; + // recv_data >> (uint32)unk5; + // recv_data >> (uint32)unk6; + // recv_data >> (uint32)unk7; + // recv_data >> (uint32)unk8; + // recv_data >> (uint32)unk9; + // if (!((unk9 >> 6) & 1)) //{ // recv_data >> (uint32)count; // if (count) @@ -155,17 +155,17 @@ void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recv_data) recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> std::string - //recv_data >> std::string - //recv_data >> uint8 - //recv_data >> uint8 - //recv_data >> uint32 - //recv_data >> uint32 - //recv_data >> uint32 - //recv_data >> uint32 - //recv_data >> uint32 + // recv_data >> uint64 + // recv_data >> uint64 + // recv_data >> std::string + // recv_data >> std::string + // recv_data >> uint8 + // recv_data >> uint8 + // recv_data >> uint32 + // recv_data >> uint32 + // recv_data >> uint32 + // recv_data >> uint32 + // recv_data >> uint32 } void WorldSession::HandleCalendarRemoveEvent(WorldPacket& recv_data) @@ -174,9 +174,9 @@ void WorldSession::HandleCalendarRemoveEvent(WorldPacket& recv_data) recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint32 + // recv_data >> uint64 + // recv_data >> uint64 + // recv_data >> uint32 } @@ -186,9 +186,9 @@ void WorldSession::HandleCalendarCopyEvent(WorldPacket& recv_data) recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint32 + // recv_data >> uint64 + // recv_data >> uint64 + // recv_data >> uint32 } @@ -198,11 +198,11 @@ void WorldSession::HandleCalendarEventInvite(WorldPacket& recv_data) recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> std::string - //recv_data >> uint8 - //recv_data >> uint8 + // recv_data >> uint64 + // recv_data >> uint64 + // recv_data >> std::string + // recv_data >> uint8 + // recv_data >> uint8 } @@ -212,9 +212,9 @@ void WorldSession::HandleCalendarEventRsvp(WorldPacket& recv_data) recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint32 + // recv_data >> uint64 + // recv_data >> uint64 + // recv_data >> uint32 } void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket& recv_data) @@ -223,10 +223,10 @@ void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket& recv_data) recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam - //recv_data.readPackGUID(guid) - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint64 + // recv_data.readPackGUID(guid) + // recv_data >> uint64 + // recv_data >> uint64 + // recv_data >> uint64 } void WorldSession::HandleCalendarEventStatus(WorldPacket& recv_data) @@ -235,11 +235,11 @@ void WorldSession::HandleCalendarEventStatus(WorldPacket& recv_data) recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam - //recv_data.readPackGUID(guid) - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint32 + // recv_data.readPackGUID(guid) + // recv_data >> uint64 + // recv_data >> uint64 + // recv_data >> uint64 + // recv_data >> uint32 } void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket& recv_data) @@ -248,11 +248,11 @@ void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket& recv_data) recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam - //recv_data.readPackGUID(guid) - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint32 + // recv_data.readPackGUID(guid) + // recv_data >> uint64 + // recv_data >> uint64 + // recv_data >> uint64 + // recv_data >> uint32 } void WorldSession::HandleCalendarComplain(WorldPacket& recv_data) @@ -261,9 +261,9 @@ void WorldSession::HandleCalendarComplain(WorldPacket& recv_data) recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam - //recv_data >> uint64 - //recv_data >> uint64 - //recv_data >> uint64 + // recv_data >> uint64 + // recv_data >> uint64 + // recv_data >> uint64 } void WorldSession::HandleCalendarGetNumPending(WorldPacket& /*recv_data*/) diff --git a/src/game/CellImpl.h b/src/game/CellImpl.h index ef77f09bb..a59c5eeef 100644 --- a/src/game/CellImpl.h +++ b/src/game/CellImpl.h @@ -64,21 +64,21 @@ Cell::Visit(const CellPair& standing_cell, TypeContainerVisitor& v if (standing_cell.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || standing_cell.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP) return; - //no jokes here... Actually placing ASSERT() here was good idea, but - //we had some problems with DynamicObjects, which pass radius = 0.0f (DB issue?) - //maybe it is better to just return when radius <= 0.0f? + // no jokes here... Actually placing ASSERT() here was good idea, but + // we had some problems with DynamicObjects, which pass radius = 0.0f (DB issue?) + // maybe it is better to just return when radius <= 0.0f? if (radius <= 0.0f) { m.Visit(*this, visitor); return; } - //lets limit the upper value for search radius + // lets limit the upper value for search radius if (radius > 333.0f) radius = 333.0f; - //lets calculate object coord offsets from cell borders. + // lets calculate object coord offsets from cell borders. CellArea area = Cell::CalculateCellArea(x, y, radius); - //if radius fits inside standing cell + // if radius fits inside standing cell if (!area) { m.Visit(*this, visitor); @@ -87,18 +87,18 @@ Cell::Visit(const CellPair& standing_cell, TypeContainerVisitor& v CellPair& begin_cell = area.low_bound; CellPair& end_cell = area.high_bound; - //visit all cells, found in CalculateCellArea() - //if radius is known to reach cell area more than 4x4 then we should call optimized VisitCircle - //currently this technique works with MAX_NUMBER_OF_CELLS 16 and higher, with lower values - //there are nothing to optimize because SIZE_OF_GRID_CELL is too big... + // visit all cells, found in CalculateCellArea() + // if radius is known to reach cell area more than 4x4 then we should call optimized VisitCircle + // currently this technique works with MAX_NUMBER_OF_CELLS 16 and higher, with lower values + // there are nothing to optimize because SIZE_OF_GRID_CELL is too big... if (((end_cell.x_coord - begin_cell.x_coord) > 4) && ((end_cell.y_coord - begin_cell.y_coord) > 4)) { VisitCircle(visitor, m, begin_cell, end_cell); return; } - //ALWAYS visit standing cell first!!! Since we deal with small radiuses - //it is very essential to call visitor for standing cell firstly... + // ALWAYS visit standing cell first!!! Since we deal with small radiuses + // it is very essential to call visitor for standing cell firstly... m.Visit(*this, visitor); // loop the cell range @@ -107,7 +107,7 @@ Cell::Visit(const CellPair& standing_cell, TypeContainerVisitor& v for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y) { CellPair cell_pair(x, y); - //lets skip standing cell since we already visited it + // lets skip standing cell since we already visited it if (cell_pair != standing_cell) { Cell r_zone(cell_pair); @@ -122,13 +122,13 @@ template inline void Cell::VisitCircle(TypeContainerVisitor& visitor, Map& m, const CellPair& begin_cell, const CellPair& end_cell) const { - //here is an algorithm for 'filling' circum-squared octagon + // here is an algorithm for 'filling' circum-squared octagon uint32 x_shift = (uint32)ceilf((end_cell.x_coord - begin_cell.x_coord) * 0.3f - 0.5f); - //lets calculate x_start/x_end coords for central strip... + // lets calculate x_start/x_end coords for central strip... const uint32 x_start = begin_cell.x_coord + x_shift; const uint32 x_end = end_cell.x_coord - x_shift; - //visit central strip with constant width... + // visit central strip with constant width... for (uint32 x = x_start; x <= x_end; ++x) { for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y) @@ -140,29 +140,29 @@ Cell::VisitCircle(TypeContainerVisitor& visitor, Map& m, const Cel } } - //if x_shift == 0 then we have too small cell area, which were already - //visited at previous step, so just return from procedure... + // if x_shift == 0 then we have too small cell area, which were already + // visited at previous step, so just return from procedure... if (x_shift == 0) return; uint32 y_start = end_cell.y_coord; uint32 y_end = begin_cell.y_coord; - //now we are visiting borders of an octagon... + // now we are visiting borders of an octagon... for (uint32 step = 1; step <= (x_start - begin_cell.x_coord); ++step) { - //each step reduces strip height by 2 cells... + // each step reduces strip height by 2 cells... y_end += 1; y_start -= 1; for (uint32 y = y_start; y >= y_end; --y) { - //we visit cells symmetrically from both sides, heading from center to sides and from up to bottom - //e.g. filling 2 trapezoids after filling central cell strip... + // we visit cells symmetrically from both sides, heading from center to sides and from up to bottom + // e.g. filling 2 trapezoids after filling central cell strip... CellPair cell_pair_left(x_start - step, y); Cell r_zone_left(cell_pair_left); r_zone_left.data.Part.nocreate = data.Part.nocreate; m.Visit(r_zone_left, visitor); - //right trapezoid cell visit + // right trapezoid cell visit CellPair cell_pair_right(x_end + step, y); Cell r_zone_right(cell_pair_right); r_zone_right.data.Part.nocreate = data.Part.nocreate; diff --git a/src/game/Channel.h b/src/game/Channel.h index d585b11c3..0dd76efe7 100644 --- a/src/game/Channel.h +++ b/src/game/Channel.h @@ -33,9 +33,9 @@ enum ChatNotify { CHAT_JOINED_NOTICE = 0x00, //+ "%s joined channel."; CHAT_LEFT_NOTICE = 0x01, //+ "%s left channel."; - //CHAT_SUSPENDED_NOTICE = 0x01, // "%s left channel."; + // CHAT_SUSPENDED_NOTICE = 0x01, // "%s left channel."; CHAT_YOU_JOINED_NOTICE = 0x02, //+ "Joined Channel: [%s]"; -- You joined - //CHAT_YOU_CHANGED_NOTICE = 0x02, // "Changed Channel: [%s]"; + // CHAT_YOU_CHANGED_NOTICE = 0x02, // "Changed Channel: [%s]"; CHAT_YOU_LEFT_NOTICE = 0x03, //+ "Left Channel: [%s]"; -- You left CHAT_WRONG_PASSWORD_NOTICE = 0x04, //+ "Wrong password for %s."; CHAT_NOT_MEMBER_NOTICE = 0x05, //+ "Not on channel %s."; @@ -95,15 +95,15 @@ class Channel enum ChannelDBCFlags { CHANNEL_DBC_FLAG_NONE = 0x00000, - CHANNEL_DBC_FLAG_INITIAL = 0x00001, // General, Trade, LocalDefense, LFG - CHANNEL_DBC_FLAG_ZONE_DEP = 0x00002, // General, Trade, LocalDefense, GuildRecruitment - CHANNEL_DBC_FLAG_GLOBAL = 0x00004, // WorldDefense - CHANNEL_DBC_FLAG_TRADE = 0x00008, // Trade - CHANNEL_DBC_FLAG_CITY_ONLY = 0x00010, // Trade, GuildRecruitment - CHANNEL_DBC_FLAG_CITY_ONLY2 = 0x00020, // Trade, GuildRecruitment - CHANNEL_DBC_FLAG_DEFENSE = 0x10000, // LocalDefense, WorldDefense - CHANNEL_DBC_FLAG_GUILD_REQ = 0x20000, // GuildRecruitment - CHANNEL_DBC_FLAG_LFG = 0x40000 // LookingForGroup + CHANNEL_DBC_FLAG_INITIAL = 0x00001, // General, Trade, LocalDefense, LFG + CHANNEL_DBC_FLAG_ZONE_DEP = 0x00002, // General, Trade, LocalDefense, GuildRecruitment + CHANNEL_DBC_FLAG_GLOBAL = 0x00004, // WorldDefense + CHANNEL_DBC_FLAG_TRADE = 0x00008, // Trade + CHANNEL_DBC_FLAG_CITY_ONLY = 0x00010, // Trade, GuildRecruitment + CHANNEL_DBC_FLAG_CITY_ONLY2 = 0x00020, // Trade, GuildRecruitment + CHANNEL_DBC_FLAG_DEFENSE = 0x10000, // LocalDefense, WorldDefense + CHANNEL_DBC_FLAG_GUILD_REQ = 0x20000, // GuildRecruitment + CHANNEL_DBC_FLAG_LFG = 0x40000 // LookingForGroup }; enum ChannelMemberFlags @@ -182,8 +182,8 @@ class Channel void Invite(ObjectGuid p, const char* newp); void Voice(ObjectGuid guid1, ObjectGuid guid2); void DeVoice(ObjectGuid guid1, ObjectGuid guid2); - void JoinNotify(ObjectGuid guid); // invisible notify - void LeaveNotify(ObjectGuid guid); // invisible notify + void JoinNotify(ObjectGuid guid); // invisible notify + void LeaveNotify(ObjectGuid guid); // invisible notify private: // initial packet data (notify type and channel name) diff --git a/src/game/ChannelHandler.cpp b/src/game/ChannelHandler.cpp index 1179c7ffc..1d40f8c25 100644 --- a/src/game/ChannelHandler.cpp +++ b/src/game/ChannelHandler.cpp @@ -42,7 +42,7 @@ void WorldSession::HandleJoinChannelOpcode(WorldPacket& recvPacket) void WorldSession::HandleLeaveChannelOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); uint32 unk; std::string channelname; @@ -63,7 +63,7 @@ void WorldSession::HandleLeaveChannelOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelListOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); std::string channelname; recvPacket >> channelname; @@ -75,7 +75,7 @@ void WorldSession::HandleChannelListOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelPasswordOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); std::string channelname, pass; recvPacket >> channelname; @@ -89,7 +89,7 @@ void WorldSession::HandleChannelPasswordOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelSetOwnerOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); std::string channelname, newp; recvPacket >> channelname; @@ -107,7 +107,7 @@ void WorldSession::HandleChannelSetOwnerOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelOwnerOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); std::string channelname; recvPacket >> channelname; if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) @@ -118,7 +118,7 @@ void WorldSession::HandleChannelOwnerOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelModeratorOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -135,7 +135,7 @@ void WorldSession::HandleChannelModeratorOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelUnmoderatorOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -152,7 +152,7 @@ void WorldSession::HandleChannelUnmoderatorOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelMuteOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -169,7 +169,7 @@ void WorldSession::HandleChannelMuteOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelUnmuteOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -187,7 +187,7 @@ void WorldSession::HandleChannelUnmuteOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelInviteOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -204,7 +204,7 @@ void WorldSession::HandleChannelInviteOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelKickOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -220,7 +220,7 @@ void WorldSession::HandleChannelKickOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelBanOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -237,7 +237,7 @@ void WorldSession::HandleChannelBanOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelUnbanOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -255,7 +255,7 @@ void WorldSession::HandleChannelUnbanOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelAnnouncementsOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); std::string channelname; recvPacket >> channelname; if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) @@ -266,7 +266,7 @@ void WorldSession::HandleChannelAnnouncementsOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelModerateOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); std::string channelname; recvPacket >> channelname; if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) @@ -277,7 +277,7 @@ void WorldSession::HandleChannelModerateOpcode(WorldPacket& recvPacket) void WorldSession::HandleChannelDisplayListQueryOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); std::string channelname; recvPacket >> channelname; if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) @@ -288,7 +288,7 @@ void WorldSession::HandleChannelDisplayListQueryOpcode(WorldPacket& recvPacket) void WorldSession::HandleGetChannelMemberCountOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); std::string channelname; recvPacket >> channelname; if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) @@ -307,7 +307,7 @@ void WorldSession::HandleGetChannelMemberCountOpcode(WorldPacket& recvPacket) void WorldSession::HandleSetChannelWatchOpcode(WorldPacket& recvPacket) { DEBUG_LOG("Opcode %u", recvPacket.GetOpcode()); - //recvPacket.hexlike(); + // recvPacket.hexlike(); std::string channelname; recvPacket >> channelname; /*if(ChannelMgr* cMgr = channelMgr(_player->GetTeam())) diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index eea40b9d0..f5da834b6 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -641,7 +641,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) DEBUG_LOG("WORLD: Sent motd (SMSG_MOTD)"); } - //QueryResult *result = CharacterDatabase.PQuery("SELECT guildid,rank FROM guild_member WHERE guid = '%u'",pCurrChar->GetGUIDLow()); + // QueryResult *result = CharacterDatabase.PQuery("SELECT guildid,rank FROM guild_member WHERE guid = '%u'",pCurrChar->GetGUIDLow()); QueryResult* resultGuild = holder->GetResult(PLAYER_LOGIN_QUERY_LOADGUILD); if (resultGuild) @@ -688,7 +688,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) pCurrChar->SendInitialPacketsBeforeAddToMap(); - //Show cinematic at the first time that player login + // Show cinematic at the first time that player login if (!pCurrChar->getCinematic()) { pCurrChar->setCinematic(1); @@ -713,7 +713,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) } sObjectAccessor.AddObject(pCurrChar); - //DEBUG_LOG("Player %s added to Map.",pCurrChar->GetName()); + // DEBUG_LOG("Player %s added to Map.",pCurrChar->GetName()); pCurrChar->SendInitialPacketsAfterAddToMap(); @@ -836,7 +836,7 @@ void WorldSession::HandleTutorialFlagOpcode(WorldPacket& recv_data) uint32 wInt = (iFlag / 32); if (wInt >= 8) { - //sLog.outError("CHEATER? Account:[%d] Guid[%u] tried to send wrong CMSG_TUTORIAL_FLAG", GetAccountId(),GetGUID()); + // sLog.outError("CHEATER? Account:[%d] Guid[%u] tried to send wrong CMSG_TUTORIAL_FLAG", GetAccountId(),GetGUID()); return; } uint32 rInt = (iFlag % 32); @@ -845,7 +845,7 @@ void WorldSession::HandleTutorialFlagOpcode(WorldPacket& recv_data) tutflag |= (1 << rInt); SetTutorialInt(wInt, tutflag); - //DEBUG_LOG("Received Tutorial Flag Set {%u}.", iFlag); + // DEBUG_LOG("Received Tutorial Flag Set {%u}.", iFlag); } void WorldSession::HandleTutorialClearOpcode(WorldPacket& /*recv_data*/) diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index e103a0c70..27036ef22 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -1328,7 +1328,7 @@ bool ChatHandler::ParseCommands(const char* text) MANGOS_ASSERT(text); MANGOS_ASSERT(*text); - //if(m_session->GetSecurity() == SEC_PLAYER) + // if(m_session->GetSecurity() == SEC_PLAYER) // return false; /// chat case (.command or !command format) @@ -2042,7 +2042,7 @@ bool ChatHandler::isValidChatMessage(const char* message) return validSequence == validSequenceIterator; } -//Note: target_guid used only in CHAT_MSG_WHISPER_INFORM mode (in this case channelName ignored) +// Note: target_guid used only in CHAT_MSG_WHISPER_INFORM mode (in this case channelName ignored) void ChatHandler::FillMessageData(WorldPacket* data, WorldSession* session, uint8 type, uint32 language, const char* channelName, ObjectGuid targetGuid, const char* message, Unit* speaker) { uint32 messageLength = (message ? strlen(message) : 0) + 1; diff --git a/src/game/Chat.h b/src/game/Chat.h index b616300fc..37e19f2a2 100644 --- a/src/game/Chat.h +++ b/src/game/Chat.h @@ -365,7 +365,7 @@ class MANGOS_DLL_SPEC ChatHandler bool HandleNpcWhisperCommand(char* args); bool HandleNpcYellCommand(char* args); - //TODO: NpcCommands that needs to be fixed : + // TODO: NpcCommands that needs to be fixed : bool HandleNpcAddWeaponCommand(char* args); bool HandleNpcNameCommand(char* args); bool HandleNpcSubNameCommand(char* args); diff --git a/src/game/ChatHandler.cpp b/src/game/ChatHandler.cpp index 3e5366e41..b3ddd38cf 100644 --- a/src/game/ChatHandler.cpp +++ b/src/game/ChatHandler.cpp @@ -386,7 +386,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recv_data) return; WorldPacket data; - //in battleground, raid warning is sent only to players in battleground - code is ok + // in battleground, raid warning is sent only to players in battleground - code is ok ChatHandler::FillMessageData(&data, this, CHAT_MSG_RAID_WARNING, lang, msg.c_str()); group->BroadcastPacket(&data, false); } break; @@ -600,7 +600,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recv_data) GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit); - //Send scripted event call + // Send scripted event call if (unit && unit->GetTypeId() == TYPEID_UNIT && ((Creature*)unit)->AI()) ((Creature*)unit)->AI()->ReceiveEmote(GetPlayer(), text_emote); } @@ -609,7 +609,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data) { ObjectGuid iguid; uint8 unk; - //DEBUG_LOG("WORLD: Received CMSG_CHAT_IGNORED"); + // DEBUG_LOG("WORLD: Received CMSG_CHAT_IGNORED"); recv_data >> iguid; recv_data >> unk; // probably related to spam reporting diff --git a/src/game/CombatHandler.cpp b/src/game/CombatHandler.cpp index 1c958cdf3..38920faa6 100644 --- a/src/game/CombatHandler.cpp +++ b/src/game/CombatHandler.cpp @@ -78,7 +78,7 @@ void WorldSession::HandleSetSheathedOpcode(WorldPacket& recv_data) uint32 sheathed; recv_data >> sheathed; - //DEBUG_LOG( "WORLD: Recvd CMSG_SETSHEATHED Message guidlow:%u value1:%u", GetPlayer()->GetGUIDLow(), sheathed ); + // DEBUG_LOG( "WORLD: Recvd CMSG_SETSHEATHED Message guidlow:%u value1:%u", GetPlayer()->GetGUIDLow(), sheathed ); if (sheathed >= MAX_SHEATH_STATE) { diff --git a/src/game/Corpse.cpp b/src/game/Corpse.cpp index 733df3480..a09087e95 100644 --- a/src/game/Corpse.cpp +++ b/src/game/Corpse.cpp @@ -78,8 +78,8 @@ bool Corpse::Create(uint32 guidlow, Player* owner) WorldObject::_Create(guidlow, HIGHGUID_CORPSE, owner->GetPhaseMask()); Relocate(owner->GetPositionX(), owner->GetPositionY(), owner->GetPositionZ(), owner->GetOrientation()); - //we need to assign owner's map for corpse - //in other way we will get a crash in Corpse::SaveToDB() + // we need to assign owner's map for corpse + // in other way we will get a crash in Corpse::SaveToDB() SetMap(owner->GetMap()); if (!IsPositionValid()) @@ -152,7 +152,7 @@ void Corpse::DeleteFromDB() bool Corpse::LoadFromDB(uint32 lowguid, Field* fields) { //// 0 1 2 3 4 5 6 - //QueryResult *result = CharacterDatabase.Query("SELECT corpse.guid, player, corpse.position_x, corpse.position_y, corpse.position_z, corpse.orientation, corpse.map," + // QueryResult *result = CharacterDatabase.Query("SELECT corpse.guid, player, corpse.position_x, corpse.position_y, corpse.position_z, corpse.orientation, corpse.map," //// 7 8 9 10 11 12 13 14 15 16 17 18 // "time, corpse_type, instance, phaseMask, gender, race, class, playerBytes, playerBytes2, equipmentCache, guildId, playerFlags FROM corpse" uint32 playerLowGuid = fields[1].GetUInt32(); diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 39cae819b..545ec1694 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -503,7 +503,7 @@ void Creature::Update(uint32 update_diff, uint32 diff) else SetDeathState(JUST_ALIVED); - //Call AI respawn virtual function + // Call AI respawn virtual function if (AI()) AI()->JustRespawned(); @@ -750,9 +750,9 @@ bool Creature::Create(uint32 guidlow, CreatureCreatePos& cPos, CreatureInfo cons if (!cPos.Relocate(this)) return false; - //Notify the map's instance data. - //Only works if you create the object in it, not if it is moves to that map. - //Normally non-players do not teleport to other maps. + // Notify the map's instance data. + // Only works if you create the object in it, not if it is moves to that map. + // Normally non-players do not teleport to other maps. if (InstanceData* iData = GetMap()->GetInstanceData()) iData->OnCreatureCreate(this); @@ -1129,13 +1129,13 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) << data.posY << "," << data.posZ << "," << data.orientation << "," - << data.spawntimesecs << "," //respawn time - << (float) data.spawndist << "," //spawn distance (float) - << data.currentwaypoint << "," //currentwaypoint - << data.curhealth << "," //curhealth - << data.curmana << "," //curmana - << (data.is_dead ? 1 : 0) << "," //is_dead - << uint32(data.movementType) << ")"; //default movement generator type, cast to prevent save as symbol + << data.spawntimesecs << "," // respawn time + << (float) data.spawndist << "," // spawn distance (float) + << data.currentwaypoint << "," // currentwaypoint + << data.curhealth << "," // curhealth + << data.curmana << "," // curmana + << (data.is_dead ? 1 : 0) << "," // is_dead + << uint32(data.movementType) << ")"; // default movement generator type, cast to prevent save as symbol WorldDatabase.PExecuteLog("%s", ss.str().c_str()); @@ -1175,7 +1175,7 @@ void Creature::SelectLevel(const CreatureInfo* cinfo, float percentHealth, float uint32 mana = minmana + uint32(rellevel * (maxmana - minmana)); SetCreateMana(mana); - SetMaxPower(POWER_MANA, mana); //MAX Mana + SetMaxPower(POWER_MANA, mana); // MAX Mana SetPower(POWER_MANA, mana); // TODO: set UNIT_FIELD_POWER*, for some creature class case (energy, etc) @@ -1655,7 +1655,7 @@ SpellEntry const* Creature::ReachWithSpellAttack(Unit* pVictim) float dist = GetCombatDistance(pVictim); - //if(!isInFront( pVictim, range ) && spellInfo->AttributesEx ) + // if(!isInFront( pVictim, range ) && spellInfo->AttributesEx ) // continue; if (dist > range || dist < minrange) continue; @@ -1704,7 +1704,7 @@ SpellEntry const* Creature::ReachWithSpellCure(Unit* pVictim) float dist = GetCombatDistance(pVictim); - //if(!isInFront( pVictim, range ) && spellInfo->AttributesEx ) + // if(!isInFront( pVictim, range ) && spellInfo->AttributesEx ) // continue; if (dist > range || dist < minrange) continue; @@ -1889,7 +1889,7 @@ bool Creature::IsOutOfThreatArea(Unit* pVictim) const float AttackDist = GetAttackDistance(pVictim); float ThreatRadius = sWorld.getConfig(CONFIG_FLOAT_THREAT_RADIUS); - //Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and out of combat every update tick. + // Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and out of combat every update tick. return !pVictim->IsWithinDist3d(m_combatStartX, m_combatStartY, m_combatStartZ, ThreatRadius > AttackDist ? ThreatRadius : AttackDist); } @@ -1911,7 +1911,7 @@ CreatureDataAddon const* Creature::GetCreatureAddon() const return ObjectMgr::GetCreatureTemplateAddon(GetEntry()); } -//creature_addon table +// creature_addon table bool Creature::LoadCreatureAddon(bool reload) { CreatureDataAddon const* cainfo = GetCreatureAddon(); @@ -1929,7 +1929,7 @@ bool Creature::LoadCreatureAddon(bool reload) // 3 StandMiscFlags SetByteValue(UNIT_FIELD_BYTES_1, 0, uint8(cainfo->bytes1 & 0xFF)); - //SetByteValue(UNIT_FIELD_BYTES_1, 1, uint8((cainfo->bytes1 >> 8) & 0xFF)); + // SetByteValue(UNIT_FIELD_BYTES_1, 1, uint8((cainfo->bytes1 >> 8) & 0xFF)); SetByteValue(UNIT_FIELD_BYTES_1, 1, 0); SetByteValue(UNIT_FIELD_BYTES_1, 2, uint8((cainfo->bytes1 >> 16) & 0xFF)); SetByteValue(UNIT_FIELD_BYTES_1, 3, uint8((cainfo->bytes1 >> 24) & 0xFF)); @@ -1945,8 +1945,8 @@ bool Creature::LoadCreatureAddon(bool reload) if (cainfo->pvp_state != 0) SetByteValue(UNIT_FIELD_BYTES_2, 1, cainfo->pvp_state); - //SetByteValue(UNIT_FIELD_BYTES_2, 2, 0); - //SetByteValue(UNIT_FIELD_BYTES_2, 3, 0); + // SetByteValue(UNIT_FIELD_BYTES_2, 2, 0); + // SetByteValue(UNIT_FIELD_BYTES_2, 3, 0); if (cainfo->emote != 0) SetUInt32Value(UNIT_NPC_EMOTESTATE, cainfo->emote); @@ -2223,7 +2223,7 @@ void Creature::GetRespawnCoord(float& x, float& y, float& z, float* ori, float* *dist = GetRespawnRadius(); } - //lets check if our creatures have valid spawn coordinates + // lets check if our creatures have valid spawn coordinates MANGOS_ASSERT(MaNGOS::IsValidMapCoord(x, y, z) || PrintCoordinatesError(x, y, z, "respawn")); } @@ -2494,7 +2494,7 @@ struct SpawnCreatureInMapsWorker if (map->IsLoaded(i_data->posX, i_data->posY)) { Creature* pCreature = new Creature; - //DEBUG_LOG("Spawning creature %u",*itr); + // DEBUG_LOG("Spawning creature %u",*itr); if (!pCreature->LoadFromDB(i_guid, map)) { delete pCreature; diff --git a/src/game/Creature.h b/src/game/Creature.h index 6c824929a..256885bb8 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -292,9 +292,9 @@ enum ChatType // Selection method used by SelectAttackingTarget enum AttackingTarget { - ATTACKING_TARGET_RANDOM = 0, //Just selects a random target - ATTACKING_TARGET_TOPAGGRO, //Selects targes from top aggro to bottom - ATTACKING_TARGET_BOTTOMAGGRO, //Selects targets from bottom aggro to top + ATTACKING_TARGET_RANDOM = 0, // Just selects a random target + ATTACKING_TARGET_TOPAGGRO, // Selects targes from top aggro to bottom + ATTACKING_TARGET_BOTTOMAGGRO, // Selects targets from bottom aggro to top }; enum SelectFlags diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h index c26ebd2d8..1f03f90f1 100644 --- a/src/game/CreatureAI.h +++ b/src/game/CreatureAI.h @@ -51,12 +51,12 @@ enum CanCastResult enum CastFlags { - CAST_INTERRUPT_PREVIOUS = 0x01, //Interrupt any spell casting - CAST_TRIGGERED = 0x02, //Triggered (this makes spell cost zero mana and have no cast time) - CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range - CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range - CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself - CAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell + CAST_INTERRUPT_PREVIOUS = 0x01, // Interrupt any spell casting + CAST_TRIGGERED = 0x02, // Triggered (this makes spell cost zero mana and have no cast time) + CAST_FORCE_CAST = 0x04, // Forces cast even if creature is out of mana or out of range + CAST_NO_MELEE_IF_OOM = 0x08, // Prevents creature from entering melee if out of mana or out of range + CAST_FORCE_TARGET_SELF = 0x10, // Forces the target to cast this spell on itself + CAST_AURA_NOT_PRESENT = 0x20, // Only casts the spell if the target does not have an aura from the spell }; class MANGOS_DLL_SPEC CreatureAI diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index 11fb045bc..c95533719 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -70,7 +70,7 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c) uint32 events_count = 0; for (CreatureEventAI_Event_Vec::const_iterator i = (*creatureEventsItr).second.begin(); i != (*creatureEventsItr).second.end(); ++i) { - //Debug check + // Debug check #ifndef MANGOS_DEBUG if ((*i).event_flags & EFLAG_DEBUG_ONLY) continue; @@ -85,7 +85,7 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c) else ++events_count; } - //EventMap had events but they were not added because they must be for instance + // EventMap had events but they were not added because they must be for instance if (events_count == 0) sLog.outError("CreatureEventAI: Creature %u has events but no events added to list because of instance flags.", m_creature->GetEntry()); else @@ -94,7 +94,7 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c) for (CreatureEventAI_Event_Vec::const_iterator i = (*creatureEventsItr).second.begin(); i != (*creatureEventsItr).second.end(); ++i) { - //Debug check + // Debug check #ifndef MANGOS_DEBUG if ((*i).event_flags & EFLAG_DEBUG_ONLY) continue; @@ -103,7 +103,7 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c) { if ((1 << (m_creature->GetMap()->GetSpawnMode() + 1)) & (*i).event_flags) { - //event flagged for instance mode + // event flagged for instance mode m_CreatureEventAIList.push_back(CreatureEventAIHolder(*i)); } } @@ -124,7 +124,7 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c) m_InvinceabilityHpLevel = 0; - //Handle Spawned Events + // Handle Spawned Events if (!m_bEmptyList) { for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) @@ -139,27 +139,27 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction if (!pHolder.Enabled || pHolder.Time) return false; - //Check the inverse phase mask (event doesn't trigger if current phase bit is set in mask) + // Check the inverse phase mask (event doesn't trigger if current phase bit is set in mask) if (pHolder.Event.event_inverse_phase_mask & (1 << m_Phase)) return false; CreatureEventAI_Event const& event = pHolder.Event; - //Check event conditions based on the event type, also reset events + // Check event conditions based on the event type, also reset events switch (event.event_type) { case EVENT_T_TIMER: if (!m_creature->isInCombat()) return false; - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.timer.repeatMin, event.timer.repeatMax); break; case EVENT_T_TIMER_OOC: if (m_creature->isInCombat() || m_creature->IsInEvadeMode()) return false; - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.timer.repeatMin, event.timer.repeatMax); break; case EVENT_T_HP: @@ -172,7 +172,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin) return false; - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.percent_range.repeatMin, event.percent_range.repeatMax); break; } @@ -186,31 +186,31 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin) return false; - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.percent_range.repeatMin, event.percent_range.repeatMax); break; } case EVENT_T_AGGRO: break; case EVENT_T_KILL: - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.kill.repeatMin, event.kill.repeatMax); break; case EVENT_T_DEATH: case EVENT_T_EVADE: break; case EVENT_T_SPELLHIT: - //Spell hit is special case, param1 and param2 handled within CreatureEventAI::SpellHit + // Spell hit is special case, param1 and param2 handled within CreatureEventAI::SpellHit - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.spell_hit.repeatMin, event.spell_hit.repeatMax); break; case EVENT_T_RANGE: - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.range.repeatMin, event.range.repeatMax); break; case EVENT_T_OOC_LOS: - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.ooc_los.repeatMin, event.ooc_los.repeatMax); break; case EVENT_T_SPAWNED: @@ -225,7 +225,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin) return false; - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.percent_range.repeatMin, event.percent_range.repeatMax); break; } @@ -233,7 +233,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction if (!m_creature->isInCombat() || !m_creature->getVictim() || !m_creature->getVictim()->IsNonMeleeSpellCasted(false, false, true)) return false; - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.target_casting.repeatMin, event.target_casting.repeatMax); break; case EVENT_T_FRIENDLY_HP: @@ -247,7 +247,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction pActionInvoker = pUnit; - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.friendly_hp.repeatMin, event.friendly_hp.repeatMax); break; } @@ -259,14 +259,14 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction std::list pList; DoFindFriendlyCC(pList, (float)event.friendly_is_cc.radius); - //List is empty + // List is empty if (pList.empty()) return false; - //We don't really care about the whole list, just return first available + // We don't really care about the whole list, just return first available pActionInvoker = *(pList.begin()); - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.friendly_is_cc.repeatMin, event.friendly_is_cc.repeatMax); break; } @@ -275,14 +275,14 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction std::list pList; DoFindFriendlyMissingBuff(pList, (float)event.friendly_buff.radius, event.friendly_buff.spellId); - //List is empty + // List is empty if (pList.empty()) return false; - //We don't really care about the whole list, just return first available + // We don't really care about the whole list, just return first available pActionInvoker = *(pList.begin()); - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.friendly_buff.repeatMin, event.friendly_buff.repeatMax); break; } @@ -290,15 +290,15 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction case EVENT_T_SUMMONED_JUST_DIED: case EVENT_T_SUMMONED_JUST_DESPAWN: { - //Prevent event from occuring on no unit or non creatures + // Prevent event from occuring on no unit or non creatures if (!pActionInvoker || pActionInvoker->GetTypeId() != TYPEID_UNIT) return false; - //Creature id doesn't match up + // Creature id doesn't match up if (((Creature*)pActionInvoker)->GetEntry() != event.summoned.creatureId) return false; - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.summoned.repeatMin, event.summoned.repeatMax); break; } @@ -312,7 +312,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction if (perc > event.percent_range.percentMax || perc < event.percent_range.percentMin) return false; - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.percent_range.repeatMin, event.percent_range.repeatMax); break; } @@ -325,7 +325,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction if (!holder || holder->GetStackAmount() < event.buffed.amount) return false; - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.buffed.repeatMin, event.buffed.repeatMax); break; } @@ -338,7 +338,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction if (!holder || holder->GetStackAmount() < event.buffed.amount) return false; - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.buffed.repeatMin, event.buffed.repeatMax); break; } @@ -348,7 +348,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction if (holder && holder->GetStackAmount() >= event.buffed.amount) return false; - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.buffed.repeatMin, event.buffed.repeatMax); break; } @@ -361,7 +361,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction if (holder && holder->GetStackAmount() >= event.buffed.amount) return false; - //Repeat Timers + // Repeat Timers pHolder.UpdateRepeatTimer(m_creature, event.buffed.repeatMin, event.buffed.repeatMax); break; } @@ -370,24 +370,24 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction break; } - //Disable non-repeatable events + // Disable non-repeatable events if (!(pHolder.Event.event_flags & EFLAG_REPEATABLE)) pHolder.Enabled = false; - //Store random here so that all random actions match up + // Store random here so that all random actions match up uint32 rnd = rand(); - //Return if chance for event is not met + // Return if chance for event is not met if (pHolder.Event.event_chance <= rnd % 100) return false; - //Process actions, normal case + // Process actions, normal case if (!(pHolder.Event.event_flags & EFLAG_RANDOM_ACTION)) { for (uint32 j = 0; j < MAX_ACTIONS; ++j) ProcessAction(pHolder.Event.action[j], rnd, pHolder.Event.event_id, pActionInvoker); } - //Process actions, random case + // Process actions, random case else { // amount of real actions @@ -476,7 +476,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 { if (action.morph.creatureId || action.morph.modelId) { - //set model based on entry from creature_template + // set model based on entry from creature_template if (action.morph.creatureId) { if (CreatureInfo const* ci = ObjectMgr::GetCreatureTemplate(action.morph.creatureId)) @@ -485,7 +485,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 m_creature->SetDisplayId(display_id); } } - //if no param1, then use value from param2 (modelId) + // if no param1, then use value from param2 (modelId) else m_creature->SetDisplayId(action.morph.modelId); } @@ -625,7 +625,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 m_CombatMovementEnabled = action.combat_movement.state != 0; - //Allow movement (create new targeted movement gen only if idle) + // Allow movement (create new targeted movement gen only if idle) if (m_CombatMovementEnabled) { if (action.combat_movement.melee && m_creature->isInCombat()) @@ -703,7 +703,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 { if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) { - //Drop current movement gen + // Drop current movement gen m_creature->GetMotionMaster()->Clear(false); m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), m_AttackDistance, m_AttackAngle); } @@ -743,12 +743,12 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 break; } case ACTION_T_KILLED_MONSTER: - //first attempt player/group who tapped creature + // first attempt player/group who tapped creature if (Player* pPlayer = m_creature->GetLootRecipient()) pPlayer->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, m_creature); else { - //if not available, use pActionInvoker + // if not available, use pActionInvoker if (Unit* pTarget = GetTargetByType(action.killed_monster.target, pActionInvoker)) if (Player* pPlayer2 = pTarget->GetCharmerOrOwnerPlayerOrPlayerItself()) pPlayer2->RewardPlayerAndGroupAtEvent(action.killed_monster.creatureId, m_creature); @@ -845,7 +845,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 m_creature->Mount(display_id); } } - //if no param1, then use value from param2 (modelId) + // if no param1, then use value from param2 (modelId) else m_creature->Mount(action.mount.modelId); } @@ -864,7 +864,7 @@ void CreatureEventAI::JustRespawned() if (m_bEmptyList) return; - //Handle Spawned Events + // Handle Spawned Events for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) if (SpawnedEventConditionsCheck((*i).Event)) ProcessEvent(*i); @@ -878,24 +878,24 @@ void CreatureEventAI::Reset() if (m_bEmptyList) return; - //Reset all events to enabled + // Reset all events to enabled for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) { CreatureEventAI_Event const& event = (*i).Event; switch (event.event_type) { - //Reset all out of combat timers + // Reset all out of combat timers case EVENT_T_TIMER_OOC: { if ((*i).UpdateRepeatTimer(m_creature, event.timer.initialMin, event.timer.initialMax)) (*i).Enabled = true; break; } - //default: - //TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void Aggro() + // default: + // TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void Aggro() //(*i).Enabled = true; //(*i).Time = 0; - //break; + // break; } } } @@ -928,7 +928,7 @@ void CreatureEventAI::EnterEvadeMode() if (m_bEmptyList) return; - //Handle Evade events + // Handle Evade events for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) { if ((*i).Event.event_type == EVENT_T_EVADE) @@ -942,7 +942,7 @@ void CreatureEventAI::JustDied(Unit* killer) if (m_creature->IsGuard()) { - //Send Zone Under Attack message to the LocalDefense and WorldDefense Channels + // Send Zone Under Attack message to the LocalDefense and WorldDefense Channels if (Player* pKiller = killer->GetCharmerOrOwnerPlayerOrPlayerItself()) m_creature->SendZoneUnderAttackMessage(pKiller); } @@ -950,7 +950,7 @@ void CreatureEventAI::JustDied(Unit* killer) if (m_bEmptyList) return; - //Handle Evade events + // Handle Evade events for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) { if ((*i).Event.event_type == EVENT_T_DEATH) @@ -1011,7 +1011,7 @@ void CreatureEventAI::SummonedCreatureDespawn(Creature* pUnit) void CreatureEventAI::EnterCombat(Unit* enemy) { - //Check for on combat start events + // Check for on combat start events if (!m_bEmptyList) { for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) @@ -1023,12 +1023,12 @@ void CreatureEventAI::EnterCombat(Unit* enemy) (*i).Enabled = true; ProcessEvent(*i, enemy); break; - //Reset all in combat timers + // Reset all in combat timers case EVENT_T_TIMER: if ((*i).UpdateRepeatTimer(m_creature, event.timer.initialMin, event.timer.initialMax)) (*i).Enabled = true; break; - //All normal events need to be re-enabled and their time set to 0 + // All normal events need to be re-enabled and their time set to 0 default: (*i).Enabled = true; (*i).Time = 0; @@ -1069,20 +1069,20 @@ void CreatureEventAI::MoveInLineOfSight(Unit* who) if (!who) return; - //Check for OOC LOS Event + // Check for OOC LOS Event if (!m_bEmptyList && !m_creature->getVictim()) { for (CreatureEventAIList::iterator itr = m_CreatureEventAIList.begin(); itr != m_CreatureEventAIList.end(); ++itr) { if ((*itr).Event.event_type == EVENT_T_OOC_LOS) { - //can trigger if closer than fMaxAllowedRange + // can trigger if closer than fMaxAllowedRange float fMaxAllowedRange = (float)(*itr).Event.ooc_los.maxRange; - //if range is ok and we are actually in LOS + // if range is ok and we are actually in LOS if (m_creature->IsWithinDistInMap(who, fMaxAllowedRange) && m_creature->IsWithinLOSInMap(who)) { - //if friendly event&&who is not hostile OR hostile event&&who is hostile + // if friendly event&&who is not hostile OR hostile event&&who is hostile if (((*itr).Event.ooc_los.noHostile && !m_creature->IsHostileTo(who)) || ((!(*itr).Event.ooc_los.noHostile) && m_creature->IsHostileTo(who))) ProcessEvent(*itr, who); @@ -1125,7 +1125,7 @@ void CreatureEventAI::SpellHit(Unit* pUnit, const SpellEntry* pSpell) for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) if ((*i).Event.event_type == EVENT_T_SPELLHIT) - //If spell id matches (or no spell id) & if spell school matches (or no spell school) + // If spell id matches (or no spell id) & if spell school matches (or no spell school) if (!(*i).Event.spell_hit.spellId || pSpell->Id == (*i).Event.spell_hit.spellId) if (pSpell->SchoolMask & (*i).Event.spell_hit.schoolMask) ProcessEvent(*i, pUnit); @@ -1133,35 +1133,35 @@ void CreatureEventAI::SpellHit(Unit* pUnit, const SpellEntry* pSpell) void CreatureEventAI::UpdateAI(const uint32 diff) { - //Check if we are in combat (also updates calls threat update code) + // Check if we are in combat (also updates calls threat update code) bool Combat = m_creature->SelectHostileTarget() && m_creature->getVictim(); if (!m_bEmptyList) { - //Events are only updated once every EVENT_UPDATE_TIME ms to prevent lag with large amount of events + // Events are only updated once every EVENT_UPDATE_TIME ms to prevent lag with large amount of events if (m_EventUpdateTime < diff) { m_EventDiff += diff; - //Check for time based events + // Check for time based events for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) { - //Decrement Timers + // Decrement Timers if ((*i).Time) { if ((*i).Time > m_EventDiff) { - //Do not decrement timers if event cannot trigger in this phase + // Do not decrement timers if event cannot trigger in this phase if (!((*i).Event.event_inverse_phase_mask & (1 << m_Phase))) (*i).Time -= m_EventDiff; - //Skip processing of events that have time remaining + // Skip processing of events that have time remaining continue; } else (*i).Time = 0; } - //Events that are updated every EVENT_UPDATE_TIME + // Events that are updated every EVENT_UPDATE_TIME switch ((*i).Event.event_type) { case EVENT_T_TIMER_OOC: @@ -1201,7 +1201,7 @@ void CreatureEventAI::UpdateAI(const uint32 diff) } } - //Melee Auto-Attack + // Melee Auto-Attack if (Combat && m_MeleeEnabled) DoMeleeAttackIfReady(); } @@ -1365,16 +1365,16 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit* bool CreatureEventAI::CanCast(Unit* Target, SpellEntry const* Spell, bool Triggered) { - //No target so we can't cast + // No target so we can't cast if (!Target || !Spell) return false; - //Silenced so we can't cast + // Silenced so we can't cast if (!Triggered && (m_creature->hasUnitState(UNIT_STAT_CAN_NOT_REACT_OR_LOST_CONTROL) || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED))) return false; - //Check for power + // Check for power if (!Triggered && m_creature->GetPower((Powers)Spell->powerType) < Spell::CalculatePowerCost(Spell, m_creature)) return false; @@ -1382,11 +1382,11 @@ bool CreatureEventAI::CanCast(Unit* Target, SpellEntry const* Spell, bool Trigge TempRange = GetSpellRangeStore()->LookupEntry(Spell->rangeIndex); - //Spell has invalid range store so we can't use it + // Spell has invalid range store so we can't use it if (!TempRange) return false; - //Unit is out of range of this spell + // Unit is out of range of this spell if (!m_creature->IsInRange(Target, TempRange->minRange, TempRange->maxRange)) return false; diff --git a/src/game/CreatureEventAI.h b/src/game/CreatureEventAI.h index d62bd2fa8..941d6b39e 100644 --- a/src/game/CreatureEventAI.h +++ b/src/game/CreatureEventAI.h @@ -117,25 +117,25 @@ enum EventAI_ActionType enum Target { - //Self (m_creature) - TARGET_T_SELF = 0, //Self cast + // Self (m_creature) + TARGET_T_SELF = 0, // Self cast - //Hostile targets (if pet then returns pet owner) - TARGET_T_HOSTILE, //Our current target (ie: highest aggro) - TARGET_T_HOSTILE_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks) - TARGET_T_HOSTILE_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for) - TARGET_T_HOSTILE_RANDOM, //Just any random target on our threat list - TARGET_T_HOSTILE_RANDOM_NOT_TOP, //Any random target except top threat + // Hostile targets (if pet then returns pet owner) + TARGET_T_HOSTILE, // Our current target (ie: highest aggro) + TARGET_T_HOSTILE_SECOND_AGGRO, // Second highest aggro (generaly used for cleaves and some special attacks) + TARGET_T_HOSTILE_LAST_AGGRO, // Dead last on aggro (no idea what this could be used for) + TARGET_T_HOSTILE_RANDOM, // Just any random target on our threat list + TARGET_T_HOSTILE_RANDOM_NOT_TOP, // Any random target except top threat - //Invoker targets (if pet then returns pet owner) - TARGET_T_ACTION_INVOKER, //Unit who caused this Event to occur (only works for EVENT_T_AGGRO, EVENT_T_KILL, EVENT_T_DEATH, EVENT_T_SPELLHIT, EVENT_T_OOC_LOS, EVENT_T_FRIENDLY_HP, EVENT_T_FRIENDLY_IS_CC, EVENT_T_FRIENDLY_MISSING_BUFF) + // Invoker targets (if pet then returns pet owner) + TARGET_T_ACTION_INVOKER, // Unit who caused this Event to occur (only works for EVENT_T_AGGRO, EVENT_T_KILL, EVENT_T_DEATH, EVENT_T_SPELLHIT, EVENT_T_OOC_LOS, EVENT_T_FRIENDLY_HP, EVENT_T_FRIENDLY_IS_CC, EVENT_T_FRIENDLY_MISSING_BUFF) - //Hostile targets (including pets) - TARGET_T_HOSTILE_WPET, //Current target (can be a pet) - TARGET_T_HOSTILE_WPET_SECOND_AGGRO, //Second highest aggro (generaly used for cleaves and some special attacks) - TARGET_T_HOSTILE_WPET_LAST_AGGRO, //Dead last on aggro (no idea what this could be used for) - TARGET_T_HOSTILE_WPET_RANDOM, //Just any random target on our threat list - TARGET_T_HOSTILE_WPET_RANDOM_NOT_TOP, //Any random target except top threat + // Hostile targets (including pets) + TARGET_T_HOSTILE_WPET, // Current target (can be a pet) + TARGET_T_HOSTILE_WPET_SECOND_AGGRO, // Second highest aggro (generaly used for cleaves and some special attacks) + TARGET_T_HOSTILE_WPET_LAST_AGGRO, // Dead last on aggro (no idea what this could be used for) + TARGET_T_HOSTILE_WPET_RANDOM, // Just any random target on our threat list + TARGET_T_HOSTILE_WPET_RANDOM_NOT_TOP, // Any random target except top threat TARGET_T_ACTION_INVOKER_WPET, @@ -144,14 +144,14 @@ enum Target enum EventFlags { - EFLAG_REPEATABLE = 0x01, //Event repeats - EFLAG_DIFFICULTY_0 = 0x02, //Event only occurs in instance difficulty 0 - EFLAG_DIFFICULTY_1 = 0x04, //Event only occurs in instance difficulty 1 - EFLAG_DIFFICULTY_2 = 0x08, //Event only occurs in instance difficulty 2 - EFLAG_DIFFICULTY_3 = 0x10, //Event only occurs in instance difficulty 3 - EFLAG_RANDOM_ACTION = 0x20, //Event only execute one from existed actions instead each action. + EFLAG_REPEATABLE = 0x01, // Event repeats + EFLAG_DIFFICULTY_0 = 0x02, // Event only occurs in instance difficulty 0 + EFLAG_DIFFICULTY_1 = 0x04, // Event only occurs in instance difficulty 1 + EFLAG_DIFFICULTY_2 = 0x08, // Event only occurs in instance difficulty 2 + EFLAG_DIFFICULTY_3 = 0x10, // Event only occurs in instance difficulty 3 + EFLAG_RANDOM_ACTION = 0x20, // Event only execute one from existed actions instead each action. EFLAG_RESERVED_6 = 0x40, - EFLAG_DEBUG_ONLY = 0x80, //Event only occurs in debug build + EFLAG_DEBUG_ONLY = 0x80, // Event only occurs in debug build // no free bits, uint8 field EFLAG_DIFFICULTY_ALL = (EFLAG_DIFFICULTY_0 | EFLAG_DIFFICULTY_1 | EFLAG_DIFFICULTY_2 | EFLAG_DIFFICULTY_3) }; @@ -498,8 +498,8 @@ struct CreatureEventAI_Event uint32 repeatMax; } friendly_buff; // EVENT_T_SUMMONED_UNIT = 17 - //EVENT_T_SUMMONED_JUST_DIED = 25 - //EVENT_T_SUMMONED_JUST_DESPAWN = 26 + // EVENT_T_SUMMONED_JUST_DIED = 25 + // EVENT_T_SUMMONED_JUST_DESPAWN = 26 struct { uint32 creatureId; @@ -543,7 +543,7 @@ struct CreatureEventAI_Event CreatureEventAI_Action action[MAX_ACTIONS]; }; -//Event_Map +// Event_Map typedef std::vector CreatureEventAI_Event_Vec; typedef UNORDERED_MAP CreatureEventAI_Event_Map; @@ -558,7 +558,7 @@ struct CreatureEventAI_Summon uint32 SpawnTimeSecs; }; -//EventSummon_Map +// EventSummon_Map typedef UNORDERED_MAP CreatureEventAI_Summon_Map; struct CreatureEventAIHolder @@ -620,13 +620,13 @@ class MANGOS_DLL_SPEC CreatureEventAI : public CreatureAI void DoFindFriendlyCC(std::list& _list, float range); protected: - uint32 m_EventUpdateTime; //Time between event updates - uint32 m_EventDiff; //Time between the last event call + uint32 m_EventUpdateTime; // Time between event updates + uint32 m_EventDiff; // Time between the last event call bool m_bEmptyList; - //Variables used by Events themselves + // Variables used by Events themselves typedef std::vector CreatureEventAIList; - CreatureEventAIList m_CreatureEventAIList; //Holder for events (stores enabled, time, and eventid) + CreatureEventAIList m_CreatureEventAIList; // Holder for events (stores enabled, time, and eventid) uint8 m_Phase; // Current phase, max 32 phases bool m_CombatMovementEnabled; // If we allow targeted movment gen (movement twoards top threat) diff --git a/src/game/CreatureEventAIMgr.cpp b/src/game/CreatureEventAIMgr.cpp index 57cb7fef1..454678e5e 100644 --- a/src/game/CreatureEventAIMgr.cpp +++ b/src/game/CreatureEventAIMgr.cpp @@ -153,7 +153,7 @@ void CreatureEventAIMgr::CheckUnusedAITexts() void CreatureEventAIMgr::LoadCreatureEventAI_Summons(bool check_entry_use) { - //Drop Existing EventSummon Map + // Drop Existing EventSummon Map m_CreatureEventAI_Summon_Map.clear(); // Gather additional data for EventAI @@ -183,7 +183,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons(bool check_entry_use) continue; } - //Add to map + // Add to map m_CreatureEventAI_Summon_Map[temp.id] = temp; ++Count; } @@ -244,7 +244,7 @@ void CreatureEventAIMgr::CheckUnusedAISummons() // ------------------- void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() { - //Drop Existing EventAI List + // Drop Existing EventAI List m_CreatureEventAI_Event_Map.clear(); // Gather event data @@ -272,7 +272,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() uint32 creature_id = temp.creature_id; uint32 e_type = fields[2].GetUInt32(); - //Report any errors in event + // Report any errors in event if (e_type >= EVENT_T_END) { sLog.outErrorDb("CreatureEventAI: Event %u have wrong type (%u), skipping.", i, e_type); @@ -288,24 +288,24 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() temp.raw.param3 = fields[8].GetUInt32(); temp.raw.param4 = fields[9].GetUInt32(); - //Creature does not exist in database + // Creature does not exist in database if (!sCreatureStorage.LookupEntry(temp.creature_id)) { sLog.outErrorDb("CreatureEventAI: Event %u has script for non-existing creature entry (%u), skipping.", i, temp.creature_id); continue; } - //No chance of this event occuring + // No chance of this event occuring if (temp.event_chance == 0) sLog.outErrorDb("CreatureEventAI: Event %u has 0 percent chance. Event will never trigger!", i); - //Chance above 100, force it to be 100 + // Chance above 100, force it to be 100 else if (temp.event_chance > 100) { sLog.outErrorDb("CreatureEventAI: Creature %u are using event %u with more than 100 percent chance. Adjusting to 100 percent.", temp.creature_id, i); temp.event_chance = 100; } - //Individual event checks + // Individual event checks switch (temp.event_type) { case EVENT_T_TIMER: @@ -506,7 +506,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() action.raw.param2 = fields[12 + (j * 4)].GetUInt32(); action.raw.param3 = fields[13 + (j * 4)].GetUInt32(); - //Report any errors in actions + // Report any errors in actions switch (action.type) { case ACTION_T_NONE: @@ -603,14 +603,14 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() { if (spell->RecoveryTime > 0 && temp.event_flags & EFLAG_REPEATABLE) { - //output as debug for now, also because there's no general rule all spells have RecoveryTime + // output as debug for now, also because there's no general rule all spells have RecoveryTime if (temp.event_param3 < spell->RecoveryTime) DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "CreatureEventAI: Event %u Action %u uses SpellID %u but cooldown is longer(%u) than minumum defined in event param3(%u).", i, j+1,action.cast.spellId, spell->RecoveryTime, temp.event_param3); } } */ - //Cast is always triggered if target is forced to cast on self + // Cast is always triggered if target is forced to cast on self if (action.cast.castFlags & CAST_FORCE_TARGET_SELF) action.cast.castFlags |= CAST_TRIGGERED; @@ -698,7 +698,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() if (action.remove_aura.target >= TARGET_T_END) sLog.outErrorDb("CreatureEventAI: Event %u Action %u uses incorrect Target type", i, j + 1); break; - case ACTION_T_RANDOM_PHASE: //PhaseId1, PhaseId2, PhaseId3 + case ACTION_T_RANDOM_PHASE: // PhaseId1, PhaseId2, PhaseId3 if (action.random_phase.phase1 >= MAX_PHASE) sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase1 >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1); if (action.random_phase.phase2 >= MAX_PHASE) @@ -706,7 +706,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() if (action.random_phase.phase3 >= MAX_PHASE) sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phase3 >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1); break; - case ACTION_T_RANDOM_PHASE_RANGE: //PhaseMin, PhaseMax + case ACTION_T_RANDOM_PHASE_RANGE: // PhaseMin, PhaseMax if (action.random_phase_range.phaseMin >= MAX_PHASE) sLog.outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMin >= %u. Phase mask cannot be used past phase %u.", i, j + 1, MAX_PHASE, MAX_PHASE - 1); if (action.random_phase_range.phaseMin >= MAX_PHASE) @@ -789,15 +789,15 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() } } break; - case ACTION_T_EVADE: //No Params - case ACTION_T_FLEE_FOR_ASSIST: //No Params - case ACTION_T_DIE: //No Params - case ACTION_T_ZONE_COMBAT_PULSE: //No Params - case ACTION_T_FORCE_DESPAWN: //Delay - case ACTION_T_AUTO_ATTACK: //AllowAttackState (0 = stop attack, anything else means continue attacking) - case ACTION_T_COMBAT_MOVEMENT: //AllowCombatMovement (0 = stop combat based movement, anything else continue attacking) - case ACTION_T_RANGED_MOVEMENT: //Distance, Angle - case ACTION_T_CALL_FOR_HELP: //Distance + case ACTION_T_EVADE: // No Params + case ACTION_T_FLEE_FOR_ASSIST: // No Params + case ACTION_T_DIE: // No Params + case ACTION_T_ZONE_COMBAT_PULSE: // No Params + case ACTION_T_FORCE_DESPAWN: // Delay + case ACTION_T_AUTO_ATTACK: // AllowAttackState (0 = stop attack, anything else means continue attacking) + case ACTION_T_COMBAT_MOVEMENT: // AllowCombatMovement (0 = stop combat based movement, anything else continue attacking) + case ACTION_T_RANGED_MOVEMENT: // Distance, Angle + case ACTION_T_CALL_FOR_HELP: // Distance break; case ACTION_T_RANDOM_SAY: @@ -811,7 +811,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() } } - //Add to list + // Add to list m_CreatureEventAI_Event_Map[creature_id].push_back(temp); ++Count; } diff --git a/src/game/CreatureLinkingMgr.cpp b/src/game/CreatureLinkingMgr.cpp index ff3327e69..a0f7b03c5 100644 --- a/src/game/CreatureLinkingMgr.cpp +++ b/src/game/CreatureLinkingMgr.cpp @@ -334,7 +334,7 @@ void CreatureLinkingHolder::AddSlaveToHolder(Creature* pCreature) if (itr->second.linkingFlag == pInfo->linkingFlag) { itr->second.linkedGuids.push_back(pCreature->GetObjectGuid()); - pCreature = NULL; // Store that is was handled + pCreature = NULL; // Store that is was handled break; } } diff --git a/src/game/DBCEnums.h b/src/game/DBCEnums.h index 642c0b2e8..08d4e7e5d 100644 --- a/src/game/DBCEnums.h +++ b/src/game/DBCEnums.h @@ -253,7 +253,7 @@ enum Difficulty DUNGEON_DIFFICULTY_NORMAL = 0, DUNGEON_DIFFICULTY_HEROIC = 1, - //DUNGEON_DIFFICULTY_EPIC = 2, // not used, but exists + // DUNGEON_DIFFICULTY_EPIC = 2, // not used, but exists RAID_DIFFICULTY_10MAN_NORMAL = 0, RAID_DIFFICULTY_25MAN_NORMAL = 1, @@ -334,8 +334,8 @@ enum ItemEnchantmentType enum ItemLimitCategoryMode { - ITEM_LIMIT_CATEGORY_MODE_HAVE = 0, // limit applied to amount items in inventory/bank - ITEM_LIMIT_CATEGORY_MODE_EQUIP = 1, // limit applied to amount equipped items (including used gems) + ITEM_LIMIT_CATEGORY_MODE_HAVE = 0, // limit applied to amount items in inventory/bank + ITEM_LIMIT_CATEGORY_MODE_EQUIP = 1, // limit applied to amount equipped items (including used gems) }; // some used in code cases diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index 7f9a5c12b..79d29c995 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -101,7 +101,7 @@ DBCStorage sGtChanceToSpellCritBaseStore(GtChance DBCStorage sGtChanceToSpellCritStore(GtChanceToSpellCritfmt); DBCStorage sGtOCTClassCombatRatingScalarStore(GtOCTClassCombatRatingScalarfmt); DBCStorage sGtOCTRegenHPStore(GtOCTRegenHPfmt); -//DBCStorage sGtOCTRegenMPStore(GtOCTRegenMPfmt); -- not used currently +// DBCStorage sGtOCTRegenMPStore(GtOCTRegenMPfmt); -- not used currently DBCStorage sGtRegenHPPerSptStore(GtRegenHPPerSptfmt); DBCStorage sGtRegenMPPerSptStore(GtRegenMPPerSptfmt); @@ -110,8 +110,8 @@ DBCStorage sHolidaysStore(Holidaysfmt); DBCStorage sItemStore(Itemfmt); DBCStorage sItemBagFamilyStore(ItemBagFamilyfmt); DBCStorage sItemClassStore(ItemClassfmt); -//DBCStorage sItemCondExtCostsStore(ItemCondExtCostsEntryfmt); -//DBCStorage sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently +// DBCStorage sItemCondExtCostsStore(ItemCondExtCostsEntryfmt); +// DBCStorage sItemDisplayInfoStore(ItemDisplayTemplateEntryfmt); -- not used currently DBCStorage sItemExtendedCostStore(ItemExtendedCostEntryfmt); DBCStorage sItemLimitCategoryStore(ItemLimitCategoryEntryfmt); DBCStorage sItemRandomPropertiesStore(ItemRandomPropertiesfmt); @@ -328,7 +328,7 @@ inline void LoadDBC(LocalData& localeData, BarGoLink& bar, StoreProblemList& err std::string dbc_filename_loc = dbc_path + localStr->name + "/" + filename; if (!storage.LoadStringsFrom(dbc_filename_loc.c_str())) - localeData.availableDbcLocales &= ~(1 << i); // mark as not available for speedup next checks + localeData.availableDbcLocales &= ~(1 << i);// mark as not available for speedup next checks } } else @@ -441,15 +441,15 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtOCTClassCombatRatingScalarStore, dbcPath, "gtOCTClassCombatRatingScalar.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtOCTRegenHPStore, dbcPath, "gtOCTRegenHP.dbc"); - //LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTRegenMPStore, dbcPath,"gtOCTRegenMP.dbc"); -- not used currently + // LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTRegenMPStore, dbcPath,"gtOCTRegenMP.dbc"); -- not used currently LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtRegenHPPerSptStore, dbcPath, "gtRegenHPPerSpt.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sGtRegenMPPerSptStore, dbcPath, "gtRegenMPPerSpt.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sHolidaysStore, dbcPath, "Holidays.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemStore, dbcPath, "Item.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemBagFamilyStore, dbcPath, "ItemBagFamily.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemClassStore, dbcPath, "ItemClass.dbc"); - //LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDisplayInfoStore, dbcPath,"ItemDisplayInfo.dbc"); -- not used currently - //LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemCondExtCostsStore, dbcPath,"ItemCondExtCosts.dbc"); + // LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemDisplayInfoStore, dbcPath,"ItemDisplayInfo.dbc"); -- not used currently + // LoadDBC(availableDbcLocales,bar,bad_dbc_files,sItemCondExtCostsStore, dbcPath,"ItemCondExtCosts.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemExtendedCostStore, dbcPath, "ItemExtendedCost.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemLimitCategoryStore, dbcPath, "ItemLimitCategory.dbc"); LoadDBC(availableDbcLocales, bar, bad_dbc_files, sItemRandomPropertiesStore, dbcPath, "ItemRandomProperties.dbc"); @@ -680,12 +680,12 @@ void LoadDBCStores(const std::string& dataPath) // Check loaded DBC files proper version if (!sAreaStore.LookupEntry(3617) || // last area (areaflag) added in 3.3.5a - !sCharTitlesStore.LookupEntry(177) || // last char title added in 3.3.5a - !sGemPropertiesStore.LookupEntry(1629) || // last gem property added in 3.3.5a - !sItemStore.LookupEntry(56806) || // last client known item added in 3.3.5a - !sItemExtendedCostStore.LookupEntry(2997) || // last item extended cost added in 3.3.5a - !sMapStore.LookupEntry(724) || // last map added in 3.3.5a - !sSpellStore.LookupEntry(80864)) // last added spell in 3.3.5a + !sCharTitlesStore.LookupEntry(177) || // last char title added in 3.3.5a + !sGemPropertiesStore.LookupEntry(1629) || // last gem property added in 3.3.5a + !sItemStore.LookupEntry(56806) || // last client known item added in 3.3.5a + !sItemExtendedCostStore.LookupEntry(2997) || // last item extended cost added in 3.3.5a + !sMapStore.LookupEntry(724) || // last map added in 3.3.5a + !sSpellStore.LookupEntry(80864)) // last added spell in 3.3.5a { sLog.outError("\nYou have mixed version DBC files. Please re-extract DBC files for one from client build: %s", AcceptableClientBuildsListStr().c_str()); Log::WaitBeforeContinueIfNeed(); diff --git a/src/game/DBCStores.h b/src/game/DBCStores.h index 1a59553da..3e1871f8f 100644 --- a/src/game/DBCStores.h +++ b/src/game/DBCStores.h @@ -104,7 +104,7 @@ extern DBCStorage sAuctionHouseStore; extern DBCStorage sBankBagSlotPricesStore; extern DBCStorage sBarberShopStyleStore; extern DBCStorage sBattlemasterListStore; -//extern DBCStorage sChatChannelsStore; -- accessed using function, no usable index +// extern DBCStorage sChatChannelsStore; -- accessed using function, no usable index extern DBCStorage sCharStartOutfitStore; extern DBCStorage sCharTitlesStore; extern DBCStorage sChrClassesStore; @@ -136,14 +136,14 @@ extern DBCStorage sGtChanceToSpellCritBaseStore; extern DBCStorage sGtChanceToSpellCritStore; extern DBCStorage sGtOCTClassCombatRatingScalarStore; extern DBCStorage sGtOCTRegenHPStore; -//extern DBCStorage sGtOCTRegenMPStore; -- not used currently +// extern DBCStorage sGtOCTRegenMPStore; -- not used currently extern DBCStorage sGtRegenHPPerSptStore; extern DBCStorage sGtRegenMPPerSptStore; extern DBCStorage sHolidaysStore; extern DBCStorage sItemStore; extern DBCStorage sItemBagFamilyStore; extern DBCStorage sItemClassStore; -//extern DBCStorage sItemDisplayInfoStore; -- not used currently +// extern DBCStorage sItemDisplayInfoStore; -- not used currently extern DBCStorage sItemExtendedCostStore; extern DBCStorage sItemLimitCategoryStore; extern DBCStorage sItemRandomPropertiesStore; @@ -152,14 +152,14 @@ extern DBCStorage sItemSetStore; extern DBCStorage sLockStore; extern DBCStorage sMailTemplateStore; extern DBCStorage sMapStore; -//extern DBCStorage sMapDifficultyStore; -- use GetMapDifficultyData insteed +// extern DBCStorage sMapDifficultyStore; -- use GetMapDifficultyData insteed extern MapDifficultyMap sMapDifficultyMap; extern DBCStorage sMovieStore; extern DBCStorage sOverrideSpellDataStore; extern DBCStorage sQuestFactionRewardStore; extern DBCStorage sQuestSortStore; extern DBCStorage sQuestXPLevelStore; -//extern DBCStorage sPvPDifficultyStore; -- use GetBattlegroundSlotByLevel for access +// extern DBCStorage sPvPDifficultyStore; -- use GetBattlegroundSlotByLevel for access extern DBCStorage sRandomPropertiesPointsStore; extern DBCStorage sScalingStatDistributionStore; extern DBCStorage sScalingStatValuesStore; @@ -195,7 +195,7 @@ extern DBCStorage sTotemCategoryStore; extern DBCStorage sVehicleStore; extern DBCStorage sVehicleSeatStore; extern DBCStorage sWMOAreaTableStore; -//extern DBCStorage sWorldMapAreaStore; -- use Zone2MapCoordinates and Map2ZoneCoordinates +// extern DBCStorage sWorldMapAreaStore; -- use Zone2MapCoordinates and Map2ZoneCoordinates extern DBCStorage sWorldMapOverlayStore; extern DBCStorage sWorldSafeLocsStore; diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 9475fe667..23debe16a 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -43,18 +43,18 @@ struct AchievementEntry uint32 ID; // 0 m_ID uint32 factionFlag; // 1 m_faction -1=all, 0=horde, 1=alliance uint32 mapID; // 2 m_instance_id -1=none - //uint32 parentAchievement; // 3 m_supercedes its Achievement parent (can`t start while parent uncomplete, use its Criteria if don`t have own, use its progress on begin) + // uint32 parentAchievement; // 3 m_supercedes its Achievement parent (can`t start while parent uncomplete, use its Criteria if don`t have own, use its progress on begin) char* name[16]; // 4-19 m_title_lang - //uint32 name_flags; // 20 string flags - //char *description[16]; // 21-36 m_description_lang - //uint32 desc_flags; // 37 string flags + // uint32 name_flags; // 20 string flags + // char *description[16]; // 21-36 m_description_lang + // uint32 desc_flags; // 37 string flags uint32 categoryId; // 38 m_category uint32 points; // 39 m_points - //uint32 OrderInCategory; // 40 m_ui_order + // uint32 OrderInCategory; // 40 m_ui_order uint32 flags; // 41 m_flags - //uint32 icon; // 42 m_iconID - //char *titleReward[16]; // 43-58 m_reward_lang - //uint32 titleReward_flags; // 59 string flags + // uint32 icon; // 42 m_iconID + // char *titleReward[16]; // 43-58 m_reward_lang + // uint32 titleReward_flags; // 59 string flags uint32 count; // 60 m_minimum_criteria - need this count of completed criterias (own or referenced achievement criterias) uint32 refAchievement; // 61 m_shares_criteria - referenced achievement (counting of all completed criterias) }; @@ -63,9 +63,9 @@ struct AchievementCategoryEntry { uint32 ID; // 0 m_ID uint32 parentCategory; // 1 m_parent -1 for main category - //char *name[16]; // 2-17 m_name_lang - //uint32 name_flags; // 18 string flags - //uint32 sortOrder; // 19 m_ui_order + // char *name[16]; // 2-17 m_name_lang + // uint32 name_flags; // 18 string flags + // uint32 sortOrder; // 19 m_ui_order }; struct AchievementCriteriaEntry @@ -491,9 +491,9 @@ struct AchievementCriteriaEntry } raw; }; char* name[16]; // 9-24 m_description_lang - //uint32 name_flags; // 25 + // uint32 name_flags; // 25 uint32 completionFlag; // 26 m_flags - //uint32 timedCriteriaStartType; // 27 m_timer_start_event Only appears with timed achievements, seems to be the type of starting a timed Achievement, only type 1 and some of type 6 need manual starting: 1: ByEventId(?) (serverside IDs), 2: ByQuestId, 5: ByCastSpellId(?), 6: BySpellIdTarget(some of these are unknown spells, some not, some maybe spells), 7: ByKillNpcId, 9: ByUseItemId + // uint32 timedCriteriaStartType; // 27 m_timer_start_event Only appears with timed achievements, seems to be the type of starting a timed Achievement, only type 1 and some of type 6 need manual starting: 1: ByEventId(?) (serverside IDs), 2: ByQuestId, 5: ByCastSpellId(?), 6: BySpellIdTarget(some of these are unknown spells, some not, some maybe spells), 7: ByKillNpcId, 9: ByUseItemId uint32 timedCriteriaMiscId; // 28 m_timer_asset_id Alway appears with timed events, used internally to start the achievement, store uint32 timeLimit; // 29 m_timer_time uint32 showOrder; // 30 m_ui_order also used in achievement shift-links as index in state bitmask @@ -558,7 +558,7 @@ struct AuctionHouseEntry uint32 faction; // 1 m_factionID uint32 depositPercent; // 2 m_depositRate uint32 cutPercent; // 3 m_consignmentRate - //char* name[16]; // 4-19 m_name_lang + // char* name[16]; // 4-19 m_name_lang // 20 string flags }; @@ -572,11 +572,11 @@ struct BarberShopStyleEntry { uint32 Id; // 0 m_ID uint32 type; // 1 m_type - //char* name[16]; // 2-17 m_DisplayName_lang - //uint32 name_flags; // 18 string flags - //uint32 unk_name[16]; // 19-34 m_Description_lang - //uint32 unk_flags; // 35 string flags - //float CostMultiplier; // 36 m_Cost_Modifier + // char* name[16]; // 2-17 m_DisplayName_lang + // uint32 name_flags; // 18 string flags + // uint32 unk_name[16]; // 19-34 m_Description_lang + // uint32 unk_flags; // 35 string flags + // float CostMultiplier; // 36 m_Cost_Modifier uint32 race; // 37 m_race uint32 gender; // 38 m_sex uint32 hair_id; // 39 m_data (real ID to hair/facial hair) @@ -587,9 +587,9 @@ struct BattlemasterListEntry uint32 id; // 0 m_ID int32 mapid[8]; // 1-8 m_mapID[8] uint32 type; // 9 m_instanceType - //uint32 canJoinAsGroup; // 10 m_groupsAllowed + // uint32 canJoinAsGroup; // 10 m_groupsAllowed char* name[16]; // 11-26 m_name_lang - //uint32 nameFlags // 27 string flags + // uint32 nameFlags // 27 string flags uint32 maxGroupSize; // 28 m_maxGroupSize uint32 HolidayWorldStateId; // 29 m_holidayWorldState uint32 minLevel; // 30 m_minlevel (sync with PvPDifficulty.dbc content) @@ -618,23 +618,23 @@ struct BattlemasterListEntry struct CharStartOutfitEntry { - //uint32 Id; // 0 m_ID + // uint32 Id; // 0 m_ID uint32 RaceClassGender; // 1 m_raceID m_classID m_sexID m_outfitID (UNIT_FIELD_BYTES_0 & 0x00FFFFFF) comparable (0 byte = race, 1 byte = class, 2 byte = gender) int32 ItemId[MAX_OUTFIT_ITEMS]; // 2-25 m_ItemID - //int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 26-29 m_DisplayItemID not required at server side - //int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 50-73 m_InventoryType not required at server side - //uint32 Unknown1; // 74 unique values (index-like with gaps ordered in other way as ids) - //uint32 Unknown2; // 75 - //uint32 Unknown3; // 76 + // int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 26-29 m_DisplayItemID not required at server side + // int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 50-73 m_InventoryType not required at server side + // uint32 Unknown1; // 74 unique values (index-like with gaps ordered in other way as ids) + // uint32 Unknown2; // 75 + // uint32 Unknown3; // 76 }; struct CharTitlesEntry { uint32 ID; // 0, m_ID - //uint32 unk1; // 1 m_Condition_ID + // uint32 unk1; // 1 m_Condition_ID char* name[16]; // 2-17 m_name_lang // 18 string flags - //char* name2[16]; // 19-34 m_name1_lang + // char* name2[16]; // 19-34 m_name1_lang // 35 string flags uint32 bit_index; // 36 m_mask_ID used in PLAYER_CHOSEN_TITLE and 1<duel) diff --git a/src/game/GMTicketHandler.cpp b/src/game/GMTicketHandler.cpp index c86f444e2..5475dabd1 100644 --- a/src/game/GMTicketHandler.cpp +++ b/src/game/GMTicketHandler.cpp @@ -132,7 +132,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket& recv_data) data << uint32(2); // 2 - nothing appears (3-error creating, 5-error updating) SendPacket(&data); - //TODO: Guard player map + // TODO: Guard player map HashMapHolder::MapType& m = sObjectAccessor.GetPlayers(); for (HashMapHolder::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) { diff --git a/src/game/GameEventMgr.cpp b/src/game/GameEventMgr.cpp index 5f6397d1d..f88eb414e 100644 --- a/src/game/GameEventMgr.cpp +++ b/src/game/GameEventMgr.cpp @@ -623,10 +623,10 @@ uint32 GameEventMgr::Update(ActiveEvents const* activeAtShutdown /*= NULL*/) uint32 calcDelay; for (uint16 itr = 1; itr < mGameEvent.size(); ++itr) { - //sLog.outErrorDb("Checking event %u",itr); + // sLog.outErrorDb("Checking event %u",itr); if (CheckOneGameEvent(itr, currenttime)) { - //DEBUG_LOG("GameEvent %u is active",itr->first); + // DEBUG_LOG("GameEvent %u is active",itr->first); if (!IsActiveEvent(itr)) { bool resume = activeAtShutdown && (activeAtShutdown->find(itr) != activeAtShutdown->end()); @@ -635,7 +635,7 @@ uint32 GameEventMgr::Update(ActiveEvents const* activeAtShutdown /*= NULL*/) } else { - //DEBUG_LOG("GameEvent %u is not active",itr->first); + // DEBUG_LOG("GameEvent %u is not active",itr->first); if (IsActiveEvent(itr)) StopEvent(itr); else @@ -654,7 +654,7 @@ uint32 GameEventMgr::Update(ActiveEvents const* activeAtShutdown /*= NULL*/) nextEventDelay = calcDelay; } BASIC_LOG("Next game event check in %u seconds.", nextEventDelay + 1); - return (nextEventDelay + 1) * IN_MILLISECONDS; // Add 1 second to be sure event has started/stopped at next call + return (nextEventDelay + 1) * IN_MILLISECONDS; // Add 1 second to be sure event has started/stopped at next call } void GameEventMgr::UnApplyEvent(uint16 event_id) @@ -926,7 +926,7 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool Activate) { const Quest* pQuest = sObjectMgr.GetQuestTemplate(*itr); - //if (Activate) + // if (Activate) //{ // TODO: implement way to reset quests when event begin. //} diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index d0d26e1be..8edefddb4 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -161,9 +161,9 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa if (goinfo->type == GAMEOBJECT_TYPE_CAPTURE_POINT && goinfo->capturePoint.radius) SetCapturePointSlider(CAPTURE_SLIDER_NEUTRAL); - //Notify the map's instance data. - //Only works if you create the object in it, not if it is moves to that map. - //Normally non-players do not teleport to other maps. + // Notify the map's instance data. + // Only works if you create the object in it, not if it is moves to that map. + // Normally non-players do not teleport to other maps. if (InstanceData* iData = map->GetInstanceData()) iData->OnObjectCreate(this); @@ -247,10 +247,10 @@ void GameObject::Update(uint32 update_diff, uint32 p_time) } case GAMEOBJECT_TYPE_DOOR: case GAMEOBJECT_TYPE_BUTTON: - //we need to open doors if they are closed (add there another condition if this code breaks some usage, but it need to be here for battlegrounds) + // we need to open doors if they are closed (add there another condition if this code breaks some usage, but it need to be here for battlegrounds) if (GetGoState() != GO_STATE_READY) ResetDoorOrButton(); - //flags in AB are type_button and we need to add them here so no break! + // flags in AB are type_button and we need to add them here so no break! default: if (!m_spawnedByDefault) // despawn timer { @@ -280,8 +280,8 @@ void GameObject::Update(uint32 update_diff, uint32 p_time) Unit* ok = NULL; // pointer to appropriate target if found any bool IsBattleGroundTrap = false; - //FIXME: this is activation radius (in different casting radius that must be selected from spell data) - //TODO: move activated state code (cast itself) to GO_ACTIVATED, in this place only check activating and set state + // FIXME: this is activation radius (in different casting radius that must be selected from spell data) + // TODO: move activated state code (cast itself) to GO_ACTIVATED, in this place only check activating and set state float radius = float(goInfo->trap.radius); if (!radius) { @@ -334,7 +334,7 @@ void GameObject::Update(uint32 update_diff, uint32 p_time) if (IsBattleGroundTrap && ok->GetTypeId() == TYPEID_PLAYER) { - //BattleGround gameobjects case + // BattleGround gameobjects case if (((Player*)ok)->InBattleGround()) if (BattleGround* bg = ((Player*)ok)->GetBattleGround()) bg->HandleTriggerBuff(GetObjectGuid()); @@ -412,7 +412,7 @@ void GameObject::Update(uint32 update_diff, uint32 p_time) SetGoState(GO_STATE_READY); - //any return here in case battleground traps + // any return here in case battleground traps break; case GAMEOBJECT_TYPE_CAPTURE_POINT: // remove capturing players because slider wont be displayed if capture point is being locked @@ -605,7 +605,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map* map) } uint32 entry = data->id; - //uint32 map_id = data->mapid; // already used before call + // uint32 map_id = data->mapid; // already used before call uint32 phaseMask = data->phaseMask; float x = data->posX; float y = data->posY; @@ -822,7 +822,7 @@ bool GameObject::ActivateToQuest(Player* pTarget) const if (LootTemplates_Gameobject.HaveQuestLootForPlayer(GetGOInfo()->GetLootId(), pTarget)) { - //look for battlegroundAV for some objects which are only activated after mine gots captured by own team + // look for battlegroundAV for some objects which are only activated after mine gots captured by own team if (GetEntry() == BG_AV_OBJECTID_MINE_N || GetEntry() == BG_AV_OBJECTID_MINE_S) if (BattleGround* bg = pTarget->GetBattleGround()) if (bg->GetTypeID() == BATTLEGROUND_AV && !(((BattleGroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(), pTarget->GetTeam()))) @@ -961,9 +961,9 @@ void GameObject::SwitchDoorOrButton(bool activate, bool alternative /* = false * else RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); - if (GetGoState() == GO_STATE_READY) //if closed -> open + if (GetGoState() == GO_STATE_READY) // if closed -> open SetGoState(alternative ? GO_STATE_ACTIVE_ALTERNATIVE : GO_STATE_ACTIVE); - else //if open -> close + else // if open -> close SetGoState(GO_STATE_READY); } @@ -994,7 +994,7 @@ void GameObject::Use(Unit* user) { case GAMEOBJECT_TYPE_DOOR: // 0 { - //doors never really despawn, only reset to default state/flags + // doors never really despawn, only reset to default state/flags UseDoorOrButton(); // activate script @@ -1004,7 +1004,7 @@ void GameObject::Use(Unit* user) } case GAMEOBJECT_TYPE_BUTTON: // 1 { - //buttons never really despawn, only reset to default state/flags + // buttons never really despawn, only reset to default state/flags UseDoorOrButton(); TriggerLinkedGameObject(user); @@ -1192,7 +1192,7 @@ void GameObject::Use(Unit* user) // possible quest objective for active quests if (info->goober.questId && sObjectMgr.GetQuestTemplate(info->goober.questId)) { - //Quest require to be active for GO using + // Quest require to be active for GO using if (player->GetQuestStatus(info->goober.questId) != QUEST_STATUS_INCOMPLETE) break; } @@ -1265,7 +1265,7 @@ void GameObject::Use(Unit* user) if (!zone_skill) zone_skill = sObjectMgr.GetFishingBaseSkillLevel(zone); - //provide error, no fishable zone or area should be 0 + // provide error, no fishable zone or area should be 0 if (!zone_skill) sLog.outErrorDb("Fishable areaId %u are not properly defined in `skill_fishing_base_level`.", subzone); @@ -1284,7 +1284,7 @@ void GameObject::Use(Unit* user) { if (!sWorld.getConfig(CONFIG_BOOL_SKILL_FAIL_POSSIBLE_FISHINGPOOL)) { - //TODO: find reasonable value for fishing hole search + // TODO: find reasonable value for fishing hole search fishingHole = LookupFishingHoleAround(20.0f + CONTACT_DISTANCE); if (fishingHole) success = true; @@ -1292,7 +1292,7 @@ void GameObject::Use(Unit* user) } // just search fishhole for success case else - //TODO: find reasonable value for fishing hole search + // TODO: find reasonable value for fishing hole search fishingHole = LookupFishingHoleAround(20.0f + CONTACT_DISTANCE); if (success || sWorld.getConfig(CONFIG_BOOL_SKILL_FAIL_GAIN_FISHING)) @@ -1461,7 +1461,7 @@ void GameObject::Use(Unit* user) if (!targetPlayer || targetPlayer == player || !targetPlayer->IsInSameGroupWith(player)) return; - //required lvl checks! + // required lvl checks! uint8 level = player->getLevel(); if (level < info->meetingstone.minLevel || level > info->meetingstone.maxLevel) return; @@ -1498,7 +1498,7 @@ void GameObject::Use(Unit* user) // 15004 // 15005 bg->EventPlayerClickedOnFlag(player, this); - return; //we don't need to delete flag ... it is despawned! + return; // we don't need to delete flag ... it is despawned! } break; } @@ -1549,7 +1549,7 @@ void GameObject::Use(Unit* user) break; } } - //this cause to call return, all flags must be deleted here!! + // this cause to call return, all flags must be deleted here!! spellId = 0; Delete(); } @@ -1855,7 +1855,7 @@ void GameObject::SetLootRecipient(Unit* pUnit) float GameObject::GetObjectBoundingRadius() const { - //FIXME: + // FIXME: // 1. This is clearly hack way because GameObjectDisplayInfoEntry have 6 floats related to GO sizes, but better that use DEFAULT_WORLD_OBJECT_SIZE // 2. In some cases this must be only interactive size, not GO size, current way can affect creature target point auto-selection in strange ways for big underground/virtual GOs if (m_displayInfo) @@ -1904,7 +1904,7 @@ struct SpawnGameObjectInMapsWorker if (map->IsLoaded(i_data->posX, i_data->posY)) { GameObject* pGameobject = new GameObject; - //DEBUG_LOG("Spawning gameobject %u", *itr); + // DEBUG_LOG("Spawning gameobject %u", *itr); if (!pGameobject->LoadFromDB(i_guid, map)) { delete pGameobject; diff --git a/src/game/GameObject.h b/src/game/GameObject.h index e298deb9f..a79172de4 100644 --- a/src/game/GameObject.h +++ b/src/game/GameObject.h @@ -491,7 +491,7 @@ struct GameObjectInfo case GAMEOBJECT_TYPE_AREADAMAGE: autoCloseTime = areadamage.autoCloseTime; break; default: break; } - return autoCloseTime / IN_MILLISECONDS; // prior to 3.0.3, conversion was / 0x10000; + return autoCloseTime / IN_MILLISECONDS; // prior to 3.0.3, conversion was / 0x10000; } uint32 GetLootId() const diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp index a9d50b80a..d5f982c0d 100644 --- a/src/game/GossipDef.cpp +++ b/src/game/GossipDef.cpp @@ -190,7 +190,7 @@ void PlayerMenu::SendGossipMenu(uint32 TitleTextId, ObjectGuid objectGuid) } GetMenuSession()->SendPacket(&data); - //DEBUG_LOG( "WORLD: Sent SMSG_GOSSIP_MESSAGE NPCGuid=%u",GUID_LOPART(npcGUID) ); + // DEBUG_LOG( "WORLD: Sent SMSG_GOSSIP_MESSAGE NPCGuid=%u",GUID_LOPART(npcGUID) ); } void PlayerMenu::CloseGossip() @@ -198,7 +198,7 @@ void PlayerMenu::CloseGossip() WorldPacket data(SMSG_GOSSIP_COMPLETE, 0); GetMenuSession()->SendPacket(&data); - //DEBUG_LOG( "WORLD: Sent SMSG_GOSSIP_COMPLETE" ); + // DEBUG_LOG( "WORLD: Sent SMSG_GOSSIP_COMPLETE" ); } // Outdated @@ -213,7 +213,7 @@ void PlayerMenu::SendPointOfInterest(float X, float Y, uint32 Icon, uint32 Flags data << locName; GetMenuSession()->SendPacket(&data); - //DEBUG_LOG("WORLD: Sent SMSG_GOSSIP_POI"); + // DEBUG_LOG("WORLD: Sent SMSG_GOSSIP_POI"); } void PlayerMenu::SendPointOfInterest(uint32 poi_id) @@ -242,7 +242,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poi_id) data << icon_name; GetMenuSession()->SendPacket(&data); - //DEBUG_LOG("WORLD: Sent SMSG_GOSSIP_POI"); + // DEBUG_LOG("WORLD: Sent SMSG_GOSSIP_POI"); } void PlayerMenu::SendTalking(uint32 textID) @@ -528,7 +528,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* pQuest, ObjectGuid guid for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward reputation override. No bonus is expected given data << int32(0); - //data << int32(pQuest->RewRepValue[i]); // current field for store of rep value, can be reused to implement "override value" + // data << int32(pQuest->RewRepValue[i]); // current field for store of rep value, can be reused to implement "override value" data << uint32(QUEST_EMOTE_COUNT); @@ -651,7 +651,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* pQuest) for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward reputation override. No bonus is expected given data << int32(0); - //data << int32(pQuest->RewRepValue[i]); // current field for store of rep value, can be reused to implement "override value" + // data << int32(pQuest->RewRepValue[i]); // current field for store of rep value, can be reused to implement "override value" data << pQuest->GetPointMapId(); data << pQuest->GetPointX(); @@ -795,7 +795,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, ObjectGuid npcGU for (int i = 0; i < QUEST_REPUTATIONS_COUNT; ++i) // reward reputation override. No diplomacy bonus is expected given, reward also does not display in chat window data << int32(0); - //data << int32(pQuest->RewRepValue[i]); + // data << int32(pQuest->RewRepValue[i]); GetMenuSession()->SendPacket(&data); DEBUG_LOG("WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid = %s, questid = %u", npcGUID.GetString().c_str(), pQuest->GetQuestId()); diff --git a/src/game/GossipDef.h b/src/game/GossipDef.h index 4b09a0395..75181b5db 100644 --- a/src/game/GossipDef.h +++ b/src/game/GossipDef.h @@ -55,19 +55,19 @@ enum Gossip_Option enum GossipOptionIcon { - GOSSIP_ICON_CHAT = 0, //white chat bubble - GOSSIP_ICON_VENDOR = 1, //brown bag - GOSSIP_ICON_TAXI = 2, //flight - GOSSIP_ICON_TRAINER = 3, //book - GOSSIP_ICON_INTERACT_1 = 4, //interaction wheel - GOSSIP_ICON_INTERACT_2 = 5, //interaction wheel - GOSSIP_ICON_MONEY_BAG = 6, //brown bag with yellow dot - GOSSIP_ICON_TALK = 7, //white chat bubble with black dots - GOSSIP_ICON_TABARD = 8, //tabard - GOSSIP_ICON_BATTLE = 9, //two swords - GOSSIP_ICON_DOT = 10, //yellow dot - GOSSIP_ICON_CHAT_11 = 11, //This and below are most the same visual as GOSSIP_ICON_CHAT - GOSSIP_ICON_CHAT_12 = 12, //but are still used for unknown reasons. + GOSSIP_ICON_CHAT = 0, // white chat bubble + GOSSIP_ICON_VENDOR = 1, // brown bag + GOSSIP_ICON_TAXI = 2, // flight + GOSSIP_ICON_TRAINER = 3, // book + GOSSIP_ICON_INTERACT_1 = 4, // interaction wheel + GOSSIP_ICON_INTERACT_2 = 5, // interaction wheel + GOSSIP_ICON_MONEY_BAG = 6, // brown bag with yellow dot + GOSSIP_ICON_TALK = 7, // white chat bubble with black dots + GOSSIP_ICON_TABARD = 8, // tabard + GOSSIP_ICON_BATTLE = 9, // two swords + GOSSIP_ICON_DOT = 10, // yellow dot + GOSSIP_ICON_CHAT_11 = 11, // This and below are most the same visual as GOSSIP_ICON_CHAT + GOSSIP_ICON_CHAT_12 = 12, // but are still used for unknown reasons. GOSSIP_ICON_CHAT_13 = 13, GOSSIP_ICON_CHAT_14 = 14, // probably invalid GOSSIP_ICON_CHAT_15 = 15, // probably invalid @@ -79,7 +79,7 @@ enum GossipOptionIcon GOSSIP_ICON_MAX }; -//POI icons. Many more exist, list not complete. +// POI icons. Many more exist, list not complete. enum Poi_Icon { ICON_POI_BLANK = 0, // Blank (not visible), in 2.4.3 have value 15 with 1..15 values in 0..14 range diff --git a/src/game/GridMap.cpp b/src/game/GridMap.cpp index 548bb46bf..ac20df5bf 100644 --- a/src/game/GridMap.cpp +++ b/src/game/GridMap.cpp @@ -589,7 +589,7 @@ bool GridMap::ExistMap(uint32 mapid, int gx, int gy) { sLog.outError("Map file '%s' is non-compatible version (outdated?). Please, create new using ad.exe program.", tmp); delete [] tmp; - fclose(pf); //close file before return + fclose(pf); // close file before return return false; } @@ -630,9 +630,9 @@ TerrainInfo::TerrainInfo(uint32 mapid) : m_mapId(mapid) } } - //clean up GridMap objects every minute + // clean up GridMap objects every minute const uint32 iCleanUpInterval = 60; - //schedule start randlomly + // schedule start randlomly const uint32 iRandomStart = urand(20, 40); i_timer.SetInterval(iCleanUpInterval * 1000); @@ -654,10 +654,10 @@ GridMap* TerrainInfo::Load(const uint32 x, const uint32 y) MANGOS_ASSERT(x < MAX_NUMBER_OF_GRIDS); MANGOS_ASSERT(y < MAX_NUMBER_OF_GRIDS); - //reference grid as a first step + // reference grid as a first step RefGrid(x, y); - //quick check if GridMap already loaded + // quick check if GridMap already loaded GridMap* pMap = m_GridMaps[x][y]; if (!pMap) pMap = LoadMapAndVMap(x, y); @@ -665,7 +665,7 @@ GridMap* TerrainInfo::Load(const uint32 x, const uint32 y) return pMap; } -//schedule lazy GridMap object cleanup +// schedule lazy GridMap object cleanup void TerrainInfo::Unload(const uint32 x, const uint32 y) { MANGOS_ASSERT(x < MAX_NUMBER_OF_GRIDS); @@ -673,17 +673,17 @@ void TerrainInfo::Unload(const uint32 x, const uint32 y) if (m_GridMaps[x][y]) { - //decrease grid reference count... + // decrease grid reference count... if (UnrefGrid(x, y) == 0) { - //TODO: add your additional logic here + // TODO: add your additional logic here } } } -//call this method only +// call this method only void TerrainInfo::CleanUpGrids(const uint32 diff) { i_timer.Update(diff); @@ -697,18 +697,18 @@ void TerrainInfo::CleanUpGrids(const uint32 diff) const int16& iRef = m_GridRef[x][y]; GridMap* pMap = m_GridMaps[x][y]; - //delete those GridMap objects which have refcount = 0 + // delete those GridMap objects which have refcount = 0 if (pMap && iRef == 0) { m_GridMaps[x][y] = NULL; - //delete grid data if reference count == 0 + // delete grid data if reference count == 0 pMap->unloadData(); delete pMap; - //unload VMAPS... + // unload VMAPS... VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(m_mapId, x, y); - //unload mmap... + // unload mmap... MMAP::MMapFactory::createOrGetMMapManager()->unloadMap(m_mapId, x, y); } } @@ -988,7 +988,7 @@ bool TerrainInfo::IsInWater(float x, float y, float pZ, GridMapLiquidData* data) GridMapLiquidData* liquid_ptr = data ? data : &liquid_status; if (getLiquidStatus(x, y, pZ, MAP_ALL_LIQUIDS, liquid_ptr)) { - //if (liquid_prt->level - liquid_prt->depth_level > 2) //??? + // if (liquid_prt->level - liquid_prt->depth_level > 2) //??? return true; } } @@ -1038,10 +1038,10 @@ float TerrainInfo::GetWaterOrGroundLevel(float x, float y, float z, float* pGrou GridMap* TerrainInfo::GetGrid(const float x, const float y) { // half opt method - int gx = (int)(32 - x / SIZE_OF_GRIDS); //grid x - int gy = (int)(32 - y / SIZE_OF_GRIDS); //grid y + int gx = (int)(32 - x / SIZE_OF_GRIDS); // grid x + int gy = (int)(32 - y / SIZE_OF_GRIDS); // grid y - //quick check if GridMap already loaded + // quick check if GridMap already loaded GridMap* pMap = m_GridMaps[gx][gy]; if (!pMap) pMap = LoadMapAndVMap(gx, gy); @@ -1051,7 +1051,7 @@ GridMap* TerrainInfo::GetGrid(const float x, const float y) GridMap* TerrainInfo::LoadMapAndVMap(const uint32 x, const uint32 y) { - //double checked lock pattern + // double checked lock pattern if (!m_GridMaps[x][y]) { LOCK_GUARD lock(m_mutex); @@ -1070,13 +1070,13 @@ GridMap* TerrainInfo::LoadMapAndVMap(const uint32 x, const uint32 y) if (!map->loadData(tmp)) { sLog.outError("Error load map file: \n %s\n", tmp); - //ASSERT(false); + // ASSERT(false); } delete [] tmp; m_GridMaps[x][y] = map; - //load VMAPs for current map/grid... + // load VMAPs for current map/grid... const MapEntry* i_mapEntry = sMapStore.LookupEntry(m_mapId); const char* mapName = i_mapEntry ? i_mapEntry->name[sWorld.GetDefaultDbcLocale()] : "UNNAMEDMAP\x0"; @@ -1167,7 +1167,7 @@ void TerrainManager::UnloadTerrain(const uint32 mapId) if (iter != i_TerrainMap.end()) { TerrainInfo* ptr = (*iter).second; - //lets check if this object can be actually freed + // lets check if this object can be actually freed if (ptr->IsReferenced() == false) { i_TerrainMap.erase(iter); @@ -1178,7 +1178,7 @@ void TerrainManager::UnloadTerrain(const uint32 mapId) void TerrainManager::Update(const uint32 diff) { - //global garbage collection for GridMap objects and VMaps + // global garbage collection for GridMap objects and VMaps for (TerrainDataMap::iterator iter = i_TerrainMap.begin(); iter != i_TerrainMap.end(); ++iter) iter->second->CleanUpGrids(diff); } diff --git a/src/game/GridMap.h b/src/game/GridMap.h index 8fb51d856..e29e20d5a 100644 --- a/src/game/GridMap.h +++ b/src/game/GridMap.h @@ -207,7 +207,7 @@ typedef ACE_Atomic_Op AtomicLong; #define DEFAULT_HEIGHT_SEARCH 10.0f // default search distance to find height at nearby locations #define DEFAULT_WATER_SEARCH 50.0f // default search distance to case detection water level -//class for sharing and managin GridMap objects +// class for sharing and managin GridMap objects class MANGOS_DLL_SPEC TerrainInfo : public Referencable { public: @@ -216,8 +216,8 @@ class MANGOS_DLL_SPEC TerrainInfo : public Referencable uint32 GetMapId() const { return m_mapId; } - //TODO: move all terrain/vmaps data info query functions - //from 'Map' class into this class + // TODO: move all terrain/vmaps data info query functions + // from 'Map' class into this class float GetHeight(float x, float y, float z, bool pCheckVMap = true, float maxSearchDist = DEFAULT_HEIGHT_SEARCH) const; float GetWaterLevel(float x, float y, float z, float* pGround = NULL) const; float GetWaterOrGroundLevel(float x, float y, float z, float* pGround = NULL, bool swim = false) const; @@ -237,15 +237,15 @@ class MANGOS_DLL_SPEC TerrainInfo : public Referencable bool IsOutdoors(float x, float y, float z) const; - //this method should be used only by TerrainManager - //to cleanup unreferenced GridMap objects - they are too heavy - //to destroy them dynamically, especially on highly populated servers - //THIS METHOD IS NOT THREAD-SAFE!!!! AND IT SHOULDN'T BE THREAD-SAFE!!!! + // this method should be used only by TerrainManager + // to cleanup unreferenced GridMap objects - they are too heavy + // to destroy them dynamically, especially on highly populated servers + // THIS METHOD IS NOT THREAD-SAFE!!!! AND IT SHOULDN'T BE THREAD-SAFE!!!! void CleanUpGrids(const uint32 diff); protected: friend class Map; - //load/unload terrain data + // load/unload terrain data GridMap* Load(const uint32 x, const uint32 y); void Unload(const uint32 x, const uint32 y); @@ -264,7 +264,7 @@ class MANGOS_DLL_SPEC TerrainInfo : public Referencable GridMap* m_GridMaps[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]; int16 m_GridRef[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]; - //global garbage collection timer + // global garbage collection timer ShortIntervalTimer i_timer; typedef ACE_Thread_Mutex LOCK_TYPE; @@ -273,7 +273,7 @@ class MANGOS_DLL_SPEC TerrainInfo : public Referencable LOCK_TYPE m_refMutex; }; -//class for managing TerrainData object and all sort of geometry querying operations +// class for managing TerrainData object and all sort of geometry querying operations class MANGOS_DLL_DECL TerrainManager : public MaNGOS::Singleton > { typedef UNORDERED_MAP TerrainDataMap; diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h index 7cdfa05b5..3a8b221ba 100644 --- a/src/game/GridNotifiersImpl.h +++ b/src/game/GridNotifiersImpl.h @@ -125,7 +125,7 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target) if (!i_dynobject.IsWithinDistInMap(target, i_dynobject.GetRadius())) return; - //Check targets for not_selectable unit flag and remove + // Check targets for not_selectable unit flag and remove if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE)) return; @@ -133,7 +133,7 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target) if (target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->IsInEvadeMode()) return; - //Check player targets and remove if in GM mode or GM invisibility (for not self casting case) + // Check player targets and remove if in GM mode or GM invisibility (for not self casting case) if (target->GetTypeId() == TYPEID_PLAYER && target != i_check && (((Player*)target)->isGameMaster() || ((Player*)target)->GetVisibility() == VISIBILITY_OFF)) return; diff --git a/src/game/Group.cpp b/src/game/Group.cpp index f09d36f93..44cff04e8 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -366,7 +366,7 @@ uint32 Group::RemoveMember(ObjectGuid guid, uint8 method) player->GetSession()->SendPacket(&data); } - //we already removed player from group and in player->GetGroup() is his original group! + // we already removed player from group and in player->GetGroup() is his original group! if (Group* group = player->GetGroup()) { group->SendUpdate(); @@ -422,13 +422,13 @@ void Group::Disband(bool hideDestroy) if (!player) continue; - //we cannot call _removeMember because it would invalidate member iterator - //if we are removing player from battleground raid + // we cannot call _removeMember because it would invalidate member iterator + // if we are removing player from battleground raid if (isBGGroup()) player->RemoveFromBattleGroundRaid(); else { - //we can remove player who is in battleground from his original group + // we can remove player who is in battleground from his original group if (player->GetOriginalGroup() == this) player->SetOriginalGroup(NULL); else @@ -449,7 +449,7 @@ void Group::Disband(bool hideDestroy) player->GetSession()->SendPacket(&data); } - //we already removed player from group and in player->GetGroup() is his original group, send update + // we already removed player from group and in player->GetGroup() is his original group, send update if (Group* group = player->GetGroup()) { group->SendUpdate(); @@ -600,7 +600,7 @@ void Group::GroupLoot(WorldObject* pSource, Loot* loot) continue; } - //roll for over-threshold item if it's one-player loot + // roll for over-threshold item if it's one-player loot if (itemProto->Quality >= uint32(m_lootThreshold) && !lootItem.freeforall) StartLootRoll(pSource, GROUP_LOOT, loot, itemSlot, maxEnchantingSkill); else @@ -622,7 +622,7 @@ void Group::NeedBeforeGreed(WorldObject* pSource, Loot* loot) continue; } - //only roll for one-player items, not for ones everyone can get + // only roll for one-player items, not for ones everyone can get if (itemProto->Quality >= uint32(m_lootThreshold) && !lootItem.freeforall) StartLootRoll(pSource, NEED_BEFORE_GREED, loot, itemSlot, maxEnchantingSkill); else @@ -753,7 +753,7 @@ void Group::StartLootRoll(WorldObject* lootTarget, LootMethod method, Loot* loot Roll* r = new Roll(lootTarget->GetObjectGuid(), method, lootItem); - //a vector is filled with only near party members + // a vector is filled with only near party members for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next()) { Player* playerToRoll = itr->getSource(); @@ -801,9 +801,9 @@ void Group::EndRoll() { while (!RollId.empty()) { - //need more testing here, if rolls disappear + // need more testing here, if rolls disappear Rolls::iterator itr = RollId.begin(); - CountTheRoll(itr); //i don't have to edit player votes, who didn't vote ... he will pass + CountTheRoll(itr); // i don't have to edit player votes, who didn't vote ... he will pass } } @@ -817,7 +817,7 @@ void Group::CountTheRoll(Rolls::iterator& rollI) return; } - //end of the roll + // end of the roll if (roll->totalNeed > 0) { if (!roll->playerVote.empty()) @@ -874,7 +874,7 @@ void Group::CountTheRoll(Rolls::iterator& rollI) uint8 maxresul = 0; ObjectGuid maxguid = (*roll->playerVote.begin()).first; Player* player; - RollVote rollvote = ROLL_PASS; //Fixed: Using uninitialized memory 'rollvote' + RollVote rollvote = ROLL_PASS; // Fixed: Using uninitialized memory 'rollvote' Roll::PlayerVote::iterator itr; for (itr = roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr) @@ -1183,13 +1183,13 @@ bool Group::_addMember(ObjectGuid guid, const char* name, bool isAssistant, uint if (player) { player->SetGroupInvite(NULL); - //if player is in group and he is being added to BG raid group, then call SetBattleGroundRaid() + // if player is in group and he is being added to BG raid group, then call SetBattleGroundRaid() if (player->GetGroup() && isBGGroup()) player->SetBattleGroundRaid(this, group); - //if player is in bg raid and we are adding him to normal group, then call SetOriginalGroup() + // if player is in bg raid and we are adding him to normal group, then call SetOriginalGroup() else if (player->GetGroup()) player->SetOriginalGroup(this, group); - //if player is not in group, then call set group + // if player is not in group, then call set group else player->SetGroup(this, group); @@ -1223,12 +1223,12 @@ bool Group::_removeMember(ObjectGuid guid) Player* player = sObjectMgr.GetPlayer(guid); if (player) { - //if we are removing player from battleground raid + // if we are removing player from battleground raid if (isBGGroup()) player->RemoveFromBattleGroundRaid(); else { - //we can remove player who is in battleground from his original group + // we can remove player who is in battleground from his original group if (player->GetOriginalGroup() == this) player->SetOriginalGroup(NULL); else @@ -1473,7 +1473,7 @@ void Group::ChangeMembersGroup(Player* player, uint8 group) { if (player->GetGroup() == this) player->GetGroupRef().setSubGroup(group); - //if player is in BG raid, it is possible that he is also in normal raid - and that normal raid is stored in m_originalGroup reference + // if player is in BG raid, it is possible that he is also in normal raid - and that normal raid is stored in m_originalGroup reference else { prevSubGroup = player->GetOriginalSubGroup(); @@ -1540,7 +1540,7 @@ void Group::UpdateLooterGuid(WorldObject* pSource, bool ifneed) { bool refresh = pl->GetLootGuid() == pSource->GetObjectGuid(); - //if(refresh) // update loot for new looter + // if(refresh) // update loot for new looter // pl->GetSession()->DoLootRelease(pl->GetLootGUID()); SetLooterGuid(pl->GetObjectGuid()); SendUpdate(); @@ -1561,7 +1561,7 @@ void Group::UpdateLooterGuid(WorldObject* pSource, bool ifneed) { bool refresh = pl->GetLootGuid() == pSource->GetObjectGuid(); - //if(refresh) // update loot for new looter + // if(refresh) // update loot for new looter // pl->GetSession()->DoLootRelease(pl->GetLootGUID()); SetLooterGuid(pl->GetObjectGuid()); SendUpdate(); @@ -1848,7 +1848,7 @@ void Group::UnbindInstance(uint32 mapid, uint8 difficulty, bool unload) if (!unload) CharacterDatabase.PExecute("DELETE FROM group_instance WHERE leaderGuid = '%u' AND instance = '%u'", GetLeaderGuid().GetCounter(), itr->second.state->GetInstanceId()); - itr->second.state->RemoveGroup(this); // state can become invalid + itr->second.state->RemoveGroup(this); // state can become invalid m_boundInstances[difficulty].erase(itr); } } diff --git a/src/game/Group.h b/src/game/Group.h index d57120607..2f9bf4326 100644 --- a/src/game/Group.h +++ b/src/game/Group.h @@ -163,7 +163,7 @@ class Roll : public LootValidatorRef uint32 itemRandomSuffix; uint8 itemCount; typedef UNORDERED_MAP PlayerVote; - PlayerVote playerVote; //vote position correspond with player position (in group) + PlayerVote playerVote; // vote position correspond with player position (in group) uint8 totalPlayersRolling; uint8 totalNeed; uint8 totalGreed; diff --git a/src/game/GroupHandler.cpp b/src/game/GroupHandler.cpp index 37d2046c8..6519d6746 100644 --- a/src/game/GroupHandler.cpp +++ b/src/game/GroupHandler.cpp @@ -164,7 +164,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recv_data) data << GetPlayer()->GetName(); // max len 48 data << uint32(0); // unk data << uint8(0); // count - //for(int i = 0; i < count; ++i) + // for(int i = 0; i < count; ++i) // data << uint32(0); data << uint32(0); // unk player->GetSession()->SendPacket(&data); @@ -388,11 +388,11 @@ void WorldSession::HandleLootRoll(WorldPacket& recv_data) ObjectGuid lootedTarget; uint32 itemSlot; uint8 rollType; - recv_data >> lootedTarget; //guid of the item rolled + recv_data >> lootedTarget; // guid of the item rolled recv_data >> itemSlot; recv_data >> rollType; - //DEBUG_LOG("WORLD RECIEVE CMSG_LOOT_ROLL, From:%u, Numberofplayers:%u, rollType:%u", (uint32)Guid, NumberOfPlayers, rollType); + // DEBUG_LOG("WORLD RECIEVE CMSG_LOOT_ROLL, From:%u, Numberofplayers:%u, rollType:%u", (uint32)Guid, NumberOfPlayers, rollType); Group* group = GetPlayer()->GetGroup(); if (!group) @@ -426,7 +426,7 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data) if (!GetPlayer()->GetGroup()) return; - //DEBUG_LOG("Received opcode MSG_MINIMAP_PING X: %f, Y: %f", x, y); + // DEBUG_LOG("Received opcode MSG_MINIMAP_PING X: %f, Y: %f", x, y); /** error handling **/ /********************/ @@ -453,7 +453,7 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data) // everything is fine, do it roll = urand(minimum, maximum); - //DEBUG_LOG("ROLL: MIN: %u, MAX: %u, ROLL: %u", minimum, maximum, roll); + // DEBUG_LOG("ROLL: MIN: %u, MAX: %u, ROLL: %u", minimum, maximum, roll); WorldPacket data(MSG_RANDOM_ROLL, 4 + 4 + 4 + 8); data << uint32(minimum); @@ -648,11 +648,11 @@ void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket& recv_data) void WorldSession::HandleRaidReadyCheckFinishedOpcode(WorldPacket& /*recv_data*/) { - //Group* group = GetPlayer()->GetGroup(); - //if(!group) + // Group* group = GetPlayer()->GetGroup(); + // if(!group) // return; - //if(!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID())) + // if(!group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID())) // return; // Is any reaction need? @@ -843,7 +843,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recv_data) data << uint16(player->GetMaxPower(powerType)); // GROUP_UPDATE_FLAG_MAX_POWER data << uint16(player->getLevel()); // GROUP_UPDATE_FLAG_LEVEL - //verify player coordinates and zoneid to send to teammates + // verify player coordinates and zoneid to send to teammates uint16 iZoneId = 0; uint16 iCoordX = 0; uint16 iCoordY = 0; @@ -863,7 +863,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recv_data) } else { - //unknown player status. + // unknown player status. } data << uint16(iZoneId); // GROUP_UPDATE_FLAG_ZONE diff --git a/src/game/GuardAI.cpp b/src/game/GuardAI.cpp index a817f9a5c..672f6432c 100644 --- a/src/game/GuardAI.cpp +++ b/src/game/GuardAI.cpp @@ -47,7 +47,7 @@ void GuardAI::MoveInLineOfSight(Unit* u) float attackRadius = m_creature->GetAttackDistance(u); if (m_creature->IsWithinDistInMap(u, attackRadius)) { - //Need add code to let guard support player + // Need add code to let guard support player AttackStart(u); u->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); } diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp index 2e665ddae..6db99234c 100644 --- a/src/game/Guild.cpp +++ b/src/game/Guild.cpp @@ -336,20 +336,20 @@ bool Guild::LoadRanksFromDB(QueryResult* guildRanksResult) do { fields = guildRanksResult->Fetch(); - //condition that would be true when all ranks in QueryResult will be processed and guild without ranks is being processed + // condition that would be true when all ranks in QueryResult will be processed and guild without ranks is being processed if (!fields) break; uint32 guildId = fields[0].GetUInt32(); if (guildId < m_Id) { - //there is in table guild_rank record which doesn't have guildid in guild table, report error + // there is in table guild_rank record which doesn't have guildid in guild table, report error sLog.outErrorDb("Guild %u does not exist but it has a record in guild_rank table, deleting it!", guildId); CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid = '%u'", guildId); continue; } - if (guildId > m_Id) //we loaded all ranks for this guild already, break cycle + if (guildId > m_Id) // we loaded all ranks for this guild already, break cycle break; uint32 rankID = fields[1].GetUInt32(); @@ -714,7 +714,7 @@ void Guild::Disband() CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid = '%u'", m_Id); CharacterDatabase.PExecute("DELETE FROM guild_bank_tab WHERE guildid = '%u'", m_Id); - //Free bank tab used memory and delete items stored in them + // Free bank tab used memory and delete items stored in them DeleteGuildBankItems(true); CharacterDatabase.PExecute("DELETE FROM guild_bank_item WHERE guildid = '%u'", m_Id); @@ -828,7 +828,7 @@ uint32 Guild::GetAccountsNumber() if (m_accountsNumber) return m_accountsNumber; - //We use a set to be sure each element will be unique + // We use a set to be sure each element will be unique std::set accountsIdSet; for (MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr) accountsIdSet.insert(itr->second.accountId); @@ -875,7 +875,7 @@ void Guild::LoadGuildEventLogFromDB() if (!result) return; bool isNextLogGuidSet = false; - //uint32 configCount = sWorld.getConfig(CONFIG_UINT32_GUILD_EVENT_LOG_COUNT); + // uint32 configCount = sWorld.getConfig(CONFIG_UINT32_GUILD_EVENT_LOG_COUNT); // First event in list will be the oldest and the latest event is last event in list do { diff --git a/src/game/Guild.h b/src/game/Guild.h index 7ecb1548c..a9d59a227 100644 --- a/src/game/Guild.h +++ b/src/game/Guild.h @@ -34,14 +34,14 @@ class Item; enum GuildDefaultRanks { - //these ranks can be modified, but they cannot be deleted + // these ranks can be modified, but they cannot be deleted GR_GUILDMASTER = 0, GR_OFFICER = 1, GR_VETERAN = 2, GR_MEMBER = 3, GR_INITIATE = 4, - //When promoting member server does: rank--;! - //When demoting member server does: rank++;! + // When promoting member server does: rank--;! + // When demoting member server does: rank++;! }; enum GuildRankRights @@ -324,7 +324,7 @@ class Guild void SetLeader(ObjectGuid guid); bool AddMember(ObjectGuid plGuid, uint32 plRank); bool DelMember(ObjectGuid guid, bool isDisbanding = false); - //lowest rank is the count of ranks - 1 (the highest rank_id in table) + // lowest rank is the count of ranks - 1 (the highest rank_id in table) uint32 GetLowestRank() const { return m_Ranks.size() - 1; } void SetMOTD(std::string motd); diff --git a/src/game/GuildHandler.cpp b/src/game/GuildHandler.cpp index db715b6be..e4d36f662 100644 --- a/src/game/GuildHandler.cpp +++ b/src/game/GuildHandler.cpp @@ -293,7 +293,7 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket) return; } - uint32 newRankId = slot->RankId - 1; //when promoting player, rank is decreased + uint32 newRankId = slot->RankId - 1; // when promoting player, rank is decreased slot->ChangeRank(newRankId); // Put record into guild log @@ -354,7 +354,7 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket) return; } - uint32 newRankId = slot->RankId + 1; //when demoting player, rank is increased + uint32 newRankId = slot->RankId + 1; // when demoting player, rank is increased slot->ChangeRank(newRankId); // Put record into guild log @@ -798,11 +798,11 @@ void WorldSession::HandleGuildPermissions(WorldPacket& /* recv_data */) uint32 rankId = GetPlayer()->GetRank(); WorldPacket data(MSG_GUILD_PERMISSIONS, 4 * 15 + 1); - data << uint32(rankId); // guild rank id - data << uint32(pGuild->GetRankRights(rankId)); // rank rights + data << uint32(rankId); // guild rank id + data << uint32(pGuild->GetRankRights(rankId)); // rank rights // money per day left data << uint32(pGuild->GetMemberMoneyWithdrawRem(GetPlayer()->GetGUIDLow())); - data << uint8(pGuild->GetPurchasedTabs()); // tabs count + data << uint8(pGuild->GetPurchasedTabs()); // tabs count // why sending all info when not all tabs are purchased??? for (int i = 0; i < GUILD_BANK_MAX_TABS; ++i) { diff --git a/src/game/GuildMgr.cpp b/src/game/GuildMgr.cpp index a4a245542..e5a9fb33b 100644 --- a/src/game/GuildMgr.cpp +++ b/src/game/GuildMgr.cpp @@ -127,7 +127,7 @@ void GuildMgr::LoadGuilds() do { - //Field *fields = result->Fetch(); + // Field *fields = result->Fetch(); bar.step(); ++count; @@ -157,8 +157,8 @@ void GuildMgr::LoadGuilds() delete guildMembersResult; delete guildBankTabRightsResult; - //delete unused LogGuid records in guild_eventlog and guild_bank_eventlog table - //you can comment these lines if you don't plan to change CONFIG_UINT32_GUILD_EVENT_LOG_COUNT and CONFIG_UINT32_GUILD_BANK_EVENT_LOG_COUNT + // delete unused LogGuid records in guild_eventlog and guild_bank_eventlog table + // you can comment these lines if you don't plan to change CONFIG_UINT32_GUILD_EVENT_LOG_COUNT and CONFIG_UINT32_GUILD_BANK_EVENT_LOG_COUNT CharacterDatabase.PExecute("DELETE FROM guild_eventlog WHERE LogGuid > '%u'", sWorld.getConfig(CONFIG_UINT32_GUILD_EVENT_LOG_COUNT)); CharacterDatabase.PExecute("DELETE FROM guild_bank_eventlog WHERE LogGuid > '%u'", sWorld.getConfig(CONFIG_UINT32_GUILD_BANK_EVENT_LOG_COUNT)); diff --git a/src/game/InstanceData.h b/src/game/InstanceData.h index c906f084b..101638982 100644 --- a/src/game/InstanceData.h +++ b/src/game/InstanceData.h @@ -37,57 +37,57 @@ class MANGOS_DLL_SPEC InstanceData Map* instance; - //On creation, NOT load. + // On creation, NOT load. virtual void Initialize() {} - //On load + // On load virtual void Load(const char* /*data*/) {} - //When save is needed, this function generates the data + // When save is needed, this function generates the data virtual const char* Save() { return ""; } void SaveToDB(); - //Called every map update + // Called every map update virtual void Update(uint32 /*diff*/) {} - //Used by the map's CanEnter function. - //This is to prevent players from entering during boss encounters. + // Used by the map's CanEnter function. + // This is to prevent players from entering during boss encounters. virtual bool IsEncounterInProgress() const { return false; }; - //Called when a player successfully enters the instance (after really added to map) + // Called when a player successfully enters the instance (after really added to map) virtual void OnPlayerEnter(Player*) {} - //Called when a player dies inside instance + // Called when a player dies inside instance virtual void OnPlayerDeath(Player*) {} - //Called when a player leaves the instance (before really removed from map (or possibly world)) + // Called when a player leaves the instance (before really removed from map (or possibly world)) virtual void OnPlayerLeave(Player*) {} - //Called when a gameobject is created + // Called when a gameobject is created virtual void OnObjectCreate(GameObject*) {} - //called on creature creation + // called on creature creation virtual void OnCreatureCreate(Creature* /*creature*/) {} - //called on creature enter combat + // called on creature enter combat virtual void OnCreatureEnterCombat(Creature* /*creature*/) {} - //called on creature evade + // called on creature evade virtual void OnCreatureEvade(Creature* /*creature*/) {} - //called on creature death + // called on creature death virtual void OnCreatureDeath(Creature* /*creature*/) {} - //All-purpose data storage 64 bit + // All-purpose data storage 64 bit virtual uint64 GetData64(uint32 /*Data*/) { return 0; } virtual void SetData64(uint32 /*Data*/, uint64 /*Value*/) { } - //Guid data storage (wrapper for set/get from uint64 storage + // Guid data storage (wrapper for set/get from uint64 storage ObjectGuid GetGuid(uint32 dataIdx) { return ObjectGuid(GetData64(dataIdx)); } void SetGuid(uint32 dataIdx, ObjectGuid value) { SetData64(dataIdx, value.GetRawValue()); } - //All-purpose data storage 32 bit + // All-purpose data storage 32 bit virtual uint32 GetData(uint32 /*Type*/) { return 0; } virtual void SetData(uint32 /*Type*/, uint32 /*Data*/) {} diff --git a/src/game/Item.cpp b/src/game/Item.cpp index 807755839..8d7eda09b 100644 --- a/src/game/Item.cpp +++ b/src/game/Item.cpp @@ -89,7 +89,7 @@ void AddItemsSetItem(Player* player, Item* item) // new spell for (uint32 y = 0; y < 8; ++y) { - if (!eff->spells[y]) // free slot + if (!eff->spells[y]) // free slot { SpellEntry const* spellInfo = sSpellStore.LookupEntry(set->spells[x]); if (!spellInfo) @@ -157,7 +157,7 @@ void RemoveItemsSetItem(Player* player, ItemPrototype const* proto) } } - if (!eff->item_count) // all items of a set were removed + if (!eff->item_count) // all items of a set were removed { MANGOS_ASSERT(eff == player->ItemSetEff[setindex]); delete eff; @@ -277,7 +277,7 @@ void Item::UpdateDuration(Player* owner, uint32 diff) if (!GetUInt32Value(ITEM_FIELD_DURATION)) return; - //DEBUG_LOG("Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)", GetEntry(), GetUInt32Value(ITEM_FIELD_DURATION), diff); + // DEBUG_LOG("Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)", GetEntry(), GetUInt32Value(ITEM_FIELD_DURATION), diff); if (GetUInt32Value(ITEM_FIELD_DURATION) <= diff) { @@ -899,7 +899,7 @@ bool Item::IsFitToSpellRequirements(SpellEntry const* spellInfo) const if (spellInfo->EquippedItemClass != int32(proto->Class)) return false; // wrong item class - if (spellInfo->EquippedItemSubClassMask != 0) // 0 == any subclass + if (spellInfo->EquippedItemSubClassMask != 0) // 0 == any subclass { if ((spellInfo->EquippedItemSubClassMask & (1 << proto->SubClass)) == 0) return false; // subclass not present in mask @@ -1081,7 +1081,7 @@ void Item::SendTimeUpdate(Player* owner) Item* Item::CreateItem(uint32 item, uint32 count, Player const* player, uint32 randomPropertyId) { if (count < 1) - return NULL; //don't create item at zero count + return NULL; // don't create item at zero count if (ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(item)) { diff --git a/src/game/ItemEnchantmentMgr.cpp b/src/game/ItemEnchantmentMgr.cpp index 4838043bd..0dd883451 100644 --- a/src/game/ItemEnchantmentMgr.cpp +++ b/src/game/ItemEnchantmentMgr.cpp @@ -109,7 +109,7 @@ uint32 GetItemEnchantMod(uint32 entry) if (fCount > dRoll) return ench_iter->ench; } - //we could get here only if sum of all enchantment chances is lower than 100% + // we could get here only if sum of all enchantment chances is lower than 100% dRoll = (irand(0, (int)floor(fCount * 100) + 1)) / 100; fCount = 0; diff --git a/src/game/ItemHandler.cpp b/src/game/ItemHandler.cpp index b149b0830..c8e169103 100644 --- a/src/game/ItemHandler.cpp +++ b/src/game/ItemHandler.cpp @@ -29,12 +29,12 @@ void WorldSession::HandleSplitItemOpcode(WorldPacket& recv_data) { - //DEBUG_LOG("WORLD: CMSG_SPLIT_ITEM"); + // DEBUG_LOG("WORLD: CMSG_SPLIT_ITEM"); uint8 srcbag, srcslot, dstbag, dstslot; uint32 count; recv_data >> srcbag >> srcslot >> dstbag >> dstslot >> count; - //DEBUG_LOG("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u, count = %u", srcbag, srcslot, dstbag, dstslot, count); + // DEBUG_LOG("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u, count = %u", srcbag, srcslot, dstbag, dstslot, count); uint16 src = ((srcbag << 8) | srcslot); uint16 dst = ((dstbag << 8) | dstslot); @@ -43,7 +43,7 @@ void WorldSession::HandleSplitItemOpcode(WorldPacket& recv_data) return; if (count == 0) - return; //check count - if zero it's fake packet + return; // check count - if zero it's fake packet if (!_player->IsValidPos(srcbag, srcslot, true)) { @@ -62,11 +62,11 @@ void WorldSession::HandleSplitItemOpcode(WorldPacket& recv_data) void WorldSession::HandleSwapInvItemOpcode(WorldPacket& recv_data) { - //DEBUG_LOG("WORLD: CMSG_SWAP_INV_ITEM"); + // DEBUG_LOG("WORLD: CMSG_SWAP_INV_ITEM"); uint8 srcslot, dstslot; recv_data >> dstslot >> srcslot; - //DEBUG_LOG("STORAGE: receive srcslot = %u, dstslot = %u", srcslot, dstslot); + // DEBUG_LOG("STORAGE: receive srcslot = %u, dstslot = %u", srcslot, dstslot); // prevent attempt swap same item to current position generated by client at special cheating sequence if (srcslot == dstslot) @@ -111,11 +111,11 @@ void WorldSession::HandleAutoEquipItemSlotOpcode(WorldPacket& recv_data) void WorldSession::HandleSwapItem(WorldPacket& recv_data) { - //DEBUG_LOG("WORLD: CMSG_SWAP_ITEM"); + // DEBUG_LOG("WORLD: CMSG_SWAP_ITEM"); uint8 dstbag, dstslot, srcbag, srcslot; recv_data >> dstbag >> dstslot >> srcbag >> srcslot ; - //DEBUG_LOG("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u", srcbag, srcslot, dstbag, dstslot); + // DEBUG_LOG("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u", srcbag, srcslot, dstbag, dstslot); uint16 src = ((srcbag << 8) | srcslot); uint16 dst = ((dstbag << 8) | dstslot); @@ -141,11 +141,11 @@ void WorldSession::HandleSwapItem(WorldPacket& recv_data) void WorldSession::HandleAutoEquipItemOpcode(WorldPacket& recv_data) { - //DEBUG_LOG("WORLD: CMSG_AUTOEQUIP_ITEM"); + // DEBUG_LOG("WORLD: CMSG_AUTOEQUIP_ITEM"); uint8 srcbag, srcslot; recv_data >> srcbag >> srcslot; - //DEBUG_LOG("STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); + // DEBUG_LOG("STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); Item* pSrcItem = _player->GetItemByPos(srcbag, srcslot); if (!pSrcItem) @@ -235,11 +235,11 @@ void WorldSession::HandleAutoEquipItemOpcode(WorldPacket& recv_data) void WorldSession::HandleDestroyItemOpcode(WorldPacket& recv_data) { - //DEBUG_LOG("WORLD: CMSG_DESTROYITEM"); + // DEBUG_LOG("WORLD: CMSG_DESTROYITEM"); uint8 bag, slot, count, data1, data2, data3; recv_data >> bag >> slot >> count >> data1 >> data2 >> data3; - //DEBUG_LOG("STORAGE: receive bag = %u, slot = %u, count = %u", bag, slot, count); + // DEBUG_LOG("STORAGE: receive bag = %u, slot = %u, count = %u", bag, slot, count); uint16 pos = (bag << 8) | slot; @@ -280,7 +280,7 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket& recv_data) // Only _static_ data send in this packet !!! void WorldSession::HandleItemQuerySingleOpcode(WorldPacket& recv_data) { - //DEBUG_LOG("WORLD: CMSG_ITEM_QUERY_SINGLE"); + // DEBUG_LOG("WORLD: CMSG_ITEM_QUERY_SINGLE"); uint32 item; recv_data >> item; @@ -302,9 +302,9 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket& recv_data) data << pProto->SubClass; data << int32(pProto->Unk0); // new 2.0.3, not exist in wdb cache? data << name; - data << uint8(0x00); //pProto->Name2; // blizz not send name there, just uint8(0x00); <-- \0 = empty string = empty name... - data << uint8(0x00); //pProto->Name3; // blizz not send name there, just uint8(0x00); - data << uint8(0x00); //pProto->Name4; // blizz not send name there, just uint8(0x00); + data << uint8(0x00); // pProto->Name2; // blizz not send name there, just uint8(0x00); <-- \0 = empty string = empty name... + data << uint8(0x00); // pProto->Name3; // blizz not send name there, just uint8(0x00); + data << uint8(0x00); // pProto->Name4; // blizz not send name there, just uint8(0x00); data << pProto->DisplayInfoID; data << pProto->Quality; data << pProto->Flags; @@ -433,12 +433,12 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket& recv_data) void WorldSession::HandleReadItemOpcode(WorldPacket& recv_data) { - //DEBUG_LOG( "WORLD: CMSG_READ_ITEM"); + // DEBUG_LOG( "WORLD: CMSG_READ_ITEM"); uint8 bag, slot; recv_data >> bag >> slot; - //sLog.outDetail("STORAGE: Read bag = %u, slot = %u", bag, slot); + // sLog.outDetail("STORAGE: Read bag = %u, slot = %u", bag, slot); Item* pItem = _player->GetItemByPos(bag, slot); if (pItem && pItem->GetProto()->PageText) @@ -828,11 +828,11 @@ void WorldSession::SendListInventory(ObjectGuid vendorguid) void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket& recv_data) { - //DEBUG_LOG("WORLD: CMSG_AUTOSTORE_BAG_ITEM"); + // DEBUG_LOG("WORLD: CMSG_AUTOSTORE_BAG_ITEM"); uint8 srcbag, srcslot, dstbag; recv_data >> srcbag >> srcslot >> dstbag; - //DEBUG_LOG("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u", srcbag, srcslot, dstbag); + // DEBUG_LOG("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u", srcbag, srcslot, dstbag); Item* pItem = _player->GetItemByPos(srcbag, srcslot); if (!pItem) @@ -1098,7 +1098,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) DEBUG_LOG("Received opcode CMSG_WRAP_ITEM"); uint8 gift_bag, gift_slot, item_bag, item_slot; - //recv_data.hexlike(); + // recv_data.hexlike(); recv_data >> gift_bag >> gift_slot; // paper recv_data >> item_bag >> item_slot; // item @@ -1213,7 +1213,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) for (int i = 0; i < MAX_GEM_SOCKETS; ++i) recv_data >> gemGuids[i]; - //cheat -> tried to socket same gem multiple times + // cheat -> tried to socket same gem multiple times for (int i = 0; i < MAX_GEM_SOCKETS; ++i) { ObjectGuid gemGuid = gemGuids[i]; @@ -1229,14 +1229,14 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) } Item* itemTarget = _player->GetItemByGuid(itemGuid); - if (!itemTarget) //missing item to socket + if (!itemTarget) // missing item to socket return; ItemPrototype const* itemProto = itemTarget->GetProto(); if (!itemProto) return; - //this slot is excepted when applying / removing meta gem bonus + // this slot is excepted when applying / removing meta gem bonus uint8 slot = itemTarget->IsEquipped() ? itemTarget->GetSlot() : uint8(NULL_SLOT); Item* Gems[MAX_GEM_SOCKETS]; @@ -1244,10 +1244,10 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) Gems[i] = gemGuids[i] ? _player->GetItemByGuid(gemGuids[i]) : NULL; GemPropertiesEntry const* GemProps[MAX_GEM_SOCKETS]; - for (int i = 0; i < MAX_GEM_SOCKETS; ++i) //get geminfo from dbc storage + for (int i = 0; i < MAX_GEM_SOCKETS; ++i) // get geminfo from dbc storage GemProps[i] = (Gems[i]) ? sGemPropertiesStore.LookupEntry(Gems[i]->GetProto()->GemProperties) : NULL; - for (int i = 0; i < MAX_GEM_SOCKETS; ++i) //check for hack maybe + for (int i = 0; i < MAX_GEM_SOCKETS; ++i) // check for hack maybe { if (!GemProps[i]) continue; @@ -1277,7 +1277,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) uint32 GemEnchants[MAX_GEM_SOCKETS]; uint32 OldEnchants[MAX_GEM_SOCKETS]; - for (int i = 0; i < MAX_GEM_SOCKETS; ++i) //get new and old enchantments + for (int i = 0; i < MAX_GEM_SOCKETS; ++i) // get new and old enchantments { GemEnchants[i] = (GemProps[i]) ? GemProps[i]->spellitemenchantement : 0; OldEnchants[i] = itemTarget->GetEnchantmentId(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT + i)); @@ -1377,12 +1377,12 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) } } - bool SocketBonusActivated = itemTarget->GemsFitSockets(); //save state of socketbonus - _player->ToggleMetaGemsActive(slot, false); //turn off all metagems (except for the target item) + bool SocketBonusActivated = itemTarget->GemsFitSockets(); // save state of socketbonus + _player->ToggleMetaGemsActive(slot, false); // turn off all metagems (except for the target item) - //if a meta gem is being equipped, all information has to be written to the item before testing if the conditions for the gem are met + // if a meta gem is being equipped, all information has to be written to the item before testing if the conditions for the gem are met - //remove ALL enchants + // remove ALL enchants for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT + MAX_GEM_SOCKETS; ++enchant_slot) _player->ApplyEnchantment(itemTarget, EnchantmentSlot(enchant_slot), false); @@ -1405,7 +1405,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) _player->ApplyEnchantment(itemTarget, BONUS_ENCHANTMENT_SLOT, false); itemTarget->SetEnchantment(BONUS_ENCHANTMENT_SLOT, (SocketBonusToBeActivated ? itemTarget->GetProto()->socketBonus : 0), 0, 0); _player->ApplyEnchantment(itemTarget, BONUS_ENCHANTMENT_SLOT, true); - //it is not displayed, client has an inbuilt system to determine if the bonus is activated + // it is not displayed, client has an inbuilt system to determine if the bonus is activated } _player->ToggleMetaGemsActive(slot, true); // turn on all metagems (except for target item) diff --git a/src/game/LFGHandler.cpp b/src/game/LFGHandler.cpp index e83e6d88d..c2709ceec 100644 --- a/src/game/LFGHandler.cpp +++ b/src/game/LFGHandler.cpp @@ -49,15 +49,15 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recv_data) recv_data >> comment; // lfg comment - //SendLfgJoinResult(ERR_LFG_OK); - //SendLfgUpdate(false, LFG_UPDATE_JOIN, dungeons[0]); + // SendLfgJoinResult(ERR_LFG_OK); + // SendLfgUpdate(false, LFG_UPDATE_JOIN, dungeons[0]); } void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recv_data*/) { DEBUG_LOG("CMSG_LFG_LEAVE"); - //SendLfgUpdate(false, LFG_UPDATE_LEAVE, 0); + // SendLfgUpdate(false, LFG_UPDATE_LEAVE, 0); } void WorldSession::HandleSearchLfgJoinOpcode(WorldPacket& recv_data) @@ -70,7 +70,7 @@ void WorldSession::HandleSearchLfgJoinOpcode(WorldPacket& recv_data) entry = (temp & 0x00FFFFFF); // LfgType type = LfgType((temp >> 24) & 0x000000FF); - //SendLfgSearchResults(type, entry); + // SendLfgSearchResults(type, entry); } void WorldSession::HandleSearchLfgLeaveOpcode(WorldPacket& recv_data) @@ -136,7 +136,7 @@ void WorldSession::SendLfgSearchResults(LfgType type, uint32 entry) } } - //TODO: Guard Player map + // TODO: Guard Player map HashMapHolder::MapType const& players = sObjectAccessor.GetPlayers(); uint32 playersSize = players.size(); data << uint32(playersSize); // players count diff --git a/src/game/Language.h b/src/game/Language.h index 5b4692a19..8d95b24cc 100644 --- a/src/game/Language.h +++ b/src/game/Language.h @@ -42,8 +42,8 @@ enum MangosStrings LANG_GMS_ON_SRV = 16, LANG_GMS_NOT_LOGGED = 17, LANG_YOU_IN_FLIGHT = 18, - //LANG_YOU_IN_BATTLEGROUND = 19, not used - //LANG_TARGET_IN_FLIGHT = 20, not used + // LANG_YOU_IN_BATTLEGROUND = 19, not used + // LANG_TARGET_IN_FLIGHT = 20, not used LANG_CHAR_IN_FLIGHT = 21, LANG_CHAR_NON_MOUNTED = 22, LANG_YOU_IN_COMBAT = 23, @@ -83,7 +83,7 @@ enum MangosStrings LANG_USING_WORLD_DB = 57, LANG_USING_SCRIPT_LIB = 58, LANG_USING_EVENT_AI = 59, - //LANG_RA_BUSY = 60, not used + // LANG_RA_BUSY = 60, not used LANG_RA_USER = 61, LANG_RA_PASS = 62, LANG_GM_ACCEPTS_WHISPER = 63, @@ -119,7 +119,7 @@ enum MangosStrings LANG_YOU_CHANGE_ENERGY = 122, LANG_YOURS_ENERGY_CHANGED = 123, - LANG_CURRENT_ENERGY = 124, //log + LANG_CURRENT_ENERGY = 124, // log LANG_YOU_CHANGE_RAGE = 125, LANG_YOURS_RAGE_CHANGED = 126, LANG_YOU_CHANGE_LVL = 127, @@ -501,8 +501,8 @@ enum MangosStrings LANG_REMOVEALL_COOLDOWN = 492, LANG_REMOVE_COOLDOWN = 493, - LANG_ADDITEM = 494, //log - LANG_ADDITEMSET = 495, //log + LANG_ADDITEM = 494, // log + LANG_ADDITEMSET = 495, // log LANG_REMOVEITEM = 496, LANG_ITEM_CANNOT_CREATE = 497, LANG_INSERT_GUILD_NAME = 498, @@ -535,7 +535,7 @@ enum MangosStrings LANG_GAMEOBJECT_NOT_EXIST = 522, - LANG_GAMEOBJECT_CURRENT = 523, //log + LANG_GAMEOBJECT_CURRENT = 523, // log LANG_GAMEOBJECT_DETAIL = 524, LANG_GAMEOBJECT_ADD = 525, @@ -583,17 +583,17 @@ enum MangosStrings // 562, // not used // 563, // not used LANG_TOO_BIG_INDEX = 564, - LANG_SET_UINT = 565, //log + LANG_SET_UINT = 565, // log LANG_SET_UINT_FIELD = 566, - LANG_SET_FLOAT = 567, //log + LANG_SET_FLOAT = 567, // log LANG_SET_FLOAT_FIELD = 568, - LANG_GET_UINT = 569, //log + LANG_GET_UINT = 569, // log LANG_GET_UINT_FIELD = 570, - LANG_GET_FLOAT = 571, //log + LANG_GET_FLOAT = 571, // log LANG_GET_FLOAT_FIELD = 572, - // 573, //not used - // 574, //not used - LANG_CHANGE_INT32 = 575, //log + // 573, // not used + // 574, // not used + LANG_CHANGE_INT32 = 575, // log LANG_CHANGE_INT32_FIELD = 576, LANG_INVISIBLE_INVISIBLE = 577, @@ -898,13 +898,13 @@ enum MangosStrings LANG_NPC_GO_INFO_EVENT_STRING = 1150, LANG_NPC_GO_INFO_POOL_EVENT_STRING = 1151, LANG_COMMAND_ITEM_USABLE = 1152, - LANG_GET_BITSTR = 1153, //log + LANG_GET_BITSTR = 1153, // log LANG_GET_BITSTR_FIELD = 1154, - LANG_GET_HEX = 1155, //log + LANG_GET_HEX = 1155, // log LANG_GET_HEX_FIELD = 1156, - LANG_CHANGE_HEX = 1157, //log + LANG_CHANGE_HEX = 1157, // log LANG_CHANGE_HEX_FIELD = 1158, - LANG_CHANGE_FLOAT = 1159, //log + LANG_CHANGE_FLOAT = 1159, // log LANG_CHANGE_FLOAT_FIELD = 1160, LANG_COMMAND_ACHIEVEMENT_CRITERIA = 1161, LANG_COUNTER = 1162, diff --git a/src/game/Level0.cpp b/src/game/Level0.cpp index 241a1955f..00663ef57 100644 --- a/src/game/Level0.cpp +++ b/src/game/Level0.cpp @@ -123,7 +123,7 @@ bool ChatHandler::HandleServerInfoCommand(char* /*args*/) bool ChatHandler::HandleDismountCommand(char* /*args*/) { - //If player is not mounted, so go out :) + // If player is not mounted, so go out :) if (!m_session->GetPlayer()->IsMounted()) { SendSysMessage(LANG_CHAR_NON_MOUNTED); diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp index 4098099e3..f03b130ff 100644 --- a/src/game/Level1.cpp +++ b/src/game/Level1.cpp @@ -75,7 +75,7 @@ bool ChatHandler::HandleNpcYellCommand(char* args) return true; } -//show text emote by creature in chat +// show text emote by creature in chat bool ChatHandler::HandleNpcTextEmoteCommand(char* args) { if (!*args) @@ -131,7 +131,7 @@ bool ChatHandler::HandleAnnounceCommand(char* args) return true; } -//notification player at the screen +// notification player at the screen bool ChatHandler::HandleNotifyCommand(char* args) { if (!*args) @@ -147,7 +147,7 @@ bool ChatHandler::HandleNotifyCommand(char* args) return true; } -//Enable\Dissable GM Mode +// Enable\Dissable GM Mode bool ChatHandler::HandleGMCommand(char* args) { if (!*args) @@ -215,7 +215,7 @@ bool ChatHandler::HandleGMChatCommand(char* args) return true; } -//Enable\Dissable Invisible mode +// Enable\Dissable Invisible mode bool ChatHandler::HandleGMVisibleCommand(char* args) { if (!*args) @@ -353,7 +353,7 @@ bool ChatHandler::HandleGPSCommand(char* args) return true; } -//Summon Player +// Summon Player bool ChatHandler::HandleNamegoCommand(char* args) { Player* target; @@ -473,7 +473,7 @@ bool ChatHandler::HandleNamegoCommand(char* args) return true; } -//Teleport to Player +// Teleport to Player bool ChatHandler::HandleGonameCommand(char* args) { Player* target; @@ -640,7 +640,7 @@ bool ChatHandler::HandleRecallCommand(char* args) return HandleGoHelper(target, target->m_recallMap, target->m_recallX, target->m_recallY, &target->m_recallZ, &target->m_recallO); } -//Edit Player HP +// Edit Player HP bool ChatHandler::HandleModifyHPCommand(char* args) { if (!*args) @@ -678,7 +678,7 @@ bool ChatHandler::HandleModifyHPCommand(char* args) return true; } -//Edit Player Mana +// Edit Player Mana bool ChatHandler::HandleModifyManaCommand(char* args) { if (!*args) @@ -716,7 +716,7 @@ bool ChatHandler::HandleModifyManaCommand(char* args) return true; } -//Edit Player Energy +// Edit Player Energy bool ChatHandler::HandleModifyEnergyCommand(char* args) { if (!*args) @@ -756,7 +756,7 @@ bool ChatHandler::HandleModifyEnergyCommand(char* args) return true; } -//Edit Player Rage +// Edit Player Rage bool ChatHandler::HandleModifyRageCommand(char* args) { if (!*args) @@ -828,7 +828,7 @@ bool ChatHandler::HandleModifyRunicPowerCommand(char* args) return true; } -//Edit Player Faction +// Edit Player Faction bool ChatHandler::HandleModifyFactionCommand(char* args) { Creature* chr = getSelectedCreature(); @@ -892,7 +892,7 @@ bool ChatHandler::HandleModifyFactionCommand(char* args) return true; } -//Edit Player TP +// Edit Player TP bool ChatHandler::HandleModifyTalentCommand(char* args) { if (!*args) @@ -940,7 +940,7 @@ bool ChatHandler::HandleModifyTalentCommand(char* args) return false; } -//Enable On\OFF all taxi paths +// Enable On\OFF all taxi paths bool ChatHandler::HandleTaxiCheatCommand(char* args) { bool value; @@ -976,7 +976,7 @@ bool ChatHandler::HandleTaxiCheatCommand(char* args) return true; } -//Edit Player Aspeed +// Edit Player Aspeed bool ChatHandler::HandleModifyASpeedCommand(char* args) { if (!*args) @@ -1019,12 +1019,12 @@ bool ChatHandler::HandleModifyASpeedCommand(char* args) chr->UpdateSpeed(MOVE_WALK, true, modSpeed); chr->UpdateSpeed(MOVE_RUN, true, modSpeed); chr->UpdateSpeed(MOVE_SWIM, true, modSpeed); - //chr->UpdateSpeed(MOVE_TURN, true, modSpeed); + // chr->UpdateSpeed(MOVE_TURN, true, modSpeed); chr->UpdateSpeed(MOVE_FLIGHT, true, modSpeed); return true; } -//Edit Player Speed +// Edit Player Speed bool ChatHandler::HandleModifySpeedCommand(char* args) { if (!*args) @@ -1069,7 +1069,7 @@ bool ChatHandler::HandleModifySpeedCommand(char* args) return true; } -//Edit Player Swim Speed +// Edit Player Swim Speed bool ChatHandler::HandleModifySwimCommand(char* args) { if (!*args) @@ -1114,7 +1114,7 @@ bool ChatHandler::HandleModifySwimCommand(char* args) return true; } -//Edit Player Walk Speed +// Edit Player Walk Speed bool ChatHandler::HandleModifyBWalkCommand(char* args) { if (!*args) @@ -1159,7 +1159,7 @@ bool ChatHandler::HandleModifyBWalkCommand(char* args) return true; } -//Edit Player Fly +// Edit Player Fly bool ChatHandler::HandleModifyFlyCommand(char* args) { if (!*args) @@ -1195,7 +1195,7 @@ bool ChatHandler::HandleModifyFlyCommand(char* args) return true; } -//Edit Player Scale +// Edit Player Scale bool ChatHandler::HandleModifyScaleCommand(char* args) { if (!*args) @@ -1234,7 +1234,7 @@ bool ChatHandler::HandleModifyScaleCommand(char* args) return true; } -//Enable Player mount +// Enable Player mount bool ChatHandler::HandleModifyMountCommand(char* args) { if (!*args) @@ -1480,7 +1480,7 @@ bool ChatHandler::HandleModifyMountCommand(char* args) WorldPacket data(SMSG_FORCE_RUN_SPEED_CHANGE, (8 + 4 + 1 + 4)); data << chr->GetPackGUID(); data << (uint32)0; - data << (uint8)0; //new 2.1.0 + data << (uint8)0; // new 2.1.0 data << float(speed); chr->SendMessageToSet(&data, true); @@ -1493,7 +1493,7 @@ bool ChatHandler::HandleModifyMountCommand(char* args) return true; } -//Edit Player money +// Edit Player money bool ChatHandler::HandleModifyMoneyCommand(char* args) { if (!*args) @@ -1668,7 +1668,7 @@ bool ChatHandler::HandleLookupAreaCommand(char* args) return true; } -//Find tele in game_tele order by name +// Find tele in game_tele order by name bool ChatHandler::HandleLookupTeleCommand(char* args) { if (!*args) @@ -1711,7 +1711,7 @@ bool ChatHandler::HandleLookupTeleCommand(char* args) return true; } -//Enable\Dissable accept whispers (for GM) +// Enable\Dissable accept whispers (for GM) bool ChatHandler::HandleWhispersCommand(char* args) { if (!*args) @@ -1744,7 +1744,7 @@ bool ChatHandler::HandleWhispersCommand(char* args) return true; } -//Save all players in the world +// Save all players in the world bool ChatHandler::HandleSaveAllCommand(char* /*args*/) { sObjectAccessor.SaveAllPlayers(); @@ -1752,7 +1752,7 @@ bool ChatHandler::HandleSaveAllCommand(char* /*args*/) return true; } -//Send mail by command +// Send mail by command bool ChatHandler::HandleSendMailCommand(char* args) { // format: name "subject text" "mail text" @@ -1836,7 +1836,7 @@ bool ChatHandler::HandleTeleNameCommand(char* args) return true; } -//Teleport group to given game_tele.entry +// Teleport group to given game_tele.entry bool ChatHandler::HandleTeleGroupCommand(char* args) { if (!*args) @@ -1912,7 +1912,7 @@ bool ChatHandler::HandleTeleGroupCommand(char* args) return true; } -//Summon group of player +// Summon group of player bool ChatHandler::HandleGroupgoCommand(char* args) { Player* target; @@ -2110,7 +2110,7 @@ bool ChatHandler::HandleGoCommand(char* args) -//teleport at coordinates +// teleport at coordinates bool ChatHandler::HandleGoXYCommand(char* args) { Player* _player = m_session->GetPlayer(); @@ -2130,7 +2130,7 @@ bool ChatHandler::HandleGoXYCommand(char* args) return HandleGoHelper(_player, mapid, x, y); } -//teleport at coordinates, including Z +// teleport at coordinates, including Z bool ChatHandler::HandleGoXYZCommand(char* args) { Player* _player = m_session->GetPlayer(); @@ -2154,7 +2154,7 @@ bool ChatHandler::HandleGoXYZCommand(char* args) return HandleGoHelper(_player, mapid, x, y, &z); } -//teleport at coordinates +// teleport at coordinates bool ChatHandler::HandleGoZoneXYCommand(char* args) { Player* _player = m_session->GetPlayer(); @@ -2209,7 +2209,7 @@ bool ChatHandler::HandleGoZoneXYCommand(char* args) return HandleGoHelper(_player, mapEntry->MapID, x, y); } -//teleport to grid +// teleport to grid bool ChatHandler::HandleGoGridCommand(char* args) { Player* _player = m_session->GetPlayer(); diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index 3222f43e1..332c65c07 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -58,7 +58,7 @@ static uint32 ReputationRankStrIndex[MAX_REPUTATION_RANK] = LANG_REP_FRIENDLY, LANG_REP_HONORED, LANG_REP_REVERED, LANG_REP_EXALTED }; -//mute player for some times +// mute player for some times bool ChatHandler::HandleMuteCommand(char* args) { char* nameStr = ExtractOptNotLastArg(&args); @@ -102,7 +102,7 @@ bool ChatHandler::HandleMuteCommand(char* args) return true; } -//unmute player +// unmute player bool ChatHandler::HandleUnmuteCommand(char* args) { Player* target; @@ -491,7 +491,7 @@ static char const* const creatureKeys[] = * Warning: If there is more than one mob with this "id" * you will be teleported to the first one that is found. */ -//teleport to creature +// teleport to creature bool ChatHandler::HandleGoCreatureCommand(char* args) { if (!*args) @@ -641,7 +641,7 @@ static char const* const gameobjectKeys[] = NULL }; -//teleport to gameobject +// teleport to gameobject bool ChatHandler::HandleGoObjectCommand(char* args) { Player* _player = m_session->GetPlayer(); @@ -895,7 +895,7 @@ bool ChatHandler::HandleGameObjectTargetCommand(char* args) return true; } -//delete object by selection or guid +// delete object by selection or guid bool ChatHandler::HandleGameObjectDeleteCommand(char* args) { // number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r @@ -941,7 +941,7 @@ bool ChatHandler::HandleGameObjectDeleteCommand(char* args) return true; } -//turn selected object +// turn selected object bool ChatHandler::HandleGameObjectTurnCommand(char* args) { // number or [name] Shift-click form |color|Hgameobject:go_id|h[name]|h|r @@ -975,7 +975,7 @@ bool ChatHandler::HandleGameObjectTurnCommand(char* args) return true; } -//move selected object +// move selected object bool ChatHandler::HandleGameObjectMoveCommand(char* args) { // number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r @@ -1047,7 +1047,7 @@ bool ChatHandler::HandleGameObjectMoveCommand(char* args) return true; } -//spawn go +// spawn go bool ChatHandler::HandleGameObjectAddCommand(char* args) { // number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r @@ -1125,7 +1125,7 @@ bool ChatHandler::HandleGameObjectAddCommand(char* args) return true; } -//set pahsemask for selected object +// set pahsemask for selected object bool ChatHandler::HandleGameObjectPhaseCommand(char* args) { // number or [name] Shift-click form |color|Hgameobject:go_id|h[name]|h|r @@ -1549,7 +1549,7 @@ bool ChatHandler::HandleModifyRepCommand(char* args) } //-----------------------Npc Commands----------------------- -//add spawn of creature +// add spawn of creature bool ChatHandler::HandleNpcAddCommand(char* args) { if (!*args) @@ -1600,7 +1600,7 @@ bool ChatHandler::HandleNpcAddCommand(char* args) return true; } -//add item in vendorlist +// add item in vendorlist bool ChatHandler::HandleNpcAddVendorItemCommand(char* args) { uint32 itemId; @@ -1641,7 +1641,7 @@ bool ChatHandler::HandleNpcAddVendorItemCommand(char* args) return true; } -//del item from vendor list +// del item from vendor list bool ChatHandler::HandleNpcDelVendorItemCommand(char* args) { if (!*args) @@ -1676,7 +1676,7 @@ bool ChatHandler::HandleNpcDelVendorItemCommand(char* args) return true; } -//show info about AI +// show info about AI bool ChatHandler::HandleNpcAIInfoCommand(char* /*args*/) { Creature* pTarget = getSelectedCreature(); @@ -1705,7 +1705,7 @@ bool ChatHandler::HandleNpcAIInfoCommand(char* /*args*/) return true; } -//add move for creature +// add move for creature bool ChatHandler::HandleNpcAddMoveCommand(char* args) { uint32 lowguid; @@ -1756,7 +1756,7 @@ bool ChatHandler::HandleNpcAddMoveCommand(char* args) return true; } -//change level of creature or pet +// change level of creature or pet bool ChatHandler::HandleNpcChangeLevelCommand(char* args) { if (!*args) @@ -1793,7 +1793,7 @@ bool ChatHandler::HandleNpcChangeLevelCommand(char* args) return true; } -//set npcflag of creature +// set npcflag of creature bool ChatHandler::HandleNpcFlagCommand(char* args) { if (!*args) @@ -1878,7 +1878,7 @@ bool ChatHandler::HandleNpcDeleteCommand(char* args) return true; } -//move selected creature +// move selected creature bool ChatHandler::HandleNpcMoveCommand(char* args) { uint32 lowguid = 0; @@ -2039,7 +2039,7 @@ bool ChatHandler::HandleNpcSetMoveTypeCommand(char* args) return true; } -//set model of creature +// set model of creature bool ChatHandler::HandleNpcSetModelCommand(char* args) { if (!*args) @@ -2064,7 +2064,7 @@ bool ChatHandler::HandleNpcSetModelCommand(char* args) return true; } -//set faction of creature +// set faction of creature bool ChatHandler::HandleNpcFactionIdCommand(char* args) { if (!*args) @@ -2104,7 +2104,7 @@ bool ChatHandler::HandleNpcFactionIdCommand(char* args) return true; } -//set spawn dist of creature +// set spawn dist of creature bool ChatHandler::HandleNpcSpawnDistCommand(char* args) { if (!*args) @@ -2142,7 +2142,7 @@ bool ChatHandler::HandleNpcSpawnDistCommand(char* args) PSendSysMessage(LANG_COMMAND_SPAWNDIST, option); return true; } -//spawn time handling +// spawn time handling bool ChatHandler::HandleNpcSpawnTimeCommand(char* args) { uint32 stime; @@ -2165,7 +2165,7 @@ bool ChatHandler::HandleNpcSpawnTimeCommand(char* args) return true; } -//npc follow handling +// npc follow handling bool ChatHandler::HandleNpcFollowCommand(char* /*args*/) { Player* player = m_session->GetPlayer(); @@ -2184,7 +2184,7 @@ bool ChatHandler::HandleNpcFollowCommand(char* /*args*/) PSendSysMessage(LANG_CREATURE_FOLLOW_YOU_NOW, creature->GetName()); return true; } -//npc unfollow handling +// npc unfollow handling bool ChatHandler::HandleNpcUnFollowCommand(char* /*args*/) { Player* player = m_session->GetPlayer(); @@ -2221,7 +2221,7 @@ bool ChatHandler::HandleNpcUnFollowCommand(char* /*args*/) PSendSysMessage(LANG_CREATURE_NOT_FOLLOW_YOU_NOW, creature->GetName()); return true; } -//npc tame handling +// npc tame handling bool ChatHandler::HandleNpcTameCommand(char* /*args*/) { Creature* creatureTarget = getSelectedCreature(); @@ -2245,8 +2245,8 @@ bool ChatHandler::HandleNpcTameCommand(char* /*args*/) player->CastSpell(creatureTarget, 13481, true); // Tame Beast, triggered effect return true; } -//npc phasemask handling -//change phasemask of creature or pet +// npc phasemask handling +// change phasemask of creature or pet bool ChatHandler::HandleNpcSetPhaseCommand(char* args) { if (!*args) @@ -2275,7 +2275,7 @@ bool ChatHandler::HandleNpcSetPhaseCommand(char* args) return true; } -//npc deathstate handling +// npc deathstate handling bool ChatHandler::HandleNpcSetDeathStateCommand(char* args) { bool value; @@ -2305,7 +2305,7 @@ bool ChatHandler::HandleNpcSetDeathStateCommand(char* args) return true; } -//TODO: NpcCommands that need to be fixed : +// TODO: NpcCommands that need to be fixed : bool ChatHandler::HandleNpcNameCommand(char* /*args*/) { @@ -2399,7 +2399,7 @@ bool ChatHandler::HandleNpcSubNameCommand(char* /*args*/) return true; } -//move item to other slot +// move item to other slot bool ChatHandler::HandleItemMoveCommand(char* args) { if (!*args) @@ -2435,7 +2435,7 @@ bool ChatHandler::HandleItemMoveCommand(char* args) return true; } -//demorph player or unit +// demorph player or unit bool ChatHandler::HandleDeMorphCommand(char* /*args*/) { Unit* target = getSelectedUnit(); @@ -2452,7 +2452,7 @@ bool ChatHandler::HandleDeMorphCommand(char* /*args*/) return true; } -//morph creature or player +// morph creature or player bool ChatHandler::HandleModifyMorphCommand(char* args) { if (!*args) @@ -2481,7 +2481,7 @@ bool ChatHandler::HandleModifyMorphCommand(char* args) return true; } -//kick player +// kick player bool ChatHandler::HandleKickPlayerCommand(char* args) { Player* target; @@ -2505,7 +2505,7 @@ bool ChatHandler::HandleKickPlayerCommand(char* args) return true; } -//set temporary phase mask for player +// set temporary phase mask for player bool ChatHandler::HandleModifyPhaseCommand(char* args) { if (!*args) @@ -2526,7 +2526,7 @@ bool ChatHandler::HandleModifyPhaseCommand(char* args) return true; } -//show info of player +// show info of player bool ChatHandler::HandlePInfoCommand(char* args) { Player* target; @@ -2613,7 +2613,7 @@ bool ChatHandler::HandlePInfoCommand(char* args) return true; } -//show tickets +// show tickets void ChatHandler::ShowTicket(GMTicket const* ticket) { std::string lastupdated = TimeToTimestampStr(ticket->GetLastUpdate()); @@ -2631,7 +2631,7 @@ void ChatHandler::ShowTicket(GMTicket const* ticket) PSendSysMessage(LANG_COMMAND_TICKETRESPONSE, ticket->GetResponse()); } -//ticket commands +// ticket commands bool ChatHandler::HandleTicketCommand(char* args) { char* px = ExtractLiteralArg(&args); @@ -2774,7 +2774,7 @@ bool ChatHandler::HandleTicketCommand(char* args) return true; } -//dell all tickets +// dell all tickets bool ChatHandler::HandleDelTicketCommand(char* args) { char* px = ExtractLiteralArg(&args); @@ -2811,7 +2811,7 @@ bool ChatHandler::HandleDelTicketCommand(char* args) sTicketMgr.Delete(guid); - //notify player + // notify player if (Player* pl = sObjectMgr.GetPlayer(guid)) { pl->GetSession()->SendGMTicketGetTicket(0x0A); @@ -3349,7 +3349,7 @@ bool ChatHandler::HandleWpModifyCommand(char* args) // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells(); wpCreature2->LoadFromDB(wpCreature2->GetGUIDLow(), map); map->Add(wpCreature2); - //npcCreature->GetMap()->Add(wpCreature2); + // npcCreature->GetMap()->Add(wpCreature2); } sWaypointMgr.SetNodePosition(lowguid, point, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ()); @@ -3447,7 +3447,7 @@ bool ChatHandler::HandleWpShowCommand(char* args) // second arg: GUID (optional, if a creature is selected) char* guid_str = strtok((char*)NULL, " "); DEBUG_LOG("DEBUG: HandleWpShowCommand: show_str: %s guid_str: %s", show_str, guid_str); - //if (!guid_str) { + // if (!guid_str) { // return false; //} @@ -3520,9 +3520,9 @@ bool ChatHandler::HandleWpShowCommand(char* args) return false; } - //PSendSysMessage("wp on, GUID: %u", lowguid); + // PSendSysMessage("wp on, GUID: %u", lowguid); - //pCreature->GetPositionX(); + // pCreature->GetPositionX(); QueryResult* result = WorldDatabase.PQuery("SELECT id, point, waittime, emote, spell, textid1, textid2, textid3, textid4, textid5, model1, model2 FROM creature_movement WHERE wpguid = %u", @@ -3652,7 +3652,7 @@ bool ChatHandler::HandleWpShowCommand(char* args) // To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells(); wpCreature->LoadFromDB(wpCreature->GetGUIDLow(), map); map->Add(wpCreature); - //wpCreature->GetMap()->Add(wpCreature); + // wpCreature->GetMap()->Add(wpCreature); } while (result->NextRow()); @@ -3692,7 +3692,7 @@ bool ChatHandler::HandleWpShowCommand(char* args) pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn()); pCreature->LoadFromDB(pCreature->GetGUIDLow(), map); map->Add(pCreature); - //player->PlayerTalkClass->SendPointOfInterest(x, y, 6, 6, 0, "First Waypoint"); + // player->PlayerTalkClass->SendPointOfInterest(x, y, 6, 6, 0, "First Waypoint"); // Cleanup memory delete result; @@ -3740,7 +3740,7 @@ bool ChatHandler::HandleWpShowCommand(char* args) pCreature->SaveToDB(map->GetId(), (1 << map->GetSpawnMode()), chr->GetPhaseMaskForSpawn()); pCreature->LoadFromDB(pCreature->GetGUIDLow(), map); map->Add(pCreature); - //player->PlayerTalkClass->SendPointOfInterest(x, y, 6, 6, 0, "Last Waypoint"); + // player->PlayerTalkClass->SendPointOfInterest(x, y, 6, 6, 0, "Last Waypoint"); // Cleanup memory delete result; return true; @@ -3931,7 +3931,7 @@ bool ChatHandler::HandleWpImportCommand(char* args) while (! infile.eof()) { getline(infile, line); - //cout << line << endl; + // cout << line << endl; QueryResult* result = WorldDatabase.Query(line.c_str()); delete result; } @@ -3942,7 +3942,7 @@ bool ChatHandler::HandleWpImportCommand(char* args) return true; } -//rename characters +// rename characters bool ChatHandler::HandleCharacterRenameCommand(char* args) { Player* target; @@ -4020,7 +4020,7 @@ bool ChatHandler::HandleCharacterReputationCommand(char* args) return true; } -//change standstate +// change standstate bool ChatHandler::HandleModifyStandStateCommand(char* args) { uint32 anim_id; @@ -4360,7 +4360,7 @@ bool ChatHandler::HandleLearnAllCraftsCommand(char* /*args*/) continue; if ((skillInfo->categoryId == SKILL_CATEGORY_PROFESSION || skillInfo->categoryId == SKILL_CATEGORY_SECONDARY) && - skillInfo->canLink) // only prof. with recipes have + skillInfo->canLink) // only prof. with recipes have { HandleLearnSkillRecipesHelper(m_session->GetPlayer(), skillInfo->id); } @@ -4404,7 +4404,7 @@ bool ChatHandler::HandleLearnAllRecipesCommand(char* args) if ((skillInfo->categoryId != SKILL_CATEGORY_PROFESSION && skillInfo->categoryId != SKILL_CATEGORY_SECONDARY) || - !skillInfo->canLink) // only prof with recipes have set + !skillInfo->canLink) // only prof with recipes have set continue; int loc = GetSessionDbcLocale(); @@ -5183,7 +5183,7 @@ bool ChatHandler::HandleTitlesRemoveCommand(char* args) return true; } -//Edit Player KnownTitles +// Edit Player KnownTitles bool ChatHandler::HandleTitlesSetMaskCommand(char* args) { if (!*args) diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index e0a9f6d97..b252304e2 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -224,7 +224,7 @@ bool ChatHandler::HandleAHBotStatusCommand(char* args) return true; } -//reload commands +// reload commands bool ChatHandler::HandleReloadAllCommand(char* /*args*/) { HandleReloadSkillFishingBaseLevelCommand((char*)""); @@ -257,7 +257,7 @@ bool ChatHandler::HandleReloadAllAchievementCommand(char* /*args*/) bool ChatHandler::HandleReloadAllAreaCommand(char* /*args*/) { - //HandleReloadQuestAreaTriggersCommand((char*)""); -- reloaded in HandleReloadAllQuestCommand + // HandleReloadQuestAreaTriggersCommand((char*)""); -- reloaded in HandleReloadAllQuestCommand HandleReloadAreaTriggerTeleportCommand((char*)""); HandleReloadAreaTriggerTavernCommand((char*)""); HandleReloadGameGraveyardZoneCommand((char*)""); @@ -2296,8 +2296,8 @@ bool ChatHandler::HandleLearnAllGMCommand(char* /*args*/) "29878", // Kill My Self "26644", // More Kill - "28550", //Invisible 24 - "23452", //Invisible + Target + "28550", // Invisible 24 + "23452", // Invisible + Target "0" }; @@ -2611,7 +2611,7 @@ bool ChatHandler::HandleAddItemCommand(char* args) return false; } - //Subtract + // Subtract if (count < 0) { plTarget->DestroyItemCount(itemId, -count, true, false); @@ -2619,7 +2619,7 @@ bool ChatHandler::HandleAddItemCommand(char* args) return true; } - //Adding items + // Adding items uint32 noSpaceForCount = 0; // check space and find places @@ -4130,7 +4130,7 @@ bool ChatHandler::HandleNearGraveCommand(char* args) team_name = GetMangosString(LANG_COMMAND_GRAVEYARD_HORDE); else if (data->team == ALLIANCE) team_name = GetMangosString(LANG_COMMAND_GRAVEYARD_ALLIANCE); - else // Actually, this case cannot happen + else // Actually, this case cannot happen team_name = GetMangosString(LANG_COMMAND_GRAVEYARD_NOTEAM); PSendSysMessage(LANG_COMMAND_GRAVEYARDNEAREST, g_id, team_name.c_str(), zone_id); @@ -4254,7 +4254,7 @@ bool ChatHandler::HandleNpcInfoCommand(char* /*args*/) return true; } -//play npc emote +// play npc emote bool ChatHandler::HandleNpcPlayEmoteCommand(char* args) { uint32 emote = atoi(args); @@ -4272,7 +4272,7 @@ bool ChatHandler::HandleNpcPlayEmoteCommand(char* args) return true; } -//TODO: NpcCommands that needs to be fixed : +// TODO: NpcCommands that needs to be fixed : bool ChatHandler::HandleNpcAddWeaponCommand(char* /*args*/) { @@ -4400,7 +4400,7 @@ void ChatHandler::HandleCharacterLevel(Player* player, ObjectGuid player_guid, u ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_PROGRESS_RESET, GetNameLink().c_str()); else if (oldlevel < newlevel) ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_UP, GetNameLink().c_str(), newlevel); - else // if(oldlevel > newlevel) + else // if(oldlevel > newlevel) ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_DOWN, GetNameLink().c_str(), newlevel); } } @@ -4707,7 +4707,7 @@ bool ChatHandler::HandleStableCommand(char* /*args*/) bool ChatHandler::HandleChangeWeatherCommand(char* args) { - //Weather is OFF + // Weather is OFF if (!sWorld.getConfig(CONFIG_BOOL_WEATHER)) { SendSysMessage(LANG_WEATHER_DISABLED); @@ -4989,7 +4989,7 @@ static bool HandleResetStatsOrLevelHelper(Player* player) //-1 is default value player->SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, -1); - //player->SetUInt32Value(PLAYER_FIELD_BYTES, 0xEEE00000 ); + // player->SetUInt32Value(PLAYER_FIELD_BYTES, 0xEEE00000 ); return true; } @@ -7003,11 +7003,11 @@ bool ChatHandler::HandleSendMessageCommand(char* args) } ///- Send the message - //Use SendAreaTriggerMessage for fastest delivery. + // Use SendAreaTriggerMessage for fastest delivery. rPlayer->GetSession()->SendAreaTriggerMessage("%s", args); rPlayer->GetSession()->SendAreaTriggerMessage("|cffff0000[Message from administrator]:|r"); - //Confirmation message + // Confirmation message std::string nameLink = GetNameLink(rPlayer); PSendSysMessage(LANG_SENDMESSAGE, nameLink.c_str(), args); return true; @@ -7042,7 +7042,7 @@ bool ChatHandler::HandleModifyGenderCommand(char* args) Gender gender; - if (!strncmp(gender_str, "male", gender_len)) // MALE + if (!strncmp(gender_str, "male", gender_len)) // MALE { if (player->getGender() == GENDER_MALE) return true; diff --git a/src/game/LootHandler.cpp b/src/game/LootHandler.cpp index 58c5d7611..5199ae36d 100644 --- a/src/game/LootHandler.cpp +++ b/src/game/LootHandler.cpp @@ -137,7 +137,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recv_data) if (qitem) { qitem->is_looted = true; - //freeforall is 1 if everyone's supposed to get the quest item. + // freeforall is 1 if everyone's supposed to get the quest item. if (item->freeforall || loot->GetPlayerQuestItems().size() == 1) player->SendNotifyLootItemRemoved(lootSlot); else @@ -147,20 +147,20 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recv_data) { if (ffaitem) { - //freeforall case, notify only one player of the removal + // freeforall case, notify only one player of the removal ffaitem->is_looted = true; player->SendNotifyLootItemRemoved(lootSlot); } else { - //not freeforall, notify everyone + // not freeforall, notify everyone if (conditem) conditem->is_looted = true; loot->NotifyItemRemoved(lootSlot); } } - //if only one person is supposed to loot the item, then set it to looted + // if only one person is supposed to loot the item, then set it to looted if (!item->freeforall) item->is_looted = true; @@ -237,7 +237,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recv_data*/) { pLoot->NotifyMoneyRemoved(); - if (!guid.IsItem() && player->GetGroup()) //item can be looted only single player + if (!guid.IsItem() && player->GetGroup()) // item can be looted only single player { Group* group = player->GetGroup(); @@ -373,22 +373,22 @@ void WorldSession::DoLootRelease(ObjectGuid lguid) { go->SetLootState(GO_READY); } - else // not have more uses + else // not have more uses go->SetLootState(GO_JUST_DEACTIVATED); } - else // 100% chance until min uses + else // 100% chance until min uses go->SetLootState(GO_READY); } - else // max uses already + else // max uses already go->SetLootState(GO_JUST_DEACTIVATED); } - else // not vein + else // not vein go->SetLootState(GO_JUST_DEACTIVATED); } else if (go->GetGoType() == GAMEOBJECT_TYPE_FISHINGHOLE) { // The fishing hole used once more - go->AddUse(); // if the max usage is reached, will be despawned at next tick + go->AddUse(); // if the max usage is reached, will be despawned at next tick if (go->GetUseCount() >= urand(go->GetGOInfo()->fishinghole.minSuccessOpens, go->GetGOInfo()->fishinghole.maxSuccessOpens)) { go->SetLootState(GO_JUST_DEACTIVATED); @@ -503,7 +503,7 @@ void WorldSession::DoLootRelease(ObjectGuid lguid) } } - //Player is not looking at loot list, he doesn't need to see updates on the loot list + // Player is not looking at loot list, he doesn't need to see updates on the loot list loot->RemoveLooter(player->GetObjectGuid()); } diff --git a/src/game/LootMgr.cpp b/src/game/LootMgr.cpp index 217c63591..4cfd4394e 100644 --- a/src/game/LootMgr.cpp +++ b/src/game/LootMgr.cpp @@ -29,13 +29,13 @@ static eConfigFloatValues const qualityToRate[MAX_ITEM_QUALITY] = { - CONFIG_FLOAT_RATE_DROP_ITEM_POOR, // ITEM_QUALITY_POOR - CONFIG_FLOAT_RATE_DROP_ITEM_NORMAL, // ITEM_QUALITY_NORMAL - CONFIG_FLOAT_RATE_DROP_ITEM_UNCOMMON, // ITEM_QUALITY_UNCOMMON - CONFIG_FLOAT_RATE_DROP_ITEM_RARE, // ITEM_QUALITY_RARE - CONFIG_FLOAT_RATE_DROP_ITEM_EPIC, // ITEM_QUALITY_EPIC - CONFIG_FLOAT_RATE_DROP_ITEM_LEGENDARY, // ITEM_QUALITY_LEGENDARY - CONFIG_FLOAT_RATE_DROP_ITEM_ARTIFACT, // ITEM_QUALITY_ARTIFACT + CONFIG_FLOAT_RATE_DROP_ITEM_POOR, // ITEM_QUALITY_POOR + CONFIG_FLOAT_RATE_DROP_ITEM_NORMAL, // ITEM_QUALITY_NORMAL + CONFIG_FLOAT_RATE_DROP_ITEM_UNCOMMON, // ITEM_QUALITY_UNCOMMON + CONFIG_FLOAT_RATE_DROP_ITEM_RARE, // ITEM_QUALITY_RARE + CONFIG_FLOAT_RATE_DROP_ITEM_EPIC, // ITEM_QUALITY_EPIC + CONFIG_FLOAT_RATE_DROP_ITEM_LEGENDARY, // ITEM_QUALITY_LEGENDARY + CONFIG_FLOAT_RATE_DROP_ITEM_ARTIFACT, // ITEM_QUALITY_ARTIFACT }; LootStore LootTemplates_Creature("creature_loot_template", "creature entry", true); @@ -72,7 +72,7 @@ class LootTemplate::LootGroup // A set of loot def LootStoreItem const* Roll() const; // Rolls an item from the group, returns NULL if all miss their chances }; -//Remove all data and free all memory +// Remove all data and free all memory void LootStore::Clear() { for (LootTemplateMap::const_iterator itr = m_LootTemplates.begin(); itr != m_LootTemplates.end(); ++itr) @@ -739,7 +739,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootItem const& li) b << uint32(ObjectMgr::GetItemPrototype(li.itemid)->DisplayInfoID); b << uint32(li.randomSuffix); b << uint32(li.randomPropertyId); - //b << uint8(0); // slot type - will send after this function call + // b << uint8(0); // slot type - will send after this function call return b; } @@ -747,7 +747,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) { if (lv.permission == NONE_PERMISSION) { - b << uint32(0); //gold + b << uint32(0); // gold b << uint8(0); // item count return b; // nothing output more } @@ -756,7 +756,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) uint8 itemsShown = 0; - //gold + // gold b << uint32(l.gold); size_t count_pos = b.wpos(); // pos of item count byte @@ -834,7 +834,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) } } - //update number of items shown + // update number of items shown b.put(count_pos, itemsShown); return b; @@ -860,7 +860,7 @@ LootStoreItem const* LootTemplate::LootGroup::Roll() const { float Roll = rand_chance_f(); - for (uint32 i = 0; i < ExplicitlyChanced.size(); ++i) //check each explicitly chanced entry in the template and modify its chance based on quality. + for (uint32 i = 0; i < ExplicitlyChanced.size(); ++i) // check each explicitly chanced entry in the template and modify its chance based on quality. { if (ExplicitlyChanced[i].chance >= 100.0f) return &ExplicitlyChanced[i]; @@ -1310,7 +1310,7 @@ void LoadLootTemplates_Prospecting() if (ids_set.find(proto->ItemId) != ids_set.end()) ids_set.erase(proto->ItemId); - //else -- exist some cases that possible can be prospected but not expected have any result loot + // else -- exist some cases that possible can be prospected but not expected have any result loot // LootTemplates_Prospecting.ReportNotExistedId(proto->ItemId); } diff --git a/src/game/LootMgr.h b/src/game/LootMgr.h index 480c25d79..82c6226a1 100644 --- a/src/game/LootMgr.h +++ b/src/game/LootMgr.h @@ -178,7 +178,7 @@ class LootStore class LootTemplate { - class LootGroup; // A set of loot definitions for items (refs are not allowed inside) + class LootGroup; // A set of loot definitions for items (refs are not allowed inside) typedef std::vector LootGroups; public: @@ -243,7 +243,7 @@ struct Loot LootItemList items; uint32 gold; uint8 unlootedCount; - LootType loot_type; // required for achievement system + LootType loot_type; // required for achievement system Loot(uint32 _gold = 0) : gold(_gold), unlootedCount(0), loot_type(LOOT_CORPSE) {} ~Loot() { clear(); } diff --git a/src/game/MailHandler.cpp b/src/game/MailHandler.cpp index ce2c8e991..375ead070 100644 --- a/src/game/MailHandler.cpp +++ b/src/game/MailHandler.cpp @@ -423,8 +423,8 @@ void WorldSession::HandleMailReturnToSender(WorldPacket& recv_data) return; } - //we can return mail now - //so firstly delete the old one + // we can return mail now + // so firstly delete the old one CharacterDatabase.BeginTransaction(); CharacterDatabase.PExecute("DELETE FROM mail WHERE id = '%u'", mailId); // needed? diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 876fc5cbd..b1f16b7de 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -57,7 +57,7 @@ Map::~Map() // unload instance specific navigation data MMAP::MMapFactory::createOrGetMMapManager()->unloadMapInstance(m_TerrainData->GetMapId(), GetInstanceId()); - //release reference count + // release reference count if (m_TerrainData->Release()) sTerrainMgr.UnloadTerrain(m_TerrainData->GetMapId()); } @@ -87,16 +87,16 @@ Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode) { for (unsigned int idx = 0; idx < MAX_NUMBER_OF_GRIDS; ++idx) { - //z code + // z code m_bLoadedGrids[idx][j] = false; setNGrid(NULL, idx, j); } } - //lets initialize visibility distance for map + // lets initialize visibility distance for map Map::InitVisibilityDistance(); - //add reference for TerrainData object + // add reference for TerrainData object m_TerrainData->AddRef(); m_persistentState = sMapPersistentStateMgr.AddPersistentState(i_mapEntry, GetInstanceId(), GetDifficulty(), 0, IsDungeon()); @@ -105,7 +105,7 @@ Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode) void Map::InitVisibilityDistance() { - //init visibility for continents + // init visibility for continents m_VisibleDistance = World::GetMaxVisibleDistanceOnContinents(); } @@ -215,7 +215,7 @@ Map::EnsureGridCreated(const GridPair& p) getNGrid(p.x_coord, p.y_coord)->SetGridState(GRID_STATE_IDLE); - //z coord + // z coord int gx = (MAX_NUMBER_OF_GRIDS - 1) - p.x_coord; int gy = (MAX_NUMBER_OF_GRIDS - 1) - p.y_coord; @@ -260,11 +260,11 @@ bool Map::EnsureGridLoaded(const Cell& cell) MANGOS_ASSERT(grid != NULL); if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY())) { - //it's important to set it loaded before loading! - //otherwise there is a possibility of infinity chain (grid loading will be called many times for the same grid) - //possible scenario: - //active object A(loaded with loader.LoadN call and added to the map) - //summons some active object B, while B added to map grid loading called again and so on.. + // it's important to set it loaded before loading! + // otherwise there is a possibility of infinity chain (grid loading will be called many times for the same grid) + // possible scenario: + // active object A(loaded with loader.LoadN call and added to the map) + // summons some active object B, while B added to map grid loading called again and so on.. setGridObjectDataLoaded(true, cell.GridX(), cell.GridY()); ObjectGridLoader loader(*grid, this, cell); loader.LoadN(); @@ -382,8 +382,8 @@ void Map::MessageBroadcast(WorldObject* obj, WorldPacket* msg) if (!loaded(GridPair(cell.data.Part.grid_x, cell.data.Part.grid_y))) return; - //TODO: currently on continents when Visibility.Distance.InFlight > Visibility.Distance.Continents - //we have alot of blinking mobs because monster move packet send is broken... + // TODO: currently on continents when Visibility.Distance.InFlight > Visibility.Distance.Continents + // we have alot of blinking mobs because monster move packet send is broken... MaNGOS::ObjectMessageDeliverer post_man(*obj, msg); TypeContainerVisitor message(post_man); cell.Visit(p, message, *this, *obj, GetVisibilityDistance()); @@ -480,7 +480,7 @@ void Map::Update(const uint32& t_diff) if (!plr->IsInWorld() || !plr->IsPositionValid()) continue; - //lets update mobs/objects in ALL visible cells around player! + // lets update mobs/objects in ALL visible cells around player! CellArea area = Cell::CalculateCellArea(plr->GetPositionX(), plr->GetPositionY(), GetVisibilityDistance()); for (uint32 x = area.low_bound.x_coord; x <= area.high_bound.x_coord; ++x) @@ -518,7 +518,7 @@ void Map::Update(const uint32& t_diff) if (!obj->IsInWorld() || !obj->IsPositionValid()) continue; - //lets update mobs/objects in ALL visible cells around player! + // lets update mobs/objects in ALL visible cells around player! CellArea area = Cell::CalculateCellArea(obj->GetPositionX(), obj->GetPositionY(), GetVisibilityDistance()); for (uint32 x = area.low_bound.x_coord; x <= area.high_bound.x_coord; ++x) @@ -553,7 +553,7 @@ void Map::Update(const uint32& t_diff) { NGridType* grid = i->getSource(); GridInfo* info = i->getSource()->getGridInfoRef(); - ++i; // The update might delete the map and we need the next map before the iterator gets invalid + ++i; // The update might delete the map and we need the next map before the iterator gets invalid MANGOS_ASSERT(grid->GetGridState() >= 0 && grid->GetGridState() < MAX_GRID_STATE); sMapMgr.UpdateGridState(grid->GetGridState(), *this, *grid, *info, grid->getX(), grid->getY(), t_diff); } @@ -985,7 +985,7 @@ void Map::AddObjectToRemoveList(WorldObject* obj) obj->CleanupsBeforeDelete(); // remove or simplify at least cross referenced links i_objectsToRemove.insert(obj); - //DEBUG_LOG("Object (GUID: %u TypeId: %u ) added to removing list.",obj->GetGUIDLow(),obj->GetTypeId()); + // DEBUG_LOG("Object (GUID: %u TypeId: %u ) added to removing list.",obj->GetGUIDLow(),obj->GetTypeId()); } void Map::RemoveAllObjectsInRemoveList() @@ -993,7 +993,7 @@ void Map::RemoveAllObjectsInRemoveList() if (i_objectsToRemove.empty()) return; - //DEBUG_LOG("Object remover 1 check."); + // DEBUG_LOG("Object remover 1 check."); while (!i_objectsToRemove.empty()) { WorldObject* obj = *i_objectsToRemove.begin(); @@ -1025,7 +1025,7 @@ void Map::RemoveAllObjectsInRemoveList() break; } } - //DEBUG_LOG("Object remover 2 check."); + // DEBUG_LOG("Object remover 2 check."); } uint32 Map::GetPlayersCountExceptGMs() const @@ -1051,7 +1051,7 @@ bool Map::ActiveObjectsNearGrid(uint32 x, uint32 y) const CellPair cell_min(x * MAX_NUMBER_OF_CELLS, y * MAX_NUMBER_OF_CELLS); CellPair cell_max(cell_min.x_coord + MAX_NUMBER_OF_CELLS, cell_min.y_coord + MAX_NUMBER_OF_CELLS); - //we must find visible range in cells so we unload only non-visible cells... + // we must find visible range in cells so we unload only non-visible cells... float viewDist = GetVisibilityDistance(); int cell_range = (int)ceilf(viewDist / SIZE_OF_GRID_CELL) + 1; @@ -1229,7 +1229,7 @@ DungeonMap::DungeonMap(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnM { MANGOS_ASSERT(i_mapEntry->IsDungeon()); - //lets initialize visibility distance for dungeons + // lets initialize visibility distance for dungeons DungeonMap::InitVisibilityDistance(); // the timer is started by default, and stopped when the first player joins @@ -1243,7 +1243,7 @@ DungeonMap::~DungeonMap() void DungeonMap::InitVisibilityDistance() { - //init visibility distance for instances + // init visibility distance for instances m_VisibleDistance = World::GetMaxVisibleDistanceInInstances(); } @@ -1404,7 +1404,7 @@ void DungeonMap::Remove(Player* player, bool remove) { DETAIL_LOG("MAP: Removing player '%s' from instance '%u' of map '%s' before relocating to other map", player->GetName(), GetInstanceId(), GetMapName()); - //if last player set unload timer + // if last player set unload timer if (!m_unloadTimer && m_mapRefManager.getSize() == 1) m_unloadTimer = m_unloadWhenEmpty ? MIN_UNLOAD_DELAY : std::max(sWorld.getConfig(CONFIG_UINT32_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY); @@ -1523,7 +1523,7 @@ DungeonPersistentState* DungeonMap::GetPersistanceState() const BattleGroundMap::BattleGroundMap(uint32 id, time_t expiry, uint32 InstanceId, uint8 spawnMode) : Map(id, expiry, InstanceId, spawnMode) { - //lets initialize visibility distance for BG/Arenas + // lets initialize visibility distance for BG/Arenas BattleGroundMap::InitVisibilityDistance(); } @@ -1546,7 +1546,7 @@ BattleGroundPersistentState* BattleGroundMap::GetPersistanceState() const void BattleGroundMap::InitVisibilityDistance() { - //init visibility distance for BG/Arenas + // init visibility distance for BG/Arenas m_VisibleDistance = World::GetMaxVisibleDistanceInBGArenas(); } diff --git a/src/game/Map.h b/src/game/Map.h index 753141d98..39eea183b 100644 --- a/src/game/Map.h +++ b/src/game/Map.h @@ -127,7 +127,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager void MessageDistBroadcast(WorldObject*, WorldPacket*, float dist); float GetVisibilityDistance() const { return m_VisibleDistance; } - //function for setting up visibility distance for maps on per-type/per-Id basis + // function for setting up visibility distance for maps on per-type/per-Id basis virtual void InitVisibilityDistance(); void PlayerRelocation(Player*, float x, float y, float z, float angl); @@ -214,7 +214,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager typedef MapRefManager PlayerList; PlayerList const& GetPlayers() const { return m_mapRefManager; } - //per-map script storage + // per-map script storage bool ScriptsStart(ScriptMapMapName const& scripts, uint32 id, Object* source, Object* target); void ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* source, Object* target); @@ -249,7 +249,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager // DynObjects currently uint32 GenerateLocalLowGuid(HighGuid guidhigh); - //get corresponding TerrainData object for this particular map + // get corresponding TerrainData object for this particular map const TerrainInfo* GetTerrain() const { return m_TerrainData; } void CreateInstanceData(bool load); @@ -327,7 +327,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager NGridType* i_grids[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]; - //Shared geodata object with map coord info... + // Shared geodata object with map coord info... TerrainInfo* const m_TerrainData; bool m_bLoadedGrids[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]; diff --git a/src/game/MapManager.cpp b/src/game/MapManager.cpp index dce609378..0fa5e54b3 100644 --- a/src/game/MapManager.cpp +++ b/src/game/MapManager.cpp @@ -89,7 +89,7 @@ void MapManager::InitializeVisibilityDistanceInfo() Map* MapManager::CreateMap(uint32 id, const WorldObject* obj) { MANGOS_ASSERT(obj); - //if(!obj->IsInWorld()) sLog.outError("GetMap: called for map %d with object (typeid %d, guid %d, mapid %d, instanceid %d) who is not in world!", id, obj->GetTypeId(), obj->GetGUIDLow(), obj->GetMapId(), obj->GetInstanceId()); + // if(!obj->IsInWorld()) sLog.outError("GetMap: called for map %d with object (typeid %d, guid %d, mapid %d, instanceid %d) who is not in world!", id, obj->GetTypeId(), obj->GetGUIDLow(), obj->GetMapId(), obj->GetInstanceId()); Guard _guard(*this); Map* m = NULL; @@ -101,18 +101,18 @@ Map* MapManager::CreateMap(uint32 id, const WorldObject* obj) if (entry->Instanceable()) { MANGOS_ASSERT(obj->GetTypeId() == TYPEID_PLAYER); - //create DungeonMap object + // create DungeonMap object if (obj->GetTypeId() == TYPEID_PLAYER) m = CreateInstance(id, (Player*)obj); } else { - //create regular non-instanceable map + // create regular non-instanceable map m = FindMap(id); if (m == NULL) { m = new WorldMap(id, i_gridCleanUpDelay); - //add map into container + // add map into container i_maps[MapID(id)] = m; // non-instanceable maps always expected have saved state @@ -139,7 +139,7 @@ Map* MapManager::FindMap(uint32 mapid, uint32 instanceId) const if (iter == i_maps.end()) return NULL; - //this is a small workaround for transports + // this is a small workaround for transports if (instanceId == 0 && iter->second->Instanceable()) { assert(false); @@ -181,13 +181,13 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player) } } - //The player has a heroic mode and tries to enter into instance which has no a heroic mode + // The player has a heroic mode and tries to enter into instance which has no a heroic mode MapDifficulty const* mapDiff = GetMapDifficultyData(entry->MapID, player->GetDifficulty(entry->map_type == MAP_RAID)); if (!mapDiff) { bool isRegularTargetMap = player->GetDifficulty(entry->IsRaid()) == REGULAR_DIFFICULTY; - //Send aborted message + // Send aborted message // FIX ME: what about absent normal/heroic mode with specific players limit... player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, isRegularTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC); return false; @@ -239,12 +239,12 @@ MapManager::Update(uint32 diff) helper.Update((uint32)i_timer.GetCurrent()); } - //remove all maps which can be unloaded + // remove all maps which can be unloaded MapMapType::iterator iter = i_maps.begin(); while (iter != i_maps.end()) { Map* pMap = iter->second; - //check if map can be unloaded + // check if map can be unloaded if (pMap->CanUnload((uint32)i_timer.GetCurrent())) { pMap->UnloadAll(true); @@ -326,7 +326,7 @@ Map* MapManager::CreateInstance(uint32 id, Player* player) { Map* map = NULL; Map* pNewMap = NULL; - uint32 NewInstanceId = 0; // instanceId of the resulting map + uint32 NewInstanceId = 0; // instanceId of the resulting map const MapEntry* entry = sMapStore.LookupEntry(id); if (entry->IsBattleGroundOrArena()) @@ -356,7 +356,7 @@ Map* MapManager::CreateInstance(uint32 id, Player* player) pNewMap = CreateDungeonMap(id, NewInstanceId, diff); } - //add a new map object into the registry + // add a new map object into the registry if (pNewMap) { i_maps[MapID(id, NewInstanceId)] = pNewMap; @@ -408,7 +408,7 @@ BattleGroundMap* MapManager::CreateBattleGroundMap(uint32 id, uint32 InstanceId, map->SetBG(bg); bg->SetBgMap(map); - //add map into map container + // add map into map container i_maps[MapID(id, InstanceId)] = map; // BGs/Arenas not have saved instance data diff --git a/src/game/MapManager.h b/src/game/MapManager.h index 7e57a9205..2fede2d1d 100644 --- a/src/game/MapManager.h +++ b/src/game/MapManager.h @@ -88,7 +88,7 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton diff --git a/src/game/MapPersistentStateMgr.cpp b/src/game/MapPersistentStateMgr.cpp index 7bdb4f9cf..d97014c71 100644 --- a/src/game/MapPersistentStateMgr.cpp +++ b/src/game/MapPersistentStateMgr.cpp @@ -753,7 +753,7 @@ void MapPersistentStateManager::CleanupInstances() // clean unused respawn data CharacterDatabase.Execute("DELETE FROM creature_respawn WHERE instance <> 0 AND instance NOT IN (SELECT id FROM instance)"); CharacterDatabase.Execute("DELETE FROM gameobject_respawn WHERE instance <> 0 AND instance NOT IN (SELECT id FROM instance)"); - //execute transaction directly + // execute transaction directly CharacterDatabase.CommitTransaction(); bar.step(); @@ -801,7 +801,7 @@ void MapPersistentStateManager::PackInstances() CharacterDatabase.PExecute("UPDATE character_instance SET instance = '%u' WHERE instance = '%u'", InstanceNumber, *i); CharacterDatabase.PExecute("UPDATE instance SET id = '%u' WHERE id = '%u'", InstanceNumber, *i); CharacterDatabase.PExecute("UPDATE group_instance SET instance = '%u' WHERE instance = '%u'", InstanceNumber, *i); - //execute transaction synchronously + // execute transaction synchronously CharacterDatabase.CommitTransaction(); } diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index d70dc220f..91cc77071 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -62,7 +62,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket& recv_data) GetPlayer()->KillPlayer(); } - //this is spirit release confirm? + // this is spirit release confirm? GetPlayer()->RemovePet(PET_SAVE_REAGENTS); GetPlayer()->BuildPlayerRepop(); GetPlayer()->RepopAtGraveyard(); @@ -71,7 +71,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket& recv_data) void WorldSession::HandleWhoOpcode(WorldPacket& recv_data) { DEBUG_LOG("WORLD: Recvd CMSG_WHO Message"); - //recv_data.hexlike(); + // recv_data.hexlike(); uint32 clientcount = 0; @@ -267,9 +267,9 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket& /*recv_data*/) if (ObjectGuid lootGuid = GetPlayer()->GetLootGuid()) DoLootRelease(lootGuid); - //Can not logout if... + // Can not logout if... if (GetPlayer()->isInCombat() || //...is in combat - GetPlayer()->duel || //...is in Duel + GetPlayer()->duel || //...is in Duel //...is jumping ...is falling GetPlayer()->m_movementInfo.HasMovementFlag(MovementFlags(MOVEFLAG_FALLING | MOVEFLAG_FALLINGFAR))) { @@ -281,7 +281,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket& /*recv_data*/) return; } - //instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in mangosd.conf + // instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in mangosd.conf if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->IsTaxiFlying() || GetSecurity() >= (AccountTypes)sWorld.getConfig(CONFIG_UINT32_INSTANT_LOGOUT)) { @@ -1048,13 +1048,13 @@ void WorldSession::HandleMoveUnRootAck(WorldPacket& recv_data) // now can skip not our packet if(_player->GetGUID() != guid) { - recv_data.rpos(recv_data.wpos()); // prevent warnings spam + recv_data.rpos(recv_data.wpos()); // prevent warnings spam return; } DEBUG_LOG( "WORLD: CMSG_FORCE_MOVE_UNROOT_ACK" ); - recv_data.read_skip(); // unk + recv_data.read_skip(); // unk MovementInfo movementInfo; ReadMovementInfo(recv_data, &movementInfo); @@ -1072,13 +1072,13 @@ void WorldSession::HandleMoveRootAck(WorldPacket& recv_data) // now can skip not our packet if(_player->GetObjectGuid() != guid) { - recv_data.rpos(recv_data.wpos()); // prevent warnings spam + recv_data.rpos(recv_data.wpos()); // prevent warnings spam return; } DEBUG_LOG( "WORLD: CMSG_FORCE_MOVE_ROOT_ACK" ); - recv_data.read_skip(); // unk + recv_data.read_skip(); // unk MovementInfo movementInfo; ReadMovementInfo(recv_data, &movementInfo); @@ -1195,7 +1195,7 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data) recv_data >> PositionZ; recv_data >> Orientation; // o (3.141593 = 180 degrees) - //DEBUG_LOG("Received opcode CMSG_WORLD_TELEPORT"); + // DEBUG_LOG("Received opcode CMSG_WORLD_TELEPORT"); if (GetPlayer()->IsTaxiFlying()) { @@ -1327,13 +1327,13 @@ void WorldSession::HandleRealmSplitOpcode(WorldPacket& recv_data) // 0x2 realm split pending data << split_date; SendPacket(&data); - //DEBUG_LOG("response sent %u", unk); + // DEBUG_LOG("response sent %u", unk); } void WorldSession::HandleFarSightOpcode(WorldPacket& recv_data) { DEBUG_LOG("WORLD: CMSG_FAR_SIGHT"); - //recv_data.hexlike(); + // recv_data.hexlike(); uint8 op; recv_data >> op; @@ -1499,7 +1499,7 @@ void WorldSession::HandleCancelMountAuraOpcode(WorldPacket& /*recv_data*/) { DEBUG_LOG("WORLD: CMSG_CANCEL_MOUNT_AURA"); - //If player is not mounted, so go out :) + // If player is not mounted, so go out :) if (!_player->IsMounted()) // not blizz like; no any messages on blizz { ChatHandler(this).SendSysMessage(LANG_CHAR_NON_MOUNTED); @@ -1520,7 +1520,7 @@ void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket& recv_data) { // fly mode on/off DEBUG_LOG("WORLD: CMSG_MOVE_SET_CAN_FLY_ACK"); - //recv_data.hexlike(); + // recv_data.hexlike(); ObjectGuid guid; MovementInfo movementInfo; diff --git a/src/game/MovementGenerator.h b/src/game/MovementGenerator.h index 0abb38688..e085abdde 100644 --- a/src/game/MovementGenerator.h +++ b/src/game/MovementGenerator.h @@ -68,32 +68,32 @@ class MANGOS_DLL_SPEC MovementGeneratorMedium : public MovementGenerator public: void Initialize(Unit& u) { - //u->AssertIsType(); + // u->AssertIsType(); (static_cast(this))->Initialize(*((T*)&u)); } void Finalize(Unit& u) { - //u->AssertIsType(); + // u->AssertIsType(); (static_cast(this))->Finalize(*((T*)&u)); } void Interrupt(Unit& u) { - //u->AssertIsType(); + // u->AssertIsType(); (static_cast(this))->Interrupt(*((T*)&u)); } void Reset(Unit& u) { - //u->AssertIsType(); + // u->AssertIsType(); (static_cast(this))->Reset(*((T*)&u)); } bool Update(Unit& u, const uint32& time_diff) { - //u->AssertIsType(); + // u->AssertIsType(); return (static_cast(this))->Update(*((T*)&u), time_diff); } bool GetResetPosition(Unit& u, float& x, float& y, float& z) { - //u->AssertIsType(); + // u->AssertIsType(); return (static_cast(this))->GetResetPosition(*((T*)&u), x, y, z); } public: diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index 4ad44ecb7..58fea3b34 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -196,7 +196,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() // resummon pet GetPlayer()->ResummonPetTemporaryUnSummonedIfAny(); - //lets process all delayed operations on successful teleport + // lets process all delayed operations on successful teleport GetPlayer()->ProcessDelayedOperations(); } @@ -245,7 +245,7 @@ void WorldSession::HandleMoveTeleportAckOpcode(WorldPacket& recv_data) // resummon pet GetPlayer()->ResummonPetTemporaryUnSummonedIfAny(); - //lets process all delayed operations on successful teleport + // lets process all delayed operations on successful teleport GetPlayer()->ProcessDelayedOperations(); } @@ -424,7 +424,7 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket& recv_data) void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvdata*/) { - //DEBUG_LOG("WORLD: Recvd CMSG_MOUNTSPECIAL_ANIM"); + // DEBUG_LOG("WORLD: Recvd CMSG_MOUNTSPECIAL_ANIM"); WorldPacket data(SMSG_MOUNTSPECIAL_ANIM, 8); data << GetPlayer()->GetObjectGuid(); diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 5a5601668..929c885f6 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -73,10 +73,10 @@ Object::~Object() if (m_uint32Values) { - //DEBUG_LOG("Object desctr 1 check (%p)",(void*)this); + // DEBUG_LOG("Object desctr 1 check (%p)",(void*)this); delete [] m_uint32Values; delete [] m_uint32Values_mirror; - //DEBUG_LOG("Object desctr 2 check (%p)",(void*)this); + // DEBUG_LOG("Object desctr 2 check (%p)",(void*)this); } } @@ -186,7 +186,7 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c } } - //DEBUG_LOG("BuildCreateUpdate: update-type: %u, object-type: %u got updateFlags: %X", updatetype, m_objectTypeId, updateFlags); + // DEBUG_LOG("BuildCreateUpdate: update-type: %u, object-type: %u got updateFlags: %X", updatetype, m_objectTypeId, updateFlags); ByteBuffer buf(500); buf << uint8(updatetype); @@ -246,7 +246,7 @@ void Object::DestroyForPlayer(Player* target, bool anim) const void Object::BuildMovementUpdate(ByteBuffer* data, uint16 updateFlags) const { - //uint16 moveFlags2 = (isType(TYPEMASK_UNIT) ? ((Unit*)this)->m_movementInfo.GetMovementFlags2() : MOVEFLAG2_NONE); + // uint16 moveFlags2 = (isType(TYPEMASK_UNIT) ? ((Unit*)this)->m_movementInfo.GetMovementFlags2() : MOVEFLAG2_NONE); *data << uint16(updateFlags); // update flags @@ -394,7 +394,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint16 updateFlags) const // 0x2 if (updateFlags & UPDATEFLAG_TRANSPORT) { - *data << uint32(WorldTimer::getMSTime()); // ms time + *data << uint32(WorldTimer::getMSTime()); // ms time } // 0x80 @@ -1001,7 +1001,7 @@ InstanceData* WorldObject::GetInstanceData() const return GetMap()->GetInstanceData(); } -//slow +// slow float WorldObject::GetDistance(const WorldObject* obj) const { float dx = GetPositionX() - obj->GetPositionX(); @@ -1199,7 +1199,7 @@ float WorldObject::GetAngle(const WorldObject* obj) const return 0.0f; // Rework the assert, when more cases where such a call can happen have been fixed - //MANGOS_ASSERT(obj != this || PrintEntryError("GetAngle (for self)")); + // MANGOS_ASSERT(obj != this || PrintEntryError("GetAngle (for self)")); if (obj == this) { sLog.outError("INVALID CALL for GetAngle for %s", obj->GetGuidStr().c_str()); @@ -1495,21 +1495,21 @@ void WorldObject::BuildMonsterChat(WorldPacket* data, ObjectGuid senderGuid, uin void WorldObject::SendMessageToSet(WorldPacket* data, bool /*bToSelf*/) { - //if object is in world, map for it already created! + // if object is in world, map for it already created! if (IsInWorld()) GetMap()->MessageBroadcast(this, data); } void WorldObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*bToSelf*/) { - //if object is in world, map for it already created! + // if object is in world, map for it already created! if (IsInWorld()) GetMap()->MessageDistBroadcast(this, data, dist); } void WorldObject::SendMessageToSetExcept(WorldPacket* data, Player const* skipped_receiver) { - //if object is in world, map for it already created! + // if object is in world, map for it already created! if (IsInWorld()) { MaNGOS::MessageDelivererExcept notifier(this, data, skipped_receiver); @@ -1536,7 +1536,7 @@ void WorldObject::SetMap(Map* map) { MANGOS_ASSERT(map); m_currMap = map; - //lets save current map's Id/instanceId + // lets save current map's Id/instanceId m_mapId = map->GetId(); m_InstanceId = map->GetInstanceId(); } @@ -1732,7 +1732,7 @@ void WorldObject::GetNearPoint(WorldObject const* searcher, float& x, float& y, float angle; // candidate of angle for free pos // select in positions after current nodes (selection one by one) - while (selector.NextAngle(angle)) // angle for free pos + while (selector.NextAngle(angle)) // angle for free pos { GetNearPoint2D(x, y, distance2d + searcher_bounding_radius, absAngle + angle); z = GetPositionZ(); diff --git a/src/game/Object.h b/src/game/Object.h index 7b4039ae2..087975b9f 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -94,8 +94,8 @@ struct WorldLocation }; -//use this class to measure time between world update ticks -//essential for units updating their spells after cells become active +// use this class to measure time between world update ticks +// essential for units updating their spells after cells become active class WorldUpdateCounter { public: @@ -412,8 +412,8 @@ class MANGOS_DLL_SPEC WorldObject : public Object public: - //class is used to manipulate with WorldUpdateCounter - //it is needed in order to get time diff between two object's Update() calls + // class is used to manipulate with WorldUpdateCounter + // it is needed in order to get time diff between two object's Update() calls class MANGOS_DLL_SPEC UpdateHelper { public: @@ -571,10 +571,10 @@ class MANGOS_DLL_SPEC WorldObject : public Object void SetMap(Map* map); Map* GetMap() const { MANGOS_ASSERT(m_currMap); return m_currMap; } - //used to check all object's GetMap() calls when object is not in world! + // used to check all object's GetMap() calls when object is not in world! void ResetMap() { m_currMap = NULL; } - //obtain terrain data for map where this object belong... + // obtain terrain data for map where this object belong... TerrainInfo const* GetTerrain() const; void AddToClientUpdateList(); @@ -596,9 +596,9 @@ class MANGOS_DLL_SPEC WorldObject : public Object protected: explicit WorldObject(); - //these functions are used mostly for Relocate() and Corpse/Player specific stuff... - //use them ONLY in LoadFromDB()/Create() funcs and nowhere else! - //mapId/instanceId should be set in SetMap() function! + // these functions are used mostly for Relocate() and Corpse/Player specific stuff... + // use them ONLY in LoadFromDB()/Create() funcs and nowhere else! + // mapId/instanceId should be set in SetMap() function! void SetLocationMapId(uint32 _mapId) { m_mapId = _mapId; } void SetLocationInstanceId(uint32 _instanceId) { m_InstanceId = _instanceId; } @@ -607,7 +607,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object std::string m_name; private: - Map* m_currMap; //current object's Map location + Map* m_currMap; // current object's Map location uint32 m_mapId; // object at map with map_id uint32 m_InstanceId; // in map copy with instance id diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp index ab0a5eb1f..be31bcfcf 100644 --- a/src/game/ObjectAccessor.cpp +++ b/src/game/ObjectAccessor.cpp @@ -193,9 +193,9 @@ ObjectAccessor::ConvertCorpseForPlayer(ObjectGuid player_guid, bool insignia) Corpse* corpse = GetCorpseForPlayerGUID(player_guid); if (!corpse) { - //in fact this function is called from several places - //even when player doesn't have a corpse, not an error - //sLog.outError("Try remove corpse that not in map for GUID %ul", player_guid); + // in fact this function is called from several places + // even when player doesn't have a corpse, not an error + // sLog.outError("Try remove corpse that not in map for GUID %ul", player_guid); return NULL; } @@ -224,13 +224,13 @@ ObjectAccessor::ConvertCorpseForPlayer(ObjectGuid player_guid, bool insignia) bones = new Corpse; bones->Create(corpse->GetGUIDLow()); - for (int i = 3; i < CORPSE_END; ++i) // don't overwrite guid and object type + for (int i = 3; i < CORPSE_END; ++i) // don't overwrite guid and object type bones->SetUInt32Value(i, corpse->GetUInt32Value(i)); bones->SetGrid(corpse->GetGrid()); - // bones->m_time = m_time; // don't overwrite time - // bones->m_inWorld = m_inWorld; // don't overwrite world state - // bones->m_type = m_type; // don't overwrite type + // bones->m_time = m_time; // don't overwrite time + // bones->m_inWorld = m_inWorld; // don't overwrite world state + // bones->m_type = m_type; // don't overwrite type bones->Relocate(corpse->GetPositionX(), corpse->GetPositionY(), corpse->GetPositionZ(), corpse->GetOrientation()); bones->SetPhaseMask(corpse->GetPhaseMask(), false); diff --git a/src/game/ObjectAccessor.h b/src/game/ObjectAccessor.h index f0596beb7..d081fc3c9 100644 --- a/src/game/ObjectAccessor.h +++ b/src/game/ObjectAccessor.h @@ -76,7 +76,7 @@ class HashMapHolder private: - //Non instanceable only static + // Non instanceable only static HashMapHolder() {} static LockType i_lock; diff --git a/src/game/ObjectGridLoader.cpp b/src/game/ObjectGridLoader.cpp index f71c56a42..97d2d407b 100644 --- a/src/game/ObjectGridLoader.cpp +++ b/src/game/ObjectGridLoader.cpp @@ -116,7 +116,7 @@ void LoadHelper(CellGuidSet const& guid_set, CellPair& cell, GridRefManager& uint32 guid = *i_guid; T* obj = new T; - //sLog.outString("DEBUG: LoadHelper from table: %s for (guid: %u) Loading",table,guid); + // sLog.outString("DEBUG: LoadHelper from table: %s for (guid: %u) Loading",table,guid); if (!obj->LoadFromDB(guid, map)) { delete obj; diff --git a/src/game/ObjectGuid.h b/src/game/ObjectGuid.h index 8e7c66f0d..92b9ecc01 100644 --- a/src/game/ObjectGuid.h +++ b/src/game/ObjectGuid.h @@ -149,7 +149,7 @@ class MANGOS_DLL_SPEC ObjectGuid switch (high) { case HIGHGUID_ITEM: return TYPEID_ITEM; - //case HIGHGUID_CONTAINER: return TYPEID_CONTAINER; HIGHGUID_CONTAINER==HIGHGUID_ITEM currently + // case HIGHGUID_CONTAINER: return TYPEID_CONTAINER; HIGHGUID_CONTAINER==HIGHGUID_ITEM currently case HIGHGUID_UNIT: return TYPEID_UNIT; case HIGHGUID_PET: return TYPEID_UNIT; case HIGHGUID_PLAYER: return TYPEID_PLAYER; @@ -211,7 +211,7 @@ typedef std::set GuidSet; typedef std::list GuidList; typedef std::vector GuidVector; -//minimum buffer size for packed guid is 9 bytes +// minimum buffer size for packed guid is 9 bytes #define PACKED_GUID_MIN_BUFFER_SIZE 9 class PackedGuid diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 5a78dd1bb..e9afa4762 100755 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -224,7 +224,7 @@ ArenaTeam* ObjectMgr::GetArenaTeamByCaptain(ObjectGuid guid) const void ObjectMgr::LoadCreatureLocales() { - mCreatureLocaleMap.clear(); // need for reload case + mCreatureLocaleMap.clear(); // need for reload case QueryResult* result = WorldDatabase.Query("SELECT entry,name_loc1,subname_loc1,name_loc2,subname_loc2,name_loc3,subname_loc3,name_loc4,subname_loc4,name_loc5,subname_loc5,name_loc6,subname_loc6,name_loc7,subname_loc7,name_loc8,subname_loc8 FROM locales_creature"); @@ -385,7 +385,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales() void ObjectMgr::LoadPointOfInterestLocales() { - mPointOfInterestLocaleMap.clear(); // need for reload case + mPointOfInterestLocaleMap.clear(); // need for reload case QueryResult* result = WorldDatabase.Query("SELECT entry,icon_name_loc1,icon_name_loc2,icon_name_loc3,icon_name_loc4,icon_name_loc5,icon_name_loc6,icon_name_loc7,icon_name_loc8 FROM locales_points_of_interest"); @@ -3256,7 +3256,7 @@ void ObjectMgr::LoadPlayerInfo() } continue; } - //PlayerXPperLevel + // PlayerXPperLevel mPlayerXPperLevel[current_level] = current_xp; bar.step(); ++count; @@ -4624,7 +4624,7 @@ void ObjectMgr::LoadInstanceEncounters() if (!sSpellStore.LookupEntry(creditEntry)) { // skip spells that aren't in dbc for now - //sLog.outErrorDb("Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName[0]); + // sLog.outErrorDb("Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName[0]); continue; } break; @@ -4919,12 +4919,12 @@ void ObjectMgr::LoadGossipTextLocales() sLog.outString(">> Loaded %lu NpcText locale strings", (unsigned long)mNpcTextLocaleMap.size()); } -//not very fast function but it is called only once a day, or on starting-up +// not very fast function but it is called only once a day, or on starting-up void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) { time_t basetime = time(NULL); DEBUG_LOG("Returning mails current time: hour: %d, minute: %d, second: %d ", localtime(&basetime)->tm_hour, localtime(&basetime)->tm_min, localtime(&basetime)->tm_sec); - //delete all old mails without item and without body immediately, if starting server + // delete all old mails without item and without body immediately, if starting server if (!serverUp) CharacterDatabase.PExecute("DELETE FROM mail WHERE expire_time < '" UI64FMTD "' AND has_items = '0' AND body = ''", (uint64)basetime); // 0 1 2 3 4 5 6 7 8 @@ -4938,10 +4938,10 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) return; // any mails need to be returned or deleted } - //std::ostringstream delitems, delmails; //will be here for optimization - //bool deletemail = false, deleteitem = false; - //delitems << "DELETE FROM item_instance WHERE guid IN ( "; - //delmails << "DELETE FROM mail WHERE id IN ( " + // std::ostringstream delitems, delmails; // will be here for optimization + // bool deletemail = false, deleteitem = false; + // delitems << "DELETE FROM item_instance WHERE guid IN ( "; + // delmails << "DELETE FROM mail WHERE id IN ( " BarGoLink bar(result->GetRowCount()); uint32 count = 0; @@ -4969,12 +4969,12 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) pl = GetPlayer(m->receiverGuid); if (pl) { - //this code will run very improbably (the time is between 4 and 5 am, in game is online a player, who has old mail - //his in mailbox and he has already listed his mails ) + // this code will run very improbably (the time is between 4 and 5 am, in game is online a player, who has old mail + // his in mailbox and he has already listed his mails ) delete m; continue; } - //delete or return mail: + // delete or return mail: if (has_items) { QueryResult* resultItems = CharacterDatabase.PQuery("SELECT item_guid,item_template FROM mail_items WHERE mail_id='%u'", m->messageID); @@ -6010,7 +6010,7 @@ void ObjectMgr::LoadGameobjectInfo() { if (goInfo->button.lockId) CheckGOLockId(goInfo, goInfo->button.lockId, 1); - if (goInfo->button.linkedTrapId) // linked trap + if (goInfo->button.linkedTrapId) // linked trap CheckGOLinkedTrapId(goInfo, goInfo->button.linkedTrapId, 3); CheckGONoDamageImmuneId(goInfo, goInfo->button.noDamageImmune, 4); break; @@ -6029,7 +6029,7 @@ void ObjectMgr::LoadGameobjectInfo() CheckGOConsumable(goInfo, goInfo->chest.consumable, 3); - if (goInfo->chest.linkedTrapId) // linked trap + if (goInfo->chest.linkedTrapId) // linked trap CheckGOLinkedTrapId(goInfo, goInfo->chest.linkedTrapId, 7); break; } @@ -7365,7 +7365,7 @@ void ObjectMgr::LoadGameObjectForQuests() } case GAMEOBJECT_TYPE_GOOBER: { - if (goInfo->goober.questId) //quests objects + if (goInfo->goober.questId) // quests objects { mGameObjectForQuestSet.insert(go_entry); ++count; @@ -8179,8 +8179,8 @@ SkillRangeType GetSkillRangeType(SkillLineEntry const* pSkill, bool racial) else return SKILL_RANGE_MONO; default: - case SKILL_CATEGORY_ATTRIBUTES: //not found in dbc - case SKILL_CATEGORY_GENERIC: //only GENERIC(DND) + case SKILL_CATEGORY_ATTRIBUTES: // not found in dbc + case SKILL_CATEGORY_GENERIC: // only GENERIC(DND) return SKILL_RANGE_NONE; } } diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index 84a92af6f..223f2552b 100755 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -623,7 +623,7 @@ class ObjectMgr // Static wrappers for various accessors static GameObjectInfo const* GetGameObjectInfo(uint32 id); ///< Wrapper for sGOStorage.LookupEntry - static Player* GetPlayer(const char* name); ///< Wrapper for ObjectAccessor::FindPlayerByName + static Player* GetPlayer(const char* name); ///< Wrapper for ObjectAccessor::FindPlayerByName static Player* GetPlayer(ObjectGuid guid, bool inWorld = true); ///< Wrapper for ObjectAccessor::FindPlayer static CreatureInfo const* GetCreatureTemplate(uint32 id); ///< Wrapper for sCreatureStorage.LookupEntry static CreatureModelInfo const* GetCreatureModelInfo(uint32 modelid); ///< Wrapper for sCreatureModelStorage.LookupEntry @@ -750,7 +750,7 @@ class ObjectMgr uint32 GenerateAuctionID() { return m_AuctionIds.Generate(); } uint64 GenerateEquipmentSetGuid() { return m_EquipmentSetIds.Generate(); } uint32 GenerateGuildId() { return m_GuildIds.Generate(); } - //uint32 GenerateItemTextID() { return m_ItemGuids.Generate(); } + // uint32 GenerateItemTextID() { return m_ItemGuids.Generate(); } uint32 GenerateMailID() { return m_MailIds.Generate(); } uint32 GeneratePetNumber() { return m_PetNumbers.Generate(); } @@ -1132,7 +1132,7 @@ class ObjectMgr WeatherZoneMap mWeatherZoneMap; - //character reserved names + // character reserved names typedef std::set ReservedNamesMap; ReservedNamesMap m_ReservedNames; @@ -1185,7 +1185,7 @@ class ObjectMgr typedef std::map BaseXPMap; // [area level][base xp] BaseXPMap mBaseXPTable; - typedef std::map FishingBaseSkillMap; // [areaId][base skill level] + typedef std::map FishingBaseSkillMap;// [areaId][base skill level] FishingBaseSkillMap mFishingBaseForArea; typedef std::map > HalfNameMap; diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index e12482387..e36907df2 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -1341,10 +1341,10 @@ enum Opcodes MSG_MOVE_SET_COLLISION_HGT = 0x518, CMSG_CLEAR_RANDOM_BG_WIN_TIME = 0x519, CMSG_CLEAR_HOLIDAY_BG_WIN_TIME = 0x51A, - CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x51B, // lua: CommentatorSetSkirmishMatchmakingMode/CommentatorRequestSkirmishQueueData/CommentatorRequestSkirmishMode/CommentatorStartSkirmishMatch - SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1 = 0x51C, // event EVENT_COMMENTATOR_SKIRMISH_QUEUE_REQUEST, CGCommentator::QueueNode - SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2 = 0x51D, // event EVENT_COMMENTATOR_SKIRMISH_QUEUE_REQUEST - SMSG_COMPRESSED_UNKNOWN_1310 = 0x51E, // some compressed packet + CMSG_COMMENTATOR_SKIRMISH_QUEUE_COMMAND = 0x51B,// lua: CommentatorSetSkirmishMatchmakingMode/CommentatorRequestSkirmishQueueData/CommentatorRequestSkirmishMode/CommentatorStartSkirmishMatch + SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT1 = 0x51C,// event EVENT_COMMENTATOR_SKIRMISH_QUEUE_REQUEST, CGCommentator::QueueNode + SMSG_COMMENTATOR_SKIRMISH_QUEUE_RESULT2 = 0x51D,// event EVENT_COMMENTATOR_SKIRMISH_QUEUE_REQUEST + SMSG_COMPRESSED_UNKNOWN_1310 = 0x51E,// some compressed packet NUM_MSG_TYPES = 0x51F }; @@ -1361,9 +1361,9 @@ enum SessionStatus enum PacketProcessing { - PROCESS_INPLACE = 0, //process packet whenever we receive it - mostly for non-handled or non-implemented packets - PROCESS_THREADUNSAFE, //packet is not thread-safe - process it in World::UpdateSessions() - PROCESS_THREADSAFE //packet is thread-safe - process it in Map::Update() + PROCESS_INPLACE = 0, // process packet whenever we receive it - mostly for non-handled or non-implemented packets + PROCESS_THREADUNSAFE, // packet is not thread-safe - process it in World::UpdateSessions() + PROCESS_THREADSAFE // packet is thread-safe - process it in Map::Update() }; class WorldPacket; diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index c3861ad7b..d55306811 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -257,10 +257,10 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c delete result; - //load spells/cooldowns/auras + // load spells/cooldowns/auras _LoadAuras(timediff); - //init AB + // init AB if (is_temporary_summoned) { // Temporary summoned pets always have initial spell list at load @@ -272,7 +272,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c CastPetAuras(current); } - if (getPetType() == SUMMON_PET && !current) //all (?) summon pets come with full health when called, but not when they are current + if (getPetType() == SUMMON_PET && !current) // all (?) summon pets come with full health when called, but not when they are current { SetHealth(GetMaxHealth()); SetPower(POWER_MANA, GetMaxPower(POWER_MANA)); @@ -372,7 +372,7 @@ void Pet::SavePetToDB(PetSaveMode mode) if (mode != PET_SAVE_AS_CURRENT) RemoveAllAuras(); - //save pet's data as one single transaction + // save pet's data as one single transaction CharacterDatabase.BeginTransaction(); _SaveSpells(); _SaveSpellCooldowns(); @@ -482,7 +482,7 @@ void Pet::SetDeathState(DeathState s) // overwrite virtual Creature::SetDeathState(s); if (getDeathState() == CORPSE) { - //remove summoned pet (no corpse) + // remove summoned pet (no corpse) if (getPetType() == SUMMON_PET) Unsummon(PET_SAVE_NOT_IN_SLOT); // other will despawn at corpse desppawning (Pet::Update code) @@ -492,7 +492,7 @@ void Pet::SetDeathState(DeathState s) // overwrite virtual SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE); RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); - //lose happiness when died and not in BG/Arena + // lose happiness when died and not in BG/Arena MapEntry const* mapEntry = sMapStore.LookupEntry(GetMapId()); if (!mapEntry || (mapEntry->map_type != MAP_ARENA && mapEntry->map_type != MAP_BATTLEGROUND)) ModifyPower(POWER_HAPPINESS, -HAPPINESS_LEVEL_SIZE); @@ -519,7 +519,7 @@ void Pet::Update(uint32 update_diff, uint32 diff) if (m_corpseDecayTimer <= update_diff) { MANGOS_ASSERT(getPetType() != SUMMON_PET && "Must be already removed."); - Unsummon(PET_SAVE_NOT_IN_SLOT); //hunters' pets never get removed because of death, NEVER! + Unsummon(PET_SAVE_NOT_IN_SLOT); // hunters' pets never get removed because of death, NEVER! return; } break; @@ -566,7 +566,7 @@ void Pet::Update(uint32 update_diff, uint32 diff) void Pet::RegenerateAll(uint32 update_diff) { - //regenerate focus for hunter pets or energy for deathknight's ghoul + // regenerate focus for hunter pets or energy for deathknight's ghoul if (m_regenTimer <= update_diff) { switch (getPowerType()) @@ -644,8 +644,8 @@ void Pet::LooseHappiness() uint32 curValue = GetPower(POWER_HAPPINESS); if (curValue <= 0) return; - int32 addvalue = 670; //value is 70/35/17/8/4 (per min) * 1000 / 8 (timer 7.5 secs) - if (isInCombat()) //we know in combat happiness fades faster, multiplier guess + int32 addvalue = 670; // value is 70/35/17/8/4 (per min) * 1000 / 8 (timer 7.5 secs) + if (isInCombat()) // we know in combat happiness fades faster, multiplier guess addvalue = int32(addvalue * 1.5); ModifyPower(POWER_HAPPINESS, -addvalue); } @@ -688,7 +688,7 @@ bool Pet::CanTakeMoreActiveSpells(uint32 spellid) break; } - if (x == activecount) //spellchain not yet saved -> add active count + if (x == activecount) // spellchain not yet saved -> add active count { ++activecount; if (activecount > ACTIVE_SPELLS_MAX) @@ -723,7 +723,7 @@ void Pet::Unsummon(PetSaveMode mode, Unit* owner /*= NULL*/) if (mode == PET_SAVE_REAGENTS) { - //returning of reagents only for players, so best done here + // returning of reagents only for players, so best done here uint32 spellId = GetUInt32Value(UNIT_CREATED_BY_SPELL); SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId); @@ -733,7 +733,7 @@ void Pet::Unsummon(PetSaveMode mode, Unit* owner /*= NULL*/) { if (spellInfo->Reagent[i] > 0) { - ItemPosCountVec dest; //for succubus, voidwalker, felhunter and felguard credit soulshard when despawn reason other than death (out of range, logout) + ItemPosCountVec dest; // for succubus, voidwalker, felhunter and felguard credit soulshard when despawn reason other than death (out of range, logout) uint8 msg = p_owner->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, spellInfo->Reagent[i], spellInfo->ReagentCount[i]); if (msg == EQUIP_ERR_OK) { @@ -971,13 +971,13 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner) case CLASS_WARLOCK: { - //the damage bonus used for pets is either fire or shadow damage, whatever is higher + // the damage bonus used for pets is either fire or shadow damage, whatever is higher uint32 fire = owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE); uint32 shadow = owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW); uint32 val = (fire > shadow) ? fire : shadow; SetBonusDamage(int32(val * 0.15f)); - //bonusAP += val * 0.57; + // bonusAP += val * 0.57; break; } case CLASS_MAGE: @@ -997,7 +997,7 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner) SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4))); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4))); - //SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, float(cinfo->attackpower)); + // SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, float(cinfo->attackpower)); PetLevelInfo const* pInfo = sObjectMgr.GetPetLevelInfo(creature_ID, petlevel); if (pInfo) // exist in DB @@ -1032,20 +1032,20 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner) case HUNTER_PET: { SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, sObjectMgr.GetXPForPetLevel(petlevel)); - //these formula may not be correct; however, it is designed to be close to what it should be - //this makes dps 0.5 of pets level + // these formula may not be correct; however, it is designed to be close to what it should be + // this makes dps 0.5 of pets level SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4))); - //damage range is then petlevel / 2 + // damage range is then petlevel / 2 SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4))); - //damage is increased afterwards as strength and pet scaling modify attack power + // damage is increased afterwards as strength and pet scaling modify attack power - //stored standard pet stats are entry 1 in pet_levelinfo + // stored standard pet stats are entry 1 in pet_levelinfo PetLevelInfo const* pInfo = sObjectMgr.GetPetLevelInfo(creature_ID, petlevel); if (pInfo) // exist in DB { SetCreateHealth(pInfo->health); SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(pInfo->armor)); - //SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, float(cinfo->attackpower)); + // SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, float(cinfo->attackpower)); for (int i = STAT_STRENGTH; i < MAX_STATS; ++i) { @@ -1076,10 +1076,10 @@ bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner) SetCreateHealth(28 + 30 * petlevel); // FIXME: this is wrong formula, possible each guardian pet have own damage formula - //these formula may not be correct; however, it is designed to be close to what it should be - //this makes dps 0.5 of pets level + // these formula may not be correct; however, it is designed to be close to what it should be + // this makes dps 0.5 of pets level SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4))); - //damage range is then petlevel / 2 + // damage range is then petlevel / 2 SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4))); break; default: @@ -1119,17 +1119,17 @@ bool Pet::HaveInDiet(ItemPrototype const* item) const uint32 Pet::GetCurrentFoodBenefitLevel(uint32 itemlevel) { // -5 or greater food level - if (getLevel() <= itemlevel + 5) //possible to feed level 60 pet with level 55 level food for full effect + if (getLevel() <= itemlevel + 5) // possible to feed level 60 pet with level 55 level food for full effect return 35000; // -10..-6 - else if (getLevel() <= itemlevel + 10) //pure guess, but sounds good + else if (getLevel() <= itemlevel + 10) // pure guess, but sounds good return 17000; // -14..-11 - else if (getLevel() <= itemlevel + 14) //level 55 food gets green on 70, makes sense to me + else if (getLevel() <= itemlevel + 14) // level 55 food gets green on 70, makes sense to me return 8000; // -15 or less else - return 0; //food too low level + return 0; // food too low level } void Pet::_LoadSpellCooldowns() @@ -1389,8 +1389,8 @@ void Pet::_SaveAuras() } } - //skip all holders from spells that are passive or channeled - //do not save single target holders (unless they were cast by the player) + // skip all holders from spells that are passive or channeled + // do not save single target holders (unless they were cast by the player) if (save && !holder->IsPassive() && !IsChanneledSpell(holder->GetSpellProto()) && (holder->GetCasterGuid() == GetObjectGuid() || !holder->IsSingleTarget())) { int32 damage[MAX_EFFECT_INDEX]; @@ -1485,7 +1485,7 @@ bool Pet::addSpell(uint32 spell_id, ActiveStates active /*= ACT_DECIDE*/, PetSpe newspell.state = state; newspell.type = type; - if (active == ACT_DECIDE) //active was not used before, so we save it's autocast/passive state here + if (active == ACT_DECIDE) // active was not used before, so we save it's autocast/passive state here { if (IsPassiveSpell(spellInfo)) newspell.active = ACT_PASSIVE; @@ -1592,10 +1592,10 @@ void Pet::InitLevelupSpellsForLevel() { // will called first if level down if (itr->first > level) - unlearnSpell(itr->second, true); // will learn prev rank if any + unlearnSpell(itr->second, true); // will learn prev rank if any // will called if level up else - learnSpell(itr->second); // will unlearn prev rank if any + learnSpell(itr->second); // will unlearn prev rank if any } } @@ -2071,7 +2071,7 @@ void Pet::CastPetAura(PetAura const* aura) if (!auraId) return; - if (auraId == 35696) // Demonic Knowledge + if (auraId == 35696) // Demonic Knowledge { int32 basePoints = int32(aura->GetDamage() * (GetStat(STAT_STAMINA) + GetStat(STAT_INTELLECT)) / 100); CastCustomSpell(this, auraId, &basePoints, NULL, NULL, true); diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp index 123906879..1420a8e4e 100644 --- a/src/game/PetAI.cpp +++ b/src/game/PetAI.cpp @@ -78,7 +78,7 @@ void PetAI::AttackStart(Unit* u) // TMGs call CreatureRelocation which via MoveInLineOfSight can call this function // thus with the following clear the original TMG gets invalidated and crash, doh // hope it doesn't start to leak memory without this :-/ - //i_pet->Clear(); + // i_pet->Clear(); m_creature->GetMotionMaster()->MoveChase(u); inCombat = true; } @@ -164,7 +164,7 @@ void PetAI::UpdateAI(const uint32 diff) if (!m_creature->getVictim()) return; - //if pet misses its target, it will also be the first in threat list + // if pet misses its target, it will also be the first in threat list m_creature->getVictim()->AddThreat(m_creature); if (_needToStop()) @@ -250,7 +250,7 @@ void PetAI::UpdateAI(const uint32 diff) { Unit* Target = m_creature->GetMap()->GetUnit(*tar); - //only buff targets that are in combat, unless the spell can only be cast while out of combat + // only buff targets that are in combat, unless the spell can only be cast while out of combat if (!Target) continue; @@ -266,7 +266,7 @@ void PetAI::UpdateAI(const uint32 diff) } } - //found units to cast on to + // found units to cast on to if (!targetSpellStore.empty()) { uint32 index = urand(0, targetSpellStore.size() - 1); @@ -311,23 +311,23 @@ void PetAI::UpdateAllies() Unit* owner = m_creature->GetCharmerOrOwner(); Group* pGroup = NULL; - m_updateAlliesTimer = 10 * IN_MILLISECONDS; //update friendly targets every 10 seconds, lesser checks increase performance + m_updateAlliesTimer = 10 * IN_MILLISECONDS; // update friendly targets every 10 seconds, lesser checks increase performance if (!owner) return; else if (owner->GetTypeId() == TYPEID_PLAYER) pGroup = ((Player*)owner)->GetGroup(); - //only pet and owner/not in group->ok + // only pet and owner/not in group->ok if (m_AllySet.size() == 2 && !pGroup) return; - //owner is in group; group members filled in already (no raid -> subgroupcount = whole count) + // owner is in group; group members filled in already (no raid -> subgroupcount = whole count) if (pGroup && !pGroup->isRaidGroup() && m_AllySet.size() == (pGroup->GetMembersCount() + 2)) return; m_AllySet.clear(); m_AllySet.insert(m_creature->GetObjectGuid()); - if (pGroup) //add group + if (pGroup) // add group { for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) { @@ -341,13 +341,13 @@ void PetAI::UpdateAllies() m_AllySet.insert(target->GetObjectGuid()); } } - else //remove group + else // remove group m_AllySet.insert(owner->GetObjectGuid()); } void PetAI::AttackedBy(Unit* attacker) { - //when attacked, fight back in case 1)no victim already AND 2)not set to passive AND 3)not set to stay, unless can it can reach attacker with melee attack anyway + // when attacked, fight back in case 1)no victim already AND 2)not set to passive AND 3)not set to stay, unless can it can reach attacker with melee attack anyway if (!m_creature->getVictim() && m_creature->GetCharmInfo() && !m_creature->GetCharmInfo()->HasReactState(REACT_PASSIVE) && (!m_creature->GetCharmInfo()->HasCommandState(COMMAND_STAY) || m_creature->CanReachWithMeleeAttack(attacker))) AttackStart(attacker); diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index 1edf25d96..bddc8b65e 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -84,13 +84,13 @@ void WorldSession::HandlePetAction(WorldPacket& recv_data) case ACT_COMMAND: // 0x07 switch (spellid) { - case COMMAND_STAY: // flat=1792 //STAY + case COMMAND_STAY: // flat=1792 // STAY pet->StopMoving(); pet->GetMotionMaster()->Clear(false); pet->GetMotionMaster()->MoveIdle(); charmInfo->SetCommandState(COMMAND_STAY); break; - case COMMAND_FOLLOW: // spellid=1792 //FOLLOW + case COMMAND_FOLLOW: // spellid=1792 // FOLLOW pet->AttackStop(); pet->GetMotionMaster()->MoveFollow(_player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); charmInfo->SetCommandState(COMMAND_FOLLOW); diff --git a/src/game/PetitionsHandler.cpp b/src/game/PetitionsHandler.cpp index ffa75130f..0536d1f53 100644 --- a/src/game/PetitionsHandler.cpp +++ b/src/game/PetitionsHandler.cpp @@ -181,7 +181,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recv_data) if (_player->GetMoney() < cost) { - //player hasn't got enough money + // player hasn't got enough money _player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, charterid, 0); return; } @@ -240,7 +240,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recv_data) { // ok DEBUG_LOG("Received opcode CMSG_PETITION_SHOW_SIGNATURES"); - //recv_data.hexlike(); + // recv_data.hexlike(); uint8 signs = 0; ObjectGuid petitionguid; @@ -294,7 +294,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recv_data) void WorldSession::HandlePetitionQueryOpcode(WorldPacket& recv_data) { DEBUG_LOG("Received opcode CMSG_PETITION_QUERY"); - //recv_data.hexlike(); + // recv_data.hexlike(); uint32 guildguid; ObjectGuid petitionguid; @@ -377,7 +377,7 @@ void WorldSession::SendPetitionQueryOpcode(ObjectGuid petitionguid) void WorldSession::HandlePetitionRenameOpcode(WorldPacket& recv_data) { DEBUG_LOG("Received opcode MSG_PETITION_RENAME"); // ok - //recv_data.hexlike(); + // recv_data.hexlike(); ObjectGuid petitionGuid; uint32 type; @@ -447,7 +447,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket& recv_data) void WorldSession::HandlePetitionSignOpcode(WorldPacket& recv_data) { DEBUG_LOG("Received opcode CMSG_PETITION_SIGN"); // ok - //recv_data.hexlike(); + // recv_data.hexlike(); Field* fields; ObjectGuid petitionGuid; @@ -532,11 +532,11 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recv_data) } } - if (++signs > type) // client signs maximum + if (++signs > type) // client signs maximum return; - //client doesn't allow to sign petition two times by one character, but not check sign by another character from same account - //not allow sign another player from already sign player account + // client doesn't allow to sign petition two times by one character, but not check sign by another character from same account + // not allow sign another player from already sign player account result = CharacterDatabase.PQuery("SELECT playerguid FROM petition_sign WHERE player_account = '%u' AND petitionguid = '%u'", GetAccountId(), petitionLowGuid); if (result) @@ -570,8 +570,8 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recv_data) SendPacket(&data); // update signs count on charter, required testing... - //Item *item = _player->GetItemByGuid(petitionguid)); - //if(item) + // Item *item = _player->GetItemByGuid(petitionguid)); + // if(item) // item->SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1+1, signs); // update for owner if online @@ -582,7 +582,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recv_data) void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recv_data) { DEBUG_LOG("Received opcode MSG_PETITION_DECLINE"); // ok - //recv_data.hexlike(); + // recv_data.hexlike(); ObjectGuid petitionGuid; recv_data >> petitionGuid; // petition guid @@ -611,7 +611,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recv_data) void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recv_data) { DEBUG_LOG("Received opcode CMSG_OFFER_PETITION"); // ok - //recv_data.hexlike(); + // recv_data.hexlike(); ObjectGuid petitionGuid; ObjectGuid playerGuid; @@ -720,7 +720,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recv_data) void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recv_data) { DEBUG_LOG("Received opcode CMSG_TURN_IN_PETITION"); // ok - //recv_data.hexlike(); + // recv_data.hexlike(); ObjectGuid petitionGuid; @@ -770,8 +770,8 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recv_data) if (_player->GetArenaTeamId(slot)) { - //data.Initialize(SMSG_TURN_IN_PETITION_RESULTS, 4); - //data << (uint32)PETITION_TURN_ALREADY_IN_GUILD; // already in guild + // data.Initialize(SMSG_TURN_IN_PETITION_RESULTS, 4); + // data << (uint32)PETITION_TURN_ALREADY_IN_GUILD; // already in guild //_player->GetSession()->SendPacket(&data); SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ALREADY_IN_ARENA_TEAM); return; @@ -905,7 +905,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recv_data) void WorldSession::HandlePetitionShowListOpcode(WorldPacket& recv_data) { DEBUG_LOG("Received CMSG_PETITION_SHOWLIST"); - //recv_data.hexlike(); + // recv_data.hexlike(); ObjectGuid guid; recv_data >> guid; @@ -968,7 +968,7 @@ void WorldSession::SendPetitionShowList(ObjectGuid guid) data << uint32(5); // unknown data << uint32(5); // required signs? } - //for(uint8 i = 0; i < count; ++i) + // for(uint8 i = 0; i < count; ++i) //{ // data << uint32(i); // index // data << uint32(GUILD_CHARTER); // charter entry diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 78eca8eaf..9d331646a 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -176,7 +176,7 @@ void PlayerTaxi::InitTaxiNodesForLevel(uint32 race, uint32 chrClass, uint32 leve } // level dependent taxi hubs if (level >= 68) - SetTaximaskNode(213); //Shattered Sun Staging Area + SetTaximaskNode(213); // Shattered Sun Staging Area } void PlayerTaxi::LoadTaxiMask(const char* data) @@ -389,7 +389,7 @@ Player::Player(WorldSession* session): Unit(), m_mover(this), m_camera(this), m_ m_valuesCount = PLAYER_END; - SetActiveObjectState(true); // player is always active object + SetActiveObjectState(true); // player is always active object m_session = session; @@ -492,12 +492,12 @@ Player::Player(WorldSession* session): Unit(), m_mover(this), m_camera(this), m_ m_temporaryUnsummonedPetNumber = 0; - ////////////////////Rest System///////////////////// + //////////////////// Rest System///////////////////// time_inn_enter = 0; inn_trigger_id = 0; m_rest_bonus = 0; rest_type = REST_TYPE_NO; - ////////////////////Rest System///////////////////// + //////////////////// Rest System///////////////////// m_mailsUpdated = false; unReadMails = 0; @@ -565,7 +565,7 @@ Player::~Player() CleanupsBeforeDelete(); // it must be unloaded already in PlayerLogout and accessed only for loggined player - //m_social = NULL; + // m_social = NULL; // Note: buy back item already deleted from DB when player was saved for (int i = 0; i < PLAYER_SLOTS_COUNT; ++i) @@ -575,12 +575,12 @@ Player::~Player() } CleanupChannels(); - //all mailed items should be deleted, also all mail should be deallocated + // all mailed items should be deleted, also all mail should be deallocated for (PlayerMails::const_iterator itr = m_mail.begin(); itr != m_mail.end(); ++itr) delete *itr; for (ItemMap::const_iterator iter = mMitems.begin(); iter != mMitems.end(); ++iter) - delete iter->second; //if item is duplicated... then server may crash ... but that item should be deallocated + delete iter->second; // if item is duplicated... then server may crash ... but that item should be deallocated delete PlayerTalkClass; @@ -614,7 +614,7 @@ void Player::CleanupsBeforeDelete() bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 class_, uint8 gender, uint8 skin, uint8 face, uint8 hairStyle, uint8 hairColor, uint8 facialHair, uint8 /*outfitId */) { - //FIXME: outfitId not used in player creating + // FIXME: outfitId not used in player creating Object::_Create(guidlow, 0, HIGHGUID_PLAYER); @@ -1057,7 +1057,7 @@ void Player::HandleDrowning(uint32 time_diff) if (m_MirrorTimer[FATIGUE_TIMER] < 0) { m_MirrorTimer[FATIGUE_TIMER] += 2 * IN_MILLISECONDS; - if (isAlive()) // Calculate and deal damage + if (isAlive()) // Calculate and deal damage { uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel() - 1); EnvironmentalDamage(DAMAGE_EXHAUSTED, damage); @@ -1116,7 +1116,7 @@ void Player::HandleDrowning(uint32 time_diff) m_MirrorTimerFlagsLast = m_MirrorTimerFlags; } -///The player sobers by 256 every 10 seconds +/// The player sobers by 256 every 10 seconds void Player::HandleSobering() { m_drunkTimer = 0; @@ -1406,7 +1406,7 @@ void Player::SetDeathState(DeathState s) // remove form before other mods to prevent incorrect stats calculation RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT); - //FIXME: is pet dismissed at dying or releasing spirit? if second, add SetDeathState(DEAD) to HandleRepopRequestOpcode and define pet unsummon here with (s == DEAD) + // FIXME: is pet dismissed at dying or releasing spirit? if second, add SetDeathState(DEAD) to HandleRepopRequestOpcode and define pet unsummon here with (s == DEAD) RemovePet(PET_SAVE_REAGENTS); // save value before aura remove in Unit::SetDeathState @@ -1432,7 +1432,7 @@ void Player::SetDeathState(DeathState s) if (isAlive() && !cur) { - //clear aura case after resurrection by another way (spells will be applied before next death) + // clear aura case after resurrection by another way (spells will be applied before next death) SetUInt32Value(PLAYER_SELF_RES_SPELL, 0); // restore default warrior stance @@ -1678,15 +1678,15 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati if ((GetMapId() == mapid) && (!m_transport)) { - //lets reset far teleport flag if it wasn't reset during chained teleports + // lets reset far teleport flag if it wasn't reset during chained teleports SetSemaphoreTeleportFar(false); - //setup delayed teleport flag - //if teleport spell is casted in Unit::Update() func - //then we need to delay it until update process will be finished + // setup delayed teleport flag + // if teleport spell is casted in Unit::Update() func + // then we need to delay it until update process will be finished if (SetDelayedTeleportFlagIfCan()) { SetSemaphoreTeleportNear(true); - //lets save teleport destination for player + // lets save teleport destination for player m_teleport_dest = WorldLocation(mapid, x, y, z, orientation); m_teleport_options = options; return true; @@ -1694,7 +1694,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati if (!(options & TELE_TO_NOT_UNSUMMON_PET)) { - //same map, only remove pet if out of range for new position + // same map, only remove pet if out of range for new position if (pet && !pet->IsWithinDist3d(x, y, z, GetMap()->GetVisibilityDistance())) UnsummonPetTemporaryIfAny(); } @@ -1734,15 +1734,15 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati Map* map = sMapMgr.FindMap(mapid, state ? state->GetInstanceId() : 0); if (!map || map->CanEnter(this)) { - //lets reset near teleport flag if it wasn't reset during chained teleports + // lets reset near teleport flag if it wasn't reset during chained teleports SetSemaphoreTeleportNear(false); - //setup delayed teleport flag - //if teleport spell is casted in Unit::Update() func - //then we need to delay it until update process will be finished + // setup delayed teleport flag + // if teleport spell is casted in Unit::Update() func + // then we need to delay it until update process will be finished if (SetDelayedTeleportFlagIfCan()) { SetSemaphoreTeleportFar(true); - //lets save teleport destination for player + // lets save teleport destination for player m_teleport_dest = WorldLocation(mapid, x, y, z, orientation); m_teleport_options = options; return true; @@ -1761,7 +1761,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati // and we already will found "current" battleground // just need check that this is targeted map or leave if (bg->GetMapId() != mapid) - LeaveBattleground(false); // don't teleport to entry point + LeaveBattleground(false); // don't teleport to entry point } // remove pet on map change @@ -1777,7 +1777,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati if (IsNonMeleeSpellCasted(true)) InterruptNonMeleeSpells(true); - //remove auras before removing from map... + // remove auras before removing from map... RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_CHANGE_MAP | AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_TURNING); if (!GetSession()->PlayerLogout()) @@ -1913,7 +1913,7 @@ void Player::ProcessDelayedOperations() } } - //we have executed ALL delayed ops, so clear the flag + // we have executed ALL delayed ops, so clear the flag m_DelayedOperations = 0; } @@ -2236,11 +2236,11 @@ void Player::SetInWater(bool apply) if (m_isInWater == apply) return; - //define player in water by opcodes - //move player's guid into HateOfflineList of those mobs - //which can't swim and move guid back into ThreatList when - //on surface. - //TODO: exist also swimming mobs, and function must be symmetric to enter/leave water + // define player in water by opcodes + // move player's guid into HateOfflineList of those mobs + // which can't swim and move guid back into ThreatList when + // on surface. + // TODO: exist also swimming mobs, and function must be symmetric to enter/leave water m_isInWater = apply; // remove auras that need water/land @@ -2319,7 +2319,7 @@ void Player::SetGMVisible(bool on) { if (on) { - m_ExtraFlags &= ~PLAYER_EXTRA_GM_INVISIBLE; //remove flag + m_ExtraFlags &= ~PLAYER_EXTRA_GM_INVISIBLE; // remove flag // Reapply stealth/invisibility if active or show if not any if (HasAuraType(SPELL_AURA_MOD_STEALTH)) @@ -2331,7 +2331,7 @@ void Player::SetGMVisible(bool on) } else { - m_ExtraFlags |= PLAYER_EXTRA_GM_INVISIBLE; //add flag + m_ExtraFlags |= PLAYER_EXTRA_GM_INVISIBLE; // add flag SetAcceptWhispers(false); SetGameMaster(true); @@ -2494,7 +2494,7 @@ void Player::GiveLevel(uint32 level) SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr.GetXPForLevel(level)); - //update level, max level of skills + // update level, max level of skills m_Played_time[PLAYED_TIME_LEVEL] = 0; // Level Played Time reset _ApplyAllLevelScaleItemMods(false); @@ -2545,7 +2545,7 @@ void Player::UpdateFreeTalentPoints(bool resetIfNeed) if (level < 10) { // Remove all talent points - if (m_usedTalentCount > 0) // Free any used talents + if (m_usedTalentCount > 0) // Free any used talents { if (resetIfNeed) resetTalents(true); @@ -2580,7 +2580,7 @@ void Player::InitTalentForLevel() void Player::InitStatsForLevel(bool reapplyMods) { - if (reapplyMods) //reapply stats values only on .reset stats (level) command + if (reapplyMods) // reapply stats values only on .reset stats (level) command _RemoveAllStatBonuses(); PlayerClassLevelInfo classInfo; @@ -2609,14 +2609,14 @@ void Player::InitStatsForLevel(bool reapplyMods) SetCreateHealth(classInfo.basehealth); - //set create powers + // set create powers SetCreateMana(classInfo.basemana); SetArmor(int32(m_createStats[STAT_AGILITY] * 2)); InitStatBuffMods(); - //reset rating fields values + // reset rating fields values for (uint16 index = PLAYER_FIELD_COMBAT_RATING_1; index < PLAYER_FIELD_COMBAT_RATING_1 + MAX_COMBAT_RATING; ++index) SetUInt32Value(index, 0); @@ -2628,7 +2628,7 @@ void Player::InitStatsForLevel(bool reapplyMods) SetFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i, 1.00f); } - //reset attack power, damage and attack speed fields + // reset attack power, damage and attack speed fields SetFloatValue(UNIT_FIELD_BASEATTACKTIME, 2000.0f); SetFloatValue(UNIT_FIELD_BASEATTACKTIME + 1, 2000.0f); // offhand attack time SetFloatValue(UNIT_FIELD_RANGEDATTACKTIME, 2000.0f); @@ -2718,7 +2718,7 @@ void Player::InitStatsForLevel(bool reapplyMods) // restore if need some important flags SetUInt32Value(PLAYER_FIELD_BYTES2, 0); // flags empty by default - if (reapplyMods) //reapply stats values only on .reset stats (level) command + if (reapplyMods) // reapply stats values only on .reset stats (level) command _ApplyAllStatBonuses(); // set current level health and mana/energy to maximum after applying all mods. @@ -2811,7 +2811,7 @@ void Player::RemoveMail(uint32 id) { if ((*itr)->messageID == id) { - //do not delete item, because Player::removeMail() is called when returning mail to sender. + // do not delete item, because Player::removeMail() is called when returning mail to sender. m_mail.erase(itr); return; } @@ -2956,7 +2956,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen { itr->second.active = active; - if (!IsInWorld() && !learning && !dependent_set) // explicitly load from DB and then exist in it already and set correctly + if (!IsInWorld() && !learning && !dependent_set)// explicitly load from DB and then exist in it already and set correctly itr->second.state = PLAYERSPELL_UNCHANGED; else if (itr->second.state != PLAYERSPELL_NEW) itr->second.state = PLAYERSPELL_CHANGED; @@ -3000,15 +3000,15 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen } else switch (itr->second.state) { - case PLAYERSPELL_UNCHANGED: // known saved spell + case PLAYERSPELL_UNCHANGED: // known saved spell return false; - case PLAYERSPELL_REMOVED: // re-learning removed not saved spell + case PLAYERSPELL_REMOVED: // re-learning removed not saved spell { m_spells.erase(itr); state = PLAYERSPELL_CHANGED; - break; // need re-add + break; // need re-add } - default: // known not saved yet spell (new or modified) + default: // known not saved yet spell (new or modified) { // can be in case spell loading but learned at some previous spell loading if (!IsInWorld() && !learning && !dependent_set) @@ -3580,7 +3580,7 @@ void Player::_LoadSpellCooldowns(QueryResult* result) { // some cooldowns can be already set at aura loading... - //QueryResult *result = CharacterDatabase.PQuery("SELECT spell,item,time FROM character_spell_cooldown WHERE guid = '%u'",GetGUIDLow()); + // QueryResult *result = CharacterDatabase.PQuery("SELECT spell,item,time FROM character_spell_cooldown WHERE guid = '%u'",GetGUIDLow()); if (result) { @@ -3777,7 +3777,7 @@ bool Player::resetTalents(bool no_cost, bool all_specs) m_resetTalentsTime = time(NULL); } - //FIXME: remove pet before or after unlearn spells? for now after unlearn to allow removing of talent related, pet affecting auras + // FIXME: remove pet before or after unlearn spells? for now after unlearn to allow removing of talent related, pet affecting auras RemovePet(PET_SAVE_REAGENTS); /* when prev line will dropped use next line if(Pet* pet = GetPet()) @@ -4131,8 +4131,8 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe uint32 money = fields[6].GetUInt32(); bool has_items = fields[7].GetBool(); - //we can return mail now - //so firstly delete the old one + // we can return mail now + // so firstly delete the old one CharacterDatabase.PExecute("DELETE FROM mail WHERE id = '%u'", mail_id); // mail not from player @@ -4174,7 +4174,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe if (!pItem->LoadFromDB(item_guidlow, fields2, playerguid)) { pItem->FSetState(ITEM_REMOVED); - pItem->SaveToDB(); // it also deletes item object ! + pItem->SaveToDB(); // it also deletes item object ! continue; } @@ -4212,7 +4212,7 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe { Field* fields3 = resultPets->Fetch(); uint32 petguidlow = fields3[0].GetUInt32(); - //do not create separate transaction for pet delete otherwise we will get fatal error! + // do not create separate transaction for pet delete otherwise we will get fatal error! Pet::DeleteFromDB(petguidlow, false); } while (resultPets->NextRow()); @@ -4392,7 +4392,7 @@ void Player::BuildPlayerRepop() // to prevent cheating corpse->ResetGhostTime(); - StopMirrorTimers(); //disable timers(bars) + StopMirrorTimers(); // disable timers(bars) // set and clear other SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND); @@ -4445,10 +4445,10 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness) if (!applySickness) return; - //Characters from level 1-10 are not affected by resurrection sickness. - //Characters from level 11-19 will suffer from one minute of sickness - //for each level they are above 10. - //Characters level 20 and up suffer from ten minutes of sickness. + // Characters from level 1-10 are not affected by resurrection sickness. + // Characters from level 11-19 will suffer from one minute of sickness + // for each level they are above 10. + // Characters level 20 and up suffer from ten minutes of sickness. int32 startLevel = sWorld.getConfig(CONFIG_INT32_DEATH_SICKNESS_LEVEL); if (int32(getLevel()) >= startLevel) @@ -4474,10 +4474,10 @@ void Player::KillPlayer() { SetMovement(MOVE_ROOT); - StopMirrorTimers(); //disable timers(bars) + StopMirrorTimers(); // disable timers(bars) SetDeathState(CORPSE); - //SetFlag( UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_IN_PVP ); + // SetFlag( UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_IN_PVP ); SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_NONE); ApplyModByteFlag(PLAYER_FIELD_BYTES, 0, PLAYER_FIELD_BYTE_RELEASE_TIMER, !sMapStore.LookupEntry(GetMapId())->Instanceable()); @@ -4587,7 +4587,7 @@ void Player::DurabilityLossAll(double percent, bool inventory) DurabilityLoss(pItem, percent); // keys not have durability - //for(int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; ++i) + // for(int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; ++i) for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) @@ -4631,7 +4631,7 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory) DurabilityPointsLoss(pItem, points); // keys not have durability - //for(int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; ++i) + // for(int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; ++i) for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) @@ -4731,7 +4731,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g costs = uint32(costs * discountMod); - if (costs == 0) //fix for ITEM_QUALITY_ARTIFACT + if (costs == 0) // fix for ITEM_QUALITY_ARTIFACT costs = 1; if (guildBank) @@ -4818,7 +4818,7 @@ void Player::RepopAtGraveyard() TeleportTo(ClosestGrave->map_id, ClosestGrave->x, ClosestGrave->y, ClosestGrave->z, GetOrientation()); if (isDead()) // not send if alive, because it used in TeleportTo() { - WorldPacket data(SMSG_DEATH_RELEASE_LOC, 4 * 4); // show spirit healer position on minimap + WorldPacket data(SMSG_DEATH_RELEASE_LOC, 4 * 4);// show spirit healer position on minimap data << ClosestGrave->map_id; data << ClosestGrave->x; data << ClosestGrave->y; @@ -5295,7 +5295,7 @@ void Player::SetRegularAttackTime() } } -//skill+step, checking for max value +// skill+step, checking for max value bool Player::UpdateSkill(uint32 skill_id, uint32 step) { if (!skill_id) @@ -5521,7 +5521,7 @@ void Player::UpdateCombatSkills(Unit* pVictim, WeaponAttackType attType, bool de if (!defence) chance *= 0.1f * GetStat(STAT_INTELLECT); - chance = chance < 1.0f ? 1.0f : chance; //minimum chance to increase skill is 1% + chance = chance < 1.0f ? 1.0f : chance; // minimum chance to increase skill is 1% if (roll_chance_f(chance)) { @@ -5651,7 +5651,7 @@ void Player::SetSkill(uint16 id, uint16 currVal, uint16 maxVal, uint16 step /*=0 GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, id); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, id); } - else //remove + else // remove { // clear skill fields SetUInt32Value(PLAYER_SKILL_INDEX(itr->second.pos), 0); @@ -6052,8 +6052,8 @@ void Player::SendMessageToSet(WorldPacket* data, bool self) if (IsInWorld()) GetMap()->MessageBroadcast(this, data, false); - //if player is not in world and map in not created/already destroyed - //no need to create one, just send packet for itself! + // if player is not in world and map in not created/already destroyed + // no need to create one, just send packet for itself! if (self) GetSession()->SendPacket(data); } @@ -6226,7 +6226,7 @@ ReputationRank Player::GetReputationRank(uint32 faction) const return GetReputationMgr().GetRank(factionEntry); } -//Calculate total reputation percent player gain with quest/creature level +// Calculate total reputation percent player gain with quest/creature level int32 Player::CalculateReputationGain(ReputationSource source, int32 rep, int32 faction, uint32 creatureOrQuestLevel, bool noAuraBonus) { float percent = 100.0f; @@ -6287,7 +6287,7 @@ int32 Player::CalculateReputationGain(ReputationSource source, int32 rep, int32 return int32(sWorld.getConfig(CONFIG_FLOAT_RATE_REPUTATION_GAIN) * rep * percent / 100.0f); } -//Calculates how many reputation points player gains in victim's enemy factions +// Calculates how many reputation points player gains in victim's enemy factions void Player::RewardReputation(Unit* pVictim, float rate) { if (!pVictim || pVictim->GetTypeId() == TYPEID_PLAYER) @@ -6336,7 +6336,7 @@ void Player::RewardReputation(Unit* pVictim, float rate) } } -//Calculate how many reputation points player gain with the quest +// Calculate how many reputation points player gain with the quest void Player::RewardReputation(Quest const* pQuest) { // quest reputation reward/loss @@ -6413,9 +6413,9 @@ void Player::UpdateHonorFields() m_lastHonorUpdateTime = now; } -///Calculate the amount of honor gained based on the victim -///and the size of the group for which the honor is divided -///An exact honor value can also be given (overriding the calcs) +/// Calculate the amount of honor gained based on the victim +/// and the size of the group for which the honor is divided +/// An exact honor value can also be given (overriding the calcs) bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, float honor) { // do not reward honor in arenas, but enable onkill spellproc @@ -6454,7 +6454,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, float honor) if (GetTeam() == pVictim->GetTeam() && !sWorld.IsFFAPvPRealm()) return false; - float f = 1; //need for total kills (?? need more info) + float f = 1; // need for total kills (?? need more info) uint32 k_grey = 0; uint32 k_level = getLevel(); uint32 v_level = pVictim->getLevel(); @@ -6489,10 +6489,10 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, float honor) float diff_level = (k_level == k_grey) ? 1 : ((float(v_level) - float(k_grey)) / (float(k_level) - float(k_grey))); - int32 v_rank = 1; //need more info + int32 v_rank = 1; // need more info honor = ((f * diff_level * (190 + v_rank * 10)) / 6); - honor *= float(k_level) / 70.0f; //factor of dependence on levels of the killer + honor *= float(k_level) / 70.0f; // factor of dependence on levels of the killer // count the number of playerkills in one day ApplyModUInt32Value(PLAYER_FIELD_KILLS, 1, true); @@ -6801,7 +6801,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) UpdateZoneDependentPets(); } -//If players are too far way of duel flag... then player loose the duel +// If players are too far way of duel flag... then player loose the duel void Player::CheckDuelDistance(time_t currTime) { if (!duel) @@ -6868,7 +6868,7 @@ void Player::DuelComplete(DuelCompleteType type) duel->opponent->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL, 1); } - //Remove Duel Flag object + // Remove Duel Flag object if (GameObject* obj = GetMap()->GetGameObject(GetGuidValue(PLAYER_DUEL_ARBITER))) duel->initiator->RemoveGameObject(obj, true); @@ -6905,7 +6905,7 @@ void Player::DuelComplete(DuelCompleteType type) else if (duel->opponent->GetComboTargetGuid() == GetPetGuid()) duel->opponent->ClearComboPoints(); - //cleanups + // cleanups SetGuidValue(PLAYER_DUEL_ARBITER, ObjectGuid()); SetUInt32Value(PLAYER_DUEL_TEAM, 0); duel->opponent->SetGuidValue(PLAYER_DUEL_ARBITER, ObjectGuid()); @@ -6947,7 +6947,7 @@ void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply) ApplyItemEquipSpell(item, apply); ApplyEnchantment(item, apply); - if (proto->Socket[0].Color) //only (un)equipping of items with sockets can influence metagems, so no need to waste time with normal items + if (proto->Socket[0].Color) // only (un)equipping of items with sockets can influence metagems, so no need to waste time with normal items CorrectMetaGemEnchants(slot, apply); DEBUG_LOG("_ApplyItemMods complete."); @@ -7006,19 +7006,19 @@ void Player::_ApplyItemBonuses(ItemPrototype const* proto, uint8 slot, bool appl HandleStatModifier(UNIT_MOD_STAT_AGILITY, BASE_VALUE, float(val), apply); ApplyStatBuffMod(STAT_AGILITY, float(val), apply); break; - case ITEM_MOD_STRENGTH: //modify strength + case ITEM_MOD_STRENGTH: // modify strength HandleStatModifier(UNIT_MOD_STAT_STRENGTH, BASE_VALUE, float(val), apply); ApplyStatBuffMod(STAT_STRENGTH, float(val), apply); break; - case ITEM_MOD_INTELLECT: //modify intellect + case ITEM_MOD_INTELLECT: // modify intellect HandleStatModifier(UNIT_MOD_STAT_INTELLECT, BASE_VALUE, float(val), apply); ApplyStatBuffMod(STAT_INTELLECT, float(val), apply); break; - case ITEM_MOD_SPIRIT: //modify spirit + case ITEM_MOD_SPIRIT: // modify spirit HandleStatModifier(UNIT_MOD_STAT_SPIRIT, BASE_VALUE, float(val), apply); ApplyStatBuffMod(STAT_SPIRIT, float(val), apply); break; - case ITEM_MOD_STAMINA: //modify stamina + case ITEM_MOD_STAMINA: // modify stamina HandleStatModifier(UNIT_MOD_STAT_STAMINA, BASE_VALUE, float(val), apply); ApplyStatBuffMod(STAT_STAMINA, float(val), apply); break; @@ -7229,7 +7229,7 @@ void Player::_ApplyItemBonuses(ItemPrototype const* proto, uint8 slot, bool appl { damage = apply ? minDamage : BASE_MINDAMAGE; SetBaseWeaponDamage(attType, MINDAMAGE, damage); - //sLog.outError("applying mindam: assigning %f to weapon mindamage, now is: %f", damage, GetWeaponDamageRange(attType, MINDAMAGE)); + // sLog.outError("applying mindam: assigning %f to weapon mindamage, now is: %f", damage, GetWeaponDamageRange(attType, MINDAMAGE)); } if (maxDamage > 0) @@ -7454,8 +7454,8 @@ void Player::UpdateEquipSpellsAtFormChange() if (!spellInfo) continue; - ApplyEquipSpell(spellInfo, NULL, false, true); // remove spells that not fit to form - ApplyEquipSpell(spellInfo, NULL, true, true); // add spells that fit form but not active + ApplyEquipSpell(spellInfo, NULL, false, true); // remove spells that not fit to form + ApplyEquipSpell(spellInfo, NULL, true, true); // add spells that fit form but not active } } } @@ -7690,7 +7690,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8 Spell* spell = new Spell(this, spellInfo, false); spell->m_CastItem = item; - spell->m_cast_count = cast_count; //set count of casts + spell->m_cast_count = cast_count; // set count of casts spell->m_currentBasePoints[EFFECT_INDEX_0] = learning_spell_id; spell->prepare(&targets); return; @@ -10595,7 +10595,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16& dest, Item* pItem, bool return EQUIP_ERR_YOU_ARE_STUNNED; if (isInCombat() && pProto->Class == ITEM_CLASS_WEAPON && m_weaponChangeTimer != 0) - return EQUIP_ERR_CANT_DO_RIGHT_NOW; // maybe exist better err + return EQUIP_ERR_CANT_DO_RIGHT_NOW; // maybe exist better err if (IsNonMeleeSpellCasted(false)) return EQUIP_ERR_CANT_DO_RIGHT_NOW; @@ -10926,7 +10926,7 @@ InventoryResult Player::CanUseItem(Item* pItem, bool direct_action) const if (!isAlive() && direct_action) return EQUIP_ERR_YOU_ARE_DEAD; - //if (isStunned()) + // if (isStunned()) // return EQUIP_ERR_YOU_ARE_STUNNED; ItemPrototype const* pProto = pItem->GetProto(); @@ -11025,7 +11025,7 @@ InventoryResult Player::CanUseAmmo(uint32 item) const DEBUG_LOG("STORAGE: CanUseAmmo item = %u", item); if (!isAlive()) return EQUIP_ERR_YOU_ARE_DEAD; - //if( isStunned() ) + // if( isStunned() ) // return EQUIP_ERR_YOU_ARE_STUNNED; ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(item); if (pProto) @@ -11325,7 +11325,7 @@ Item* Player::EquipItem(uint16 pos, Item* pItem, bool update) pItem2->SendCreateUpdateToPlayer(this); // delete item (it not in any slot currently) - //pItem->DeleteFromDB(); + // pItem->DeleteFromDB(); if (IsInWorld() && update) { pItem->RemoveFromWorld(); @@ -11498,7 +11498,7 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) // pItem->SetGuidValue(ITEM_FIELD_OWNER, ObjectGuid()); not clear owner at remove (it will be set at store). This used in mail and auction code pItem->SetSlot(NULL_SLOT); - //ApplyItemOnStoreSpell, for avoid re-apply will remove at _adding_ to not appropriate slot + // ApplyItemOnStoreSpell, for avoid re-apply will remove at _adding_ to not appropriate slot if (IsInWorld() && update) pItem->SendCreateUpdateToPlayer(this); @@ -11630,7 +11630,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) pItem->DestroyForPlayer(this); } - //pItem->SetOwnerGUID(0); + // pItem->SetOwnerGUID(0); pItem->SetGuidValue(ITEM_FIELD_CONTAINED, ObjectGuid()); pItem->SetSlot(NULL_SLOT); pItem->SetState(ITEM_REMOVED, this); @@ -11923,7 +11923,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count) if (pSrcItem->HasGeneratedLoot()) // prevent split looting item (stackable items can has only temporary loot and this meaning that loot window open) { - //best error message found for attempting to split while looting + // best error message found for attempting to split while looting SendEquipError(EQUIP_ERR_COULDNT_SPLIT_ITEMS, pSrcItem, NULL); return; } @@ -13475,8 +13475,8 @@ void Player::PrepareQuestMenu(ObjectGuid guid) } else { - //we should obtain map pointer from GetMap() in 99% of cases. Special case - //only for quests which cast teleport spells on player + // we should obtain map pointer from GetMap() in 99% of cases. Special case + // only for quests which cast teleport spells on player Map* _map = IsInWorld() ? GetMap() : sMapMgr.FindMap(GetMapId(), GetInstanceId()); MANGOS_ASSERT(_map); @@ -13577,8 +13577,8 @@ void Player::SendPreparedQuest(ObjectGuid guid) GossipText const* gossiptext = sObjectMgr.GetGossipText(textid); if (!gossiptext) { - qe._Delay = 0; //TEXTEMOTE_MESSAGE; //zyg: player emote - qe._Emote = 0; //TEXTEMOTE_HELLO; //zyg: NPC emote + qe._Delay = 0; // TEXTEMOTE_MESSAGE; // zyg: player emote + qe._Emote = 0; // TEXTEMOTE_HELLO; // zyg: NPC emote title = ""; } else @@ -13632,8 +13632,8 @@ Quest const* Player::GetNextQuest(ObjectGuid guid, Quest const* pQuest) } else { - //we should obtain map pointer from GetMap() in 99% of cases. Special case - //only for quests which cast teleport spells on player + // we should obtain map pointer from GetMap() in 99% of cases. Special case + // only for quests which cast teleport spells on player Map* _map = IsInWorld() ? GetMap() : sMapMgr.FindMap(GetMapId(), GetInstanceId()); MANGOS_ASSERT(_map); @@ -14419,7 +14419,7 @@ bool Player::SatisfyQuestRace(Quest const* qInfo, bool msg) const bool Player::SatisfyQuestReputation(Quest const* qInfo, bool msg) const { - uint32 fIdMin = qInfo->GetRequiredMinRepFaction(); //Min required rep + uint32 fIdMin = qInfo->GetRequiredMinRepFaction(); // Min required rep if (fIdMin && GetReputationMgr().GetReputation(fIdMin) < qInfo->GetRequiredMinRepValue()) { if (msg) @@ -14428,7 +14428,7 @@ bool Player::SatisfyQuestReputation(Quest const* qInfo, bool msg) const return false; } - uint32 fIdMax = qInfo->GetRequiredMaxRepFaction(); //Max required rep + uint32 fIdMax = qInfo->GetRequiredMaxRepFaction(); // Max required rep if (fIdMax && GetReputationMgr().GetReputation(fIdMax) >= qInfo->GetRequiredMaxRepValue()) { if (msg) @@ -14530,7 +14530,7 @@ bool Player::SatisfyQuestNextChain(Quest const* qInfo, bool msg) const // check for all quests further up the chain // only necessary if there are quest chains with more than one quest that can be skipped - //return SatisfyQuestNextChain( qInfo->GetNextQuestInChain(), msg ); + // return SatisfyQuestNextChain( qInfo->GetNextQuestInChain(), msg ); return true; } @@ -14555,7 +14555,7 @@ bool Player::SatisfyQuestPrevChain(Quest const* qInfo, bool msg) const // check for all quests further down the chain // only necessary if there are quest chains with more than one quest that can be skipped - //if( !SatisfyQuestPrevChain( prevId, msg ) ) + // if( !SatisfyQuestPrevChain( prevId, msg ) ) // return false; } @@ -14799,7 +14799,7 @@ void Player::AreaExploredOrEventHappens(uint32 questId) } } -//not used in mangosd, function for external script library +// not used in mangosd, function for external script library void Player::GroupEventHappens(uint32 questId, WorldObject const* pEventObject) { if (Group* pGroup = GetGroup()) @@ -15484,7 +15484,7 @@ void Player::_LoadIntoDataField(const char* data, uint32 startOffset, uint32 cou bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder* holder) { // 0 1 2 3 4 5 6 7 8 9 10 11 - //SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags," + // SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags," // 12 13 14 15 16 17 18 19 20 21 22 23 24 //"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost," // 25 26 27 28 29 30 31 32 33 34 35 36 37 38 @@ -15591,8 +15591,8 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder* holder) DEBUG_FILTER_LOG(LOG_FILTER_PLAYER_STATS, "Load Basic value of player %s is: ", m_name.c_str()); outDebugStatsValues(); - //Need to call it to initialize m_team (m_team can be calculated from race) - //Other way is to saves m_team into characters table. + // Need to call it to initialize m_team (m_team can be calculated from race) + // Other way is to saves m_team into characters table. setFactionForRace(getRace()); SetCharm(NULL); @@ -15660,7 +15660,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder* holder) _LoadBGData(holder->GetResult(PLAYER_LOGIN_QUERY_LOADBGDATA)); - if (m_bgData.bgInstanceID) //saved in BattleGround + if (m_bgData.bgInstanceID) // saved in BattleGround { BattleGround* currentBg = sBattleGroundMgr.GetBattleGround(m_bgData.bgInstanceID, BATTLEGROUND_TYPE_NONE); @@ -15673,7 +15673,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder* holder) m_bgData.bgTypeID = currentBg->GetTypeID(); // bg data not marked as modified - //join player to battleground group + // join player to battleground group currentBg->EventPlayerLoggedIn(this, GetObjectGuid()); currentBg->AddOrSetPlayerToCorrectBgGroup(this, GetObjectGuid(), m_bgData.bgTeam); @@ -15890,9 +15890,9 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder* holder) if (time_diff > 0) { - //speed collect rest bonus in offline, in logout, far from tavern, city (section/in hour) + // speed collect rest bonus in offline, in logout, far from tavern, city (section/in hour) float bubble0 = 0.031f; - //speed collect rest bonus in offline, in logout, in tavern, city (section/in hour) + // speed collect rest bonus in offline, in logout, in tavern, city (section/in hour) float bubble1 = 0.125f; float bubble = fields[23].GetUInt32() > 0 ? bubble1 * sWorld.getConfig(CONFIG_FLOAT_RATE_REST_OFFLINE_IN_TAVERN_OR_CITY) @@ -15984,8 +15984,8 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder* holder) Relocate(nodeEntry->x, nodeEntry->y, nodeEntry->z, 0.0f); } - //we can be relocated from taxi and still have an outdated Map pointer! - //so we need to get a new Map pointer! + // we can be relocated from taxi and still have an outdated Map pointer! + // so we need to get a new Map pointer! SetMap(sMapMgr.CreateMap(GetMapId(), this)); SaveRecallPosition(); // save as recall also to prevent recall and fall from sky @@ -16015,7 +16015,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder* holder) if (!isAlive()) RemoveAllAurasOnDeath(); - //apply all stat bonuses from items and auras + // apply all stat bonuses from items and auras SetCanModifyStats(true); UpdateAllStats(); @@ -16133,7 +16133,7 @@ void Player::_LoadActions(QueryResult* result) for (int i = 0; i < MAX_TALENT_SPEC_COUNT; ++i) m_actionButtons[i].clear(); - //QueryResult *result = CharacterDatabase.PQuery("SELECT spec, button,action,type FROM character_action WHERE guid = '%u' ORDER BY button",GetGUIDLow()); + // QueryResult *result = CharacterDatabase.PQuery("SELECT spec, button,action,type FROM character_action WHERE guid = '%u' ORDER BY button",GetGUIDLow()); if (result) { @@ -16164,9 +16164,9 @@ void Player::_LoadActions(QueryResult* result) void Player::_LoadAuras(QueryResult* result, uint32 timediff) { - //RemoveAllAuras(); -- some spells casted before aura load, for example in LoadSkills, aura list explicitly cleaned early + // RemoveAllAuras(); -- some spells casted before aura load, for example in LoadSkills, aura list explicitly cleaned early - //QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,item_guid,spell,stackcount,remaincharges,basepoints0,basepoints1,basepoints2,periodictime0,periodictime1,periodictime2,maxduration,remaintime,effIndexMask FROM character_aura WHERE guid = '%u'",GetGUIDLow()); + // QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,item_guid,spell,stackcount,remaincharges,basepoints0,basepoints1,basepoints2,periodictime0,periodictime1,periodictime2,maxduration,remaintime,effIndexMask FROM character_aura WHERE guid = '%u'",GetGUIDLow()); if (result) { @@ -16312,7 +16312,7 @@ void Player::LoadCorpse() } else { - //Prevent Dead Player login without corpse + // Prevent Dead Player login without corpse ResurrectPlayer(0.5f); } } @@ -16320,12 +16320,12 @@ void Player::LoadCorpse() void Player::_LoadInventory(QueryResult* result, uint32 timediff) { - //QueryResult *result = CharacterDatabase.PQuery("SELECT data,text,bag,slot,item,item_template FROM character_inventory JOIN item_instance ON character_inventory.item = item_instance.guid WHERE character_inventory.guid = '%u' ORDER BY bag,slot", GetGUIDLow()); + // QueryResult *result = CharacterDatabase.PQuery("SELECT data,text,bag,slot,item,item_template FROM character_inventory JOIN item_instance ON character_inventory.item = item_instance.guid WHERE character_inventory.guid = '%u' ORDER BY bag,slot", GetGUIDLow()); std::map bagMap; // fast guid lookup for bags - //NOTE: the "order by `bag`" is important because it makes sure - //the bagMap is filled before items in the bags are loaded - //NOTE2: the "order by `slot`" is needed because mainhand weapons are (wrongly?) - //expected to be equipped before offhand items (TODO: fixme) + // NOTE: the "order by `bag`" is important because it makes sure + // the bagMap is filled before items in the bags are loaded + // NOTE2: the "order by `slot`" is needed because mainhand weapons are (wrongly?) + // expected to be equipped before offhand items (TODO: fixme) uint32 zone = GetZoneId(); @@ -16485,13 +16485,13 @@ void Player::_LoadInventory(QueryResult* result, uint32 timediff) } } - //if(isAlive()) + // if(isAlive()) _ApplyAllItemMods(); } void Player::_LoadItemLoot(QueryResult* result) { - //QueryResult *result = CharacterDatabase.PQuery("SELECT guid,itemid,amount,suffix,property FROM item_loot WHERE guid = '%u'", GetGUIDLow()); + // QueryResult *result = CharacterDatabase.PQuery("SELECT guid,itemid,amount,suffix,property FROM item_loot WHERE guid = '%u'", GetGUIDLow()); if (result) { @@ -16631,7 +16631,7 @@ void Player::_LoadQuestStatus(QueryResult* result) uint32 slot = 0; //// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 - //QueryResult *result = CharacterDatabase.PQuery("SELECT quest, status, rewarded, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, itemcount1, itemcount2, itemcount3, itemcount4, itemcount5, itemcount6 FROM character_queststatus WHERE guid = '%u'", GetGUIDLow()); + // QueryResult *result = CharacterDatabase.PQuery("SELECT quest, status, rewarded, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, itemcount1, itemcount2, itemcount3, itemcount4, itemcount5, itemcount6 FROM character_queststatus WHERE guid = '%u'", GetGUIDLow()); if (result) { @@ -16745,7 +16745,7 @@ void Player::_LoadDailyQuestStatus(QueryResult* result) for (uint32 quest_daily_idx = 0; quest_daily_idx < PLAYER_MAX_DAILY_QUESTS; ++quest_daily_idx) SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1 + quest_daily_idx, 0); - //QueryResult *result = CharacterDatabase.PQuery("SELECT quest FROM character_queststatus_daily WHERE guid = '%u'", GetGUIDLow()); + // QueryResult *result = CharacterDatabase.PQuery("SELECT quest FROM character_queststatus_daily WHERE guid = '%u'", GetGUIDLow()); if (result) { @@ -16784,7 +16784,7 @@ void Player::_LoadWeeklyQuestStatus(QueryResult* result) { m_weeklyquests.clear(); - //QueryResult *result = CharacterDatabase.PQuery("SELECT quest FROM character_queststatus_weekly WHERE guid = '%u'", GetGUIDLow()); + // QueryResult *result = CharacterDatabase.PQuery("SELECT quest FROM character_queststatus_weekly WHERE guid = '%u'", GetGUIDLow()); if (result) { @@ -16813,7 +16813,7 @@ void Player::_LoadMonthlyQuestStatus(QueryResult* result) { m_monthlyquests.clear(); - //QueryResult *result = CharacterDatabase.PQuery("SELECT quest FROM character_queststatus_weekly WHERE guid = '%u'", GetGUIDLow()); + // QueryResult *result = CharacterDatabase.PQuery("SELECT quest FROM character_queststatus_weekly WHERE guid = '%u'", GetGUIDLow()); if (result) { @@ -16841,7 +16841,7 @@ void Player::_LoadMonthlyQuestStatus(QueryResult* result) void Player::_LoadSpells(QueryResult* result) { - //QueryResult *result = CharacterDatabase.PQuery("SELECT spell,active,disabled FROM character_spell WHERE guid = '%u'",GetGUIDLow()); + // QueryResult *result = CharacterDatabase.PQuery("SELECT spell,active,disabled FROM character_spell WHERE guid = '%u'",GetGUIDLow()); if (result) { @@ -16870,7 +16870,7 @@ void Player::_LoadSpells(QueryResult* result) void Player::_LoadTalents(QueryResult* result) { - //QueryResult *result = CharacterDatabase.PQuery("SELECT talent_id, current_rank, spec FROM character_talent WHERE guid = '%u'",GetGUIDLow()); + // QueryResult *result = CharacterDatabase.PQuery("SELECT talent_id, current_rank, spec FROM character_talent WHERE guid = '%u'",GetGUIDLow()); if (result) { do @@ -16947,7 +16947,7 @@ void Player::_LoadTalents(QueryResult* result) void Player::_LoadGroup(QueryResult* result) { - //QueryResult *result = CharacterDatabase.PQuery("SELECT groupId FROM group_member WHERE memberGuid='%u'", GetGUIDLow()); + // QueryResult *result = CharacterDatabase.PQuery("SELECT groupId FROM group_member WHERE memberGuid='%u'", GetGUIDLow()); if (result) { uint32 groupId = (*result)[0].GetUInt32(); @@ -16974,7 +16974,7 @@ void Player::_LoadBoundInstances(QueryResult* result) Group* group = GetGroup(); - //QueryResult *result = CharacterDatabase.PQuery("SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = '%u'", GUID_LOPART(m_guid)); + // QueryResult *result = CharacterDatabase.PQuery("SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = '%u'", GUID_LOPART(m_guid)); if (result) { do @@ -17171,7 +17171,7 @@ void Player::SendSavedInstances() { for (BoundInstancesMap::const_iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr) { - if (itr->second.perm) // only permanent binds are sent + if (itr->second.perm) // only permanent binds are sent { hasBeenSaved = true; break; @@ -17179,7 +17179,7 @@ void Player::SendSavedInstances() } } - //Send opcode 811. true or false means, whether you have current raid/heroic instances + // Send opcode 811. true or false means, whether you have current raid/heroic instances data.Initialize(SMSG_UPDATE_INSTANCE_OWNERSHIP); data << uint32(hasBeenSaved); GetSession()->SendPacket(&data); @@ -17264,7 +17264,7 @@ bool Player::_LoadHomeBind(QueryResult* result) } bool ok = false; - //QueryResult *result = CharacterDatabase.PQuery("SELECT map,zone,position_x,position_y,position_z FROM character_homebind WHERE guid = '%u'", GUID_LOPART(playerGuid)); + // QueryResult *result = CharacterDatabase.PQuery("SELECT map,zone,position_x,position_y,position_z FROM character_homebind WHERE guid = '%u'", GUID_LOPART(playerGuid)); if (result) { Field* fields = result->Fetch(); @@ -17314,7 +17314,7 @@ void Player::SaveToDB() // delay auto save at any saves (manual, in code, or autosave) m_nextSave = sWorld.getConfig(CONFIG_UINT32_INTERVAL_SAVE); - //lets allow only players in world to be saved + // lets allow only players in world to be saved if (IsBeingTeleportedFar()) { ScheduleDelayedOperation(DELAYED_SAVE_PLAYER); @@ -17398,8 +17398,8 @@ void Player::SaveToDB() uberInsert.addFloat(finiteAlways(m_rest_bonus)); uberInsert.addUInt64(uint64(time(NULL))); uberInsert.addUInt32(HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0); - //save, far from tavern/city - //save, but in tavern/city + // save, far from tavern/city + // save, but in tavern/city uberInsert.addUInt32(m_resetTalentsCost); uberInsert.addUInt64(uint64(m_resetTalentsTime)); @@ -17414,7 +17414,7 @@ void Player::SaveToDB() uberInsert.addUInt32(m_ExtraFlags); - uberInsert.addUInt32(uint32(m_stableSlots)); // to prevent save uint8 as char + uberInsert.addUInt32(uint32(m_stableSlots)); // to prevent save uint8 as char uberInsert.addUInt32(uint32(m_atLoginFlags)); @@ -17422,7 +17422,7 @@ void Player::SaveToDB() uberInsert.addUInt64(uint64(m_deathExpireTime)); - ss << m_taxi.SaveTaxiDestinationsToString(); //string + ss << m_taxi.SaveTaxiDestinationsToString(); // string uberInsert.addString(ss); uberInsert.addUInt32(GetArenaPoints()); @@ -17456,13 +17456,13 @@ void Player::SaveToDB() uberInsert.addUInt32(uint32(m_specsCount)); uberInsert.addUInt32(uint32(m_activeSpec)); - for (uint32 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i) //string + for (uint32 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i) // string { ss << GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + i) << " "; } uberInsert.addString(ss); - for (uint32 i = 0; i < EQUIPMENT_SLOT_END * 2; ++i) //string + for (uint32 i = 0; i < EQUIPMENT_SLOT_END * 2; ++i) // string { ss << GetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + i) << " "; } @@ -17470,7 +17470,7 @@ void Player::SaveToDB() uberInsert.addUInt32(GetUInt32Value(PLAYER_AMMO_ID)); - for (uint32 i = 0; i < KNOWN_TITLES_SIZE * 2; ++i) //string + for (uint32 i = 0; i < KNOWN_TITLES_SIZE * 2; ++i) // string { ss << GetUInt32Value(PLAYER__FIELD_KNOWN_TITLES + i) << " "; } @@ -17480,7 +17480,7 @@ void Player::SaveToDB() uberInsert.Execute(); - if (m_mailsUpdated) //save mails only when needed + if (m_mailsUpdated) // save mails only when needed _SaveMail(); _SaveBGData(); @@ -17604,8 +17604,8 @@ void Player::_SaveAuras() for (SpellAuraHolderMap::const_iterator itr = auraHolders.begin(); itr != auraHolders.end(); ++itr) { SpellAuraHolder* holder = itr->second; - //skip all holders from spells that are passive or channeled - //do not save single target holders (unless they were cast by the player) + // skip all holders from spells that are passive or channeled + // do not save single target holders (unless they were cast by the player) if (!holder->IsPassive() && !IsChanneledSpell(holder->GetSpellProto()) && (holder->GetCasterGuid() == GetObjectGuid() || !holder->IsSingleTarget())) { int32 damage[MAX_EFFECT_INDEX]; @@ -17851,7 +17851,7 @@ void Player::_SaveMail() } } - //deallocate deleted mails... + // deallocate deleted mails... for (PlayerMails::iterator itr = m_mail.begin(); itr != m_mail.end();) { if ((*itr)->state == MAIL_STATE_DELETED) @@ -18385,7 +18385,7 @@ void Player::SendResetInstanceFailed(uint32 reason, uint32 MapId) /*** Update timers ***/ /*********************************************************/ -///checks the 15 afk reports per 5 minutes limit +/// checks the 15 afk reports per 5 minutes limit void Player::UpdateAfkReport(time_t currTime) { if (m_bgData.bgAfkReportedTimer <= currTime) @@ -18442,7 +18442,7 @@ void Player::BuildPlayerChat(WorldPacket* data, uint8 msgtype, const std::string *data << uint8(msgtype); *data << uint32(language); *data << ObjectGuid(GetObjectGuid()); - *data << uint32(language); //language 2.1.0 ? + *data << uint32(language); // language 2.1.0 ? *data << ObjectGuid(GetObjectGuid()); *data << uint32(text.length() + 1); *data << text; @@ -18857,7 +18857,7 @@ void Player::SetRestBonus(float rest_bonus_new) else if (m_rest_bonus <= 1) SetByteValue(PLAYER_BYTES_2, 3, REST_STATE_NORMAL); - //RestTickUpdate + // RestTickUpdate SetUInt32Value(PLAYER_REST_STATE_EXPERIENCE, uint32(m_rest_bonus)); } @@ -19078,7 +19078,7 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc return false; } - //Checks and preparations done, DO FLIGHT + // Checks and preparations done, DO FLIGHT ModifyMoney(-(int32)totalcost); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING, totalcost); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN, 1); @@ -19708,7 +19708,7 @@ void Player::UpdatePotionCooldown(Spell* spell) m_lastPotionId = 0; } -//slot to be excluded while counting +// slot to be excluded while counting bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot) { if (!enchantmentcondition) @@ -19721,7 +19721,7 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot) uint8 curcount[4] = {0, 0, 0, 0}; - //counting current equipped gem colors + // counting current equipped gem colors for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i) { if (i == slot) @@ -19795,10 +19795,10 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot) void Player::CorrectMetaGemEnchants(uint8 exceptslot, bool apply) { - //cycle all equipped items + // cycle all equipped items for (uint32 slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot) { - //enchants for the slot being socketed are handled by Player::ApplyItemMods + // enchants for the slot being socketed are handled by Player::ApplyItemMods if (slot == exceptslot) continue; @@ -19820,13 +19820,13 @@ void Player::CorrectMetaGemEnchants(uint8 exceptslot, bool apply) uint32 condition = enchantEntry->EnchantmentCondition; if (condition) { - //was enchant active with/without item? + // was enchant active with/without item? bool wasactive = EnchantmentFitsRequirements(condition, apply ? exceptslot : -1); - //should it now be? + // should it now be? if (wasactive != EnchantmentFitsRequirements(condition, apply ? -1 : exceptslot)) { // ignore item gem conditions - //if state changed, (dis)apply enchant + // if state changed, (dis)apply enchant ApplyEnchantment(pItem, EnchantmentSlot(enchant_slot), !wasactive, true, true); } } @@ -19834,33 +19834,33 @@ void Player::CorrectMetaGemEnchants(uint8 exceptslot, bool apply) } } -//if false -> then toggled off if was on| if true -> toggled on if was off AND meets requirements +// if false -> then toggled off if was on| if true -> toggled on if was off AND meets requirements void Player::ToggleMetaGemsActive(uint8 exceptslot, bool apply) { - //cycle all equipped items + // cycle all equipped items for (int slot = EQUIPMENT_SLOT_START; slot < EQUIPMENT_SLOT_END; ++slot) { - //enchants for the slot being socketed are handled by WorldSession::HandleSocketOpcode(WorldPacket& recv_data) + // enchants for the slot being socketed are handled by WorldSession::HandleSocketOpcode(WorldPacket& recv_data) if (slot == exceptslot) continue; Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot); - if (!pItem || !pItem->GetProto()->Socket[0].Color) //if item has no sockets or no item is equipped go to next item + if (!pItem || !pItem->GetProto()->Socket[0].Color) // if item has no sockets or no item is equipped go to next item continue; - //cycle all (gem)enchants + // cycle all (gem)enchants for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT + 3; ++enchant_slot) { uint32 enchant_id = pItem->GetEnchantmentId(EnchantmentSlot(enchant_slot)); - if (!enchant_id) //if no enchant go to next enchant(slot) + if (!enchant_id) // if no enchant go to next enchant(slot) continue; SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id); if (!enchantEntry) continue; - //only metagems to be (de)activated, so only enchants with condition + // only metagems to be (de)activated, so only enchants with condition uint32 condition = enchantEntry->EnchantmentCondition; if (condition) ApplyEnchantment(pItem, EnchantmentSlot(enchant_slot), apply); @@ -19933,7 +19933,7 @@ void Player::LeaveBattleground(bool teleportToEntryPoint) { if (bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN) { - //lets check if player was teleported from BG and schedule delayed Deserter spell cast + // lets check if player was teleported from BG and schedule delayed Deserter spell cast if (IsBeingTeleportedFar()) { ScheduleDelayedOperation(DELAYED_SPELL_CAST_DESERTER); @@ -19964,7 +19964,7 @@ bool Player::CanReportAfkDueToLimit() return true; } -///This player has been blamed to be inactive in a battleground +/// This player has been blamed to be inactive in a battleground void Player::ReportedAfkBy(Player* reporter) { BattleGround* bg = GetBattleGround(); @@ -20782,7 +20782,7 @@ bool Player::HasQuestForGO(int32 GOId) const for (int j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) { - if (qinfo->ReqCreatureOrGOId[j] >= 0) //skip non GO case + if (qinfo->ReqCreatureOrGOId[j] >= 0) // skip non GO case continue; if ((-1)*GOId == qinfo->ReqCreatureOrGOId[j] && qs.m_creatureOrGOcount[j] < qinfo->ReqCreatureOrGOCount[j]) @@ -21178,8 +21178,8 @@ void Player::ResurectUsingRequestData() if (m_resurrectGuid.IsPlayer()) TeleportTo(m_resurrectMap, m_resurrectX, m_resurrectY, m_resurrectZ, GetOrientation()); - //we cannot resurrect player when we triggered far teleport - //player will be resurrected upon teleportation + // we cannot resurrect player when we triggered far teleport + // player will be resurrected upon teleportation if (IsBeingTeleportedFar()) { ScheduleDelayedOperation(DELAYED_RESURRECT_PLAYER); @@ -21389,7 +21389,7 @@ PartyResult Player::CanUninviteFromGroup() const void Player::SetBattleGroundRaid(Group* group, int8 subgroup) { - //we must move references from m_group to m_originalGroup + // we must move references from m_group to m_originalGroup SetOriginalGroup(GetGroup(), GetSubGroup()); m_group.unlink(); @@ -21399,7 +21399,7 @@ void Player::SetBattleGroundRaid(Group* group, int8 subgroup) void Player::RemoveFromBattleGroundRaid() { - //remove existing reference + // remove existing reference m_group.unlink(); if (Group* group = GetOriginalGroup()) { @@ -21533,7 +21533,7 @@ uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 n GtBarberShopCostBaseEntry const* bsc = sGtBarberShopCostBaseStore.LookupEntry(level - 1); - if (!bsc) // shouldn't happen + if (!bsc) // shouldn't happen return 0xFFFFFFFF; float cost = 0; @@ -21907,10 +21907,10 @@ void Player::_LoadSkills(QueryResult* result) // set fixed skill ranges switch (GetSkillRangeType(pSkill, false)) { - case SKILL_RANGE_LANGUAGE: // 300..300 + case SKILL_RANGE_LANGUAGE: // 300..300 value = max = 300; break; - case SKILL_RANGE_MONO: // 1..1, grey monolite bar + case SKILL_RANGE_MONO: // 1..1, grey monolite bar value = max = 1; break; default: @@ -21934,7 +21934,7 @@ void Player::_LoadSkills(QueryResult* result) ++count; - if (count >= PLAYER_MAX_SKILLS) // client limit + if (count >= PLAYER_MAX_SKILLS) // client limit { sLog.outError("Character %u has more than %u skills.", GetGUIDLow(), PLAYER_MAX_SKILLS); break; @@ -22068,13 +22068,13 @@ void Player::HandleFall(MovementInfo const& movementInfo) float z_diff = m_lastFallZ - movementInfo.GetPos()->z; DEBUG_LOG("zDiff = %f", z_diff); - //Players with low fall distance, Feather Fall or physical immunity (charges used) are ignored + // Players with low fall distance, Feather Fall or physical immunity (charges used) are ignored // 14.57 can be calculated by resolving damageperc formula below to 0 if (z_diff >= 14.57f && !isDead() && !isGameMaster() && !HasAuraType(SPELL_AURA_HOVER) && !HasAuraType(SPELL_AURA_FEATHER_FALL) && !HasAuraType(SPELL_AURA_FLY) && !IsImmunedToDamage(SPELL_SCHOOL_MASK_NORMAL)) { - //Safe fall, fall height reduction + // Safe fall, fall height reduction int32 safe_fall = GetTotalAuraModifier(SPELL_AURA_SAFE_FALL); float damageperc = 0.018f * (z_diff - safe_fall) - 0.2426f; @@ -22088,7 +22088,7 @@ void Player::HandleFall(MovementInfo const& movementInfo) if (damage > 0) { - //Prevent fall damage from being more than the player maximum health + // Prevent fall damage from being more than the player maximum health if (damage > GetMaxHealth()) damage = GetMaxHealth(); @@ -22104,7 +22104,7 @@ void Player::HandleFall(MovementInfo const& movementInfo) GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING, uint32(z_diff * 100)); } - //Z given by moveinfo, LastZ, FallTime, WaterZ, MapZ, Damage, Safefall reduction + // Z given by moveinfo, LastZ, FallTime, WaterZ, MapZ, Damage, Safefall reduction DEBUG_LOG("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d" , movementInfo.GetPos()->z, height, GetPositionZ(), movementInfo.GetFallTime(), height, damage, safe_fall); } } @@ -22450,7 +22450,7 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket* data) continue; *data << uint32(talent.talentEntry->TalentID); // Talent.dbc - *data << uint8(talent.currentRank); // talentMaxRank (0-4) + *data << uint8(talent.currentRank); // talentMaxRank (0-4) ++talentIdCount; } diff --git a/src/game/Player.h b/src/game/Player.h index bbc35f8e2..885413136 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -179,7 +179,7 @@ enum ActionButtonIndex ACTION_BUTTON_SHAMAN_TOTEMS_BAR = 132, }; -#define MAX_ACTION_BUTTONS 144 //checked in 3.2.0 +#define MAX_ACTION_BUTTONS 144 // checked in 3.2.0 typedef std::map ActionButtonList; @@ -322,7 +322,7 @@ struct Areas }; #define MAX_RUNES 6 -#define RUNE_COOLDOWN (2*5*IN_MILLISECONDS) // msec +#define RUNE_COOLDOWN (2*5*IN_MILLISECONDS) // msec enum RuneType { @@ -1563,7 +1563,7 @@ class MANGOS_DLL_SPEC Player : public Unit void AddMItem(Item* it) { MANGOS_ASSERT(it); - //ASSERT deleted, because items can be added before loading + // ASSERT deleted, because items can be added before loading mMitems[it->GetGUIDLow()] = it; } @@ -1965,7 +1965,7 @@ class MANGOS_DLL_SPEC Player : public Unit uint32 GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot); - //End of PvP System + // End of PvP System void SetDrunkValue(uint16 newDrunkValue, uint32 itemid = 0); uint16 GetDrunkValue() const { return m_drunk; } @@ -2374,7 +2374,7 @@ class MANGOS_DLL_SPEC Player : public Unit /*** QUEST SYSTEM ***/ /*********************************************************/ - //We allow only one timed quest active at the same time. Below can then be simple value instead of set. + // We allow only one timed quest active at the same time. Below can then be simple value instead of set. typedef std::set QuestSet; QuestSet m_timedquests; QuestSet m_weeklyquests; @@ -2546,12 +2546,12 @@ class MANGOS_DLL_SPEC Player : public Unit uint8 m_swingErrorMsg; float m_ammoDPS; - ////////////////////Rest System///////////////////// + //////////////////// Rest System///////////////////// time_t time_inn_enter; uint32 inn_trigger_id; float m_rest_bonus; RestType rest_type; - ////////////////////Rest System///////////////////// + //////////////////// Rest System///////////////////// // Transports Transport* m_transport; diff --git a/src/game/PlayerDump.cpp b/src/game/PlayerDump.cpp index 023608e5a..af14102b1 100644 --- a/src/game/PlayerDump.cpp +++ b/src/game/PlayerDump.cpp @@ -506,7 +506,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s ROLLBACK(DUMP_FILE_BROKEN); } - DumpTableType type = DTT_CHARACTER; //Fixed: Using uninitialized memory 'type' + DumpTableType type = DTT_CHARACTER; // Fixed: Using uninitialized memory 'type' DumpTable* dTable = &dumpTables[0]; for (; dTable->isValid(); ++dTable) { @@ -625,7 +625,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s } case DTT_PET: { - //store a map of old pet id to new inserted pet id for use by type 5 tables + // store a map of old pet id to new inserted pet id for use by type 5 tables snprintf(currpetid, 20, "%s", getnth(line, 1).c_str()); if (strlen(lastpetid) == 0) snprintf(lastpetid, 20, "%s", currpetid); @@ -725,7 +725,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s CharacterDatabase.CommitTransaction(); - //FIXME: current code with post-updating guids not safe for future per-map threads + // FIXME: current code with post-updating guids not safe for future per-map threads sObjectMgr.m_ItemGuids.Set(sObjectMgr.m_ItemGuids.GetNextAfterMaxUsed() + items.size()); sObjectMgr.m_MailIds.Set(sObjectMgr.m_MailIds.GetNextAfterMaxUsed() + mails.size()); sObjectMgr.m_EquipmentSetIds.Set(sObjectMgr.m_EquipmentSetIds.GetNextAfterMaxUsed() + eqsets.size()); diff --git a/src/game/PoolManager.cpp b/src/game/PoolManager.cpp index 3dd3e471c..f80944d2f 100644 --- a/src/game/PoolManager.cpp +++ b/src/game/PoolManager.cpp @@ -389,7 +389,7 @@ void PoolGroup::Spawn1Object(MapPersistentState& mapState, PoolObject* if (dataMap && dataMap->IsLoaded(data->posX, data->posY)) { Creature* pCreature = new Creature; - //DEBUG_LOG("Spawning creature %u",obj->guid); + // DEBUG_LOG("Spawning creature %u",obj->guid); if (!pCreature->LoadFromDB(obj->guid, dataMap)) { delete pCreature; @@ -433,7 +433,7 @@ void PoolGroup::Spawn1Object(MapPersistentState& mapState, PoolObjec if (dataMap && dataMap->IsLoaded(data->posX, data->posY)) { GameObject* pGameobject = new GameObject; - //DEBUG_LOG("Spawning gameobject %u", obj->guid); + // DEBUG_LOG("Spawning gameobject %u", obj->guid); if (!pGameobject->LoadFromDB(obj->guid, dataMap)) { delete pGameobject; diff --git a/src/game/QuestDef.h b/src/game/QuestDef.h index f7e2929eb..fa382dbd2 100644 --- a/src/game/QuestDef.h +++ b/src/game/QuestDef.h @@ -142,7 +142,7 @@ enum QuestFlags QUEST_FLAGS_PARTY_ACCEPT = 0x00000002, // If player in party, all players that can accept this quest will receive confirmation box to accept quest CMSG_QUEST_CONFIRM_ACCEPT/SMSG_QUEST_CONFIRM_ACCEPT QUEST_FLAGS_EXPLORATION = 0x00000004, // Not used currently QUEST_FLAGS_SHARABLE = 0x00000008, // Can be shared: Player::CanShareQuest() - //QUEST_FLAGS_NONE2 = 0x00000010, // Not used currently + // QUEST_FLAGS_NONE2 = 0x00000010, // Not used currently QUEST_FLAGS_EPIC = 0x00000020, // Not used currently - 1 quest in 3.3 QUEST_FLAGS_RAID = 0x00000040, // Not used currently QUEST_FLAGS_TBC = 0x00000080, // Not used currently: Available if TBC expansion enabled only diff --git a/src/game/QuestHandler.cpp b/src/game/QuestHandler.cpp index feba9cf98..82f2e18d5 100644 --- a/src/game/QuestHandler.cpp +++ b/src/game/QuestHandler.cpp @@ -76,7 +76,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket& recv_data) break; } - //inform client about status of quest + // inform client about status of quest _player->PlayerTalkClass->SendQuestGiverStatus(dialogStatus, guid); } @@ -163,14 +163,14 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket& recv_data) { Player* pPlayer = itr->getSource(); - if (!pPlayer || pPlayer == _player) // not self + if (!pPlayer || pPlayer == _player) // not self continue; if (pPlayer->CanTakeQuest(qInfo, true)) { pPlayer->SetDividerGuid(_player->GetObjectGuid()); - //need confirmation that any gossip window will close + // need confirmation that any gossip window will close pPlayer->PlayerTalkClass->CloseGossip(); _player->SendQuestConfirmAccept(qInfo, pPlayer); @@ -522,7 +522,7 @@ uint32 WorldSession::getDialogStatus(Player* pPlayer, Object* questgiver, uint32 break; } default: - //it's impossible, but check ^) + // it's impossible, but check ^) sLog.outError("Warning: GetDialogStatus called for unexpected type %u", questgiver->GetTypeId()); return DIALOG_STATUS_NONE; } diff --git a/src/game/ReputationMgr.cpp b/src/game/ReputationMgr.cpp index 3fb60f278..4ef84ef09 100644 --- a/src/game/ReputationMgr.cpp +++ b/src/game/ReputationMgr.cpp @@ -446,7 +446,7 @@ void ReputationMgr::LoadFromDB(QueryResult* result) // Set initial reputations (so everything is nifty before DB data load) Initialize(); - //QueryResult *result = CharacterDatabase.PQuery("SELECT faction,standing,flags FROM character_reputation WHERE guid = '%u'",GetGUIDLow()); + // QueryResult *result = CharacterDatabase.PQuery("SELECT faction,standing,flags FROM character_reputation WHERE guid = '%u'",GetGUIDLow()); if (result) { diff --git a/src/game/ScriptMgr.cpp b/src/game/ScriptMgr.cpp index fb06cea71..857fcca5d 100644 --- a/src/game/ScriptMgr.cpp +++ b/src/game/ScriptMgr.cpp @@ -1286,10 +1286,10 @@ void ScriptAction::HandleScriptStep() } if (pGo->isSpawned()) - break; //gameobject already spawned + break; // gameobject already spawned pGo->SetLootState(GO_READY); - pGo->SetRespawnTime(time_to_despawn); //despawn object in ? seconds + pGo->SetRespawnTime(time_to_despawn); // despawn object in ? seconds pGo->Refresh(); break; } @@ -1386,7 +1386,7 @@ void ScriptAction::HandleScriptStep() if (LogIfNotUnit(pTarget)) break; - //TODO: when GO cast implemented, code below must be updated accordingly to also allow GO spell cast + // TODO: when GO cast implemented, code below must be updated accordingly to also allow GO spell cast ((Unit*)pSource)->CastSpell(((Unit*)pTarget), m_script->castSpell.spellId, (m_script->data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL) != 0); break; diff --git a/src/game/ScriptMgr.h b/src/game/ScriptMgr.h index 3fed156c1..9927a9aec 100644 --- a/src/game/ScriptMgr.h +++ b/src/game/ScriptMgr.h @@ -487,7 +487,7 @@ class ScriptMgr ScriptNameMap m_scriptNames; MANGOS_LIBRARY_HANDLE m_hScriptLib; - //atomic op counter for active scripts amount + // atomic op counter for active scripts amount ACE_Atomic_Op m_scheduledScripts; void (MANGOS_IMPORT* m_pOnInitScriptLibrary)(); diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 352fe028e..e90c3e893 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -203,13 +203,13 @@ inline SpellSchools GetFirstSchoolInMask(SpellSchoolMask mask) enum ItemQualities { - ITEM_QUALITY_POOR = 0, //GREY - ITEM_QUALITY_NORMAL = 1, //WHITE - ITEM_QUALITY_UNCOMMON = 2, //GREEN - ITEM_QUALITY_RARE = 3, //BLUE - ITEM_QUALITY_EPIC = 4, //PURPLE - ITEM_QUALITY_LEGENDARY = 5, //ORANGE - ITEM_QUALITY_ARTIFACT = 6, //LIGHT YELLOW + ITEM_QUALITY_POOR = 0, // GREY + ITEM_QUALITY_NORMAL = 1, // WHITE + ITEM_QUALITY_UNCOMMON = 2, // GREEN + ITEM_QUALITY_RARE = 3, // BLUE + ITEM_QUALITY_EPIC = 4, // PURPLE + ITEM_QUALITY_LEGENDARY = 5, // ORANGE + ITEM_QUALITY_ARTIFACT = 6, // LIGHT YELLOW ITEM_QUALITY_HEIRLOOM = 7 }; @@ -217,14 +217,14 @@ enum ItemQualities const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = { - 0xff9d9d9d, //GREY - 0xffffffff, //WHITE - 0xff1eff00, //GREEN - 0xff0070dd, //BLUE - 0xffa335ee, //PURPLE - 0xffff8000, //ORANGE - 0xffe6cc80, //LIGHT YELLOW - 0xffe6cc80 //LIGHT YELLOW + 0xff9d9d9d, // GREY + 0xffffffff, // WHITE + 0xff1eff00, // GREEN + 0xff0070dd, // BLUE + 0xffa335ee, // PURPLE + 0xffff8000, // ORANGE + 0xffe6cc80, // LIGHT YELLOW + 0xffe6cc80 // LIGHT YELLOW }; // *********************************** @@ -233,290 +233,290 @@ const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = enum SpellAttributes { - SPELL_ATTR_UNK0 = 0x00000001, // 0 - SPELL_ATTR_RANGED = 0x00000002, // 1 All ranged abilites have this flag - SPELL_ATTR_ON_NEXT_SWING_1 = 0x00000004, // 2 on next swing - SPELL_ATTR_UNK3 = 0x00000008, // 3 not set in 3.0.3 - SPELL_ATTR_UNK4 = 0x00000010, // 4 isAbility - SPELL_ATTR_TRADESPELL = 0x00000020, // 5 trade spells, will be added by client to a sublist of profession spell - SPELL_ATTR_PASSIVE = 0x00000040, // 6 Passive spell - SPELL_ATTR_UNK7 = 0x00000080, // 7 can't be linked in chat? - SPELL_ATTR_UNK8 = 0x00000100, // 8 hide created item in tooltip (for effect=24) - SPELL_ATTR_UNK9 = 0x00000200, // 9 - SPELL_ATTR_ON_NEXT_SWING_2 = 0x00000400, // 10 on next swing 2 - SPELL_ATTR_UNK11 = 0x00000800, // 11 - SPELL_ATTR_DAYTIME_ONLY = 0x00001000, // 12 only useable at daytime, not set in 2.4.2 - SPELL_ATTR_NIGHT_ONLY = 0x00002000, // 13 only useable at night, not set in 2.4.2 - SPELL_ATTR_INDOORS_ONLY = 0x00004000, // 14 only useable indoors, not set in 2.4.2 - SPELL_ATTR_OUTDOORS_ONLY = 0x00008000, // 15 Only useable outdoors. - SPELL_ATTR_NOT_SHAPESHIFT = 0x00010000, // 16 Not while shapeshifted - SPELL_ATTR_ONLY_STEALTHED = 0x00020000, // 17 Must be in stealth - SPELL_ATTR_UNK18 = 0x00040000, // 18 - SPELL_ATTR_LEVEL_DAMAGE_CALCULATION = 0x00080000, // 19 spelldamage depends on caster level - SPELL_ATTR_STOP_ATTACK_TARGET = 0x00100000, // 20 Stop attack after use this spell (and not begin attack if use) - SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK = 0x00200000, // 21 Cannot be dodged/parried/blocked - SPELL_ATTR_SET_TRACKING_TARGET = 0x00400000, // 22 SetTrackingTarget - SPELL_ATTR_UNK23 = 0x00800000, // 23 castable while dead? - SPELL_ATTR_CASTABLE_WHILE_MOUNTED = 0x01000000, // 24 castable while mounted - SPELL_ATTR_DISABLED_WHILE_ACTIVE = 0x02000000, // 25 Activate and start cooldown after aura fade or remove summoned creature or go - SPELL_ATTR_UNK26 = 0x04000000, // 26 - SPELL_ATTR_CASTABLE_WHILE_SITTING = 0x08000000, // 27 castable while sitting - SPELL_ATTR_CANT_USED_IN_COMBAT = 0x10000000, // 28 Cannot be used in combat - SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY = 0x20000000, // 29 unaffected by invulnerability (hmm possible not...) - SPELL_ATTR_UNK30 = 0x40000000, // 30 breakable by damage? - SPELL_ATTR_CANT_CANCEL = 0x80000000, // 31 positive aura can't be canceled + SPELL_ATTR_UNK0 = 0x00000001,// 0 + SPELL_ATTR_RANGED = 0x00000002,// 1 All ranged abilites have this flag + SPELL_ATTR_ON_NEXT_SWING_1 = 0x00000004,// 2 on next swing + SPELL_ATTR_UNK3 = 0x00000008,// 3 not set in 3.0.3 + SPELL_ATTR_UNK4 = 0x00000010,// 4 isAbility + SPELL_ATTR_TRADESPELL = 0x00000020,// 5 trade spells, will be added by client to a sublist of profession spell + SPELL_ATTR_PASSIVE = 0x00000040,// 6 Passive spell + SPELL_ATTR_UNK7 = 0x00000080,// 7 can't be linked in chat? + SPELL_ATTR_UNK8 = 0x00000100,// 8 hide created item in tooltip (for effect=24) + SPELL_ATTR_UNK9 = 0x00000200,// 9 + SPELL_ATTR_ON_NEXT_SWING_2 = 0x00000400,// 10 on next swing 2 + SPELL_ATTR_UNK11 = 0x00000800,// 11 + SPELL_ATTR_DAYTIME_ONLY = 0x00001000,// 12 only useable at daytime, not set in 2.4.2 + SPELL_ATTR_NIGHT_ONLY = 0x00002000,// 13 only useable at night, not set in 2.4.2 + SPELL_ATTR_INDOORS_ONLY = 0x00004000,// 14 only useable indoors, not set in 2.4.2 + SPELL_ATTR_OUTDOORS_ONLY = 0x00008000,// 15 Only useable outdoors. + SPELL_ATTR_NOT_SHAPESHIFT = 0x00010000,// 16 Not while shapeshifted + SPELL_ATTR_ONLY_STEALTHED = 0x00020000,// 17 Must be in stealth + SPELL_ATTR_UNK18 = 0x00040000,// 18 + SPELL_ATTR_LEVEL_DAMAGE_CALCULATION = 0x00080000,// 19 spelldamage depends on caster level + SPELL_ATTR_STOP_ATTACK_TARGET = 0x00100000,// 20 Stop attack after use this spell (and not begin attack if use) + SPELL_ATTR_IMPOSSIBLE_DODGE_PARRY_BLOCK = 0x00200000,// 21 Cannot be dodged/parried/blocked + SPELL_ATTR_SET_TRACKING_TARGET = 0x00400000,// 22 SetTrackingTarget + SPELL_ATTR_UNK23 = 0x00800000,// 23 castable while dead? + SPELL_ATTR_CASTABLE_WHILE_MOUNTED = 0x01000000,// 24 castable while mounted + SPELL_ATTR_DISABLED_WHILE_ACTIVE = 0x02000000,// 25 Activate and start cooldown after aura fade or remove summoned creature or go + SPELL_ATTR_UNK26 = 0x04000000,// 26 + SPELL_ATTR_CASTABLE_WHILE_SITTING = 0x08000000,// 27 castable while sitting + SPELL_ATTR_CANT_USED_IN_COMBAT = 0x10000000,// 28 Cannot be used in combat + SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY = 0x20000000,// 29 unaffected by invulnerability (hmm possible not...) + SPELL_ATTR_UNK30 = 0x40000000,// 30 breakable by damage? + SPELL_ATTR_CANT_CANCEL = 0x80000000,// 31 positive aura can't be canceled }; enum SpellAttributesEx { - SPELL_ATTR_EX_UNK0 = 0x00000001, // 0 - SPELL_ATTR_EX_DRAIN_ALL_POWER = 0x00000002, // 1 use all power (Only paladin Lay of Hands and Bunyanize) - SPELL_ATTR_EX_CHANNELED_1 = 0x00000004, // 2 channeled 1 - SPELL_ATTR_EX_UNK3 = 0x00000008, // 3 - SPELL_ATTR_EX_UNK4 = 0x00000010, // 4 - SPELL_ATTR_EX_NOT_BREAK_STEALTH = 0x00000020, // 5 Not break stealth - SPELL_ATTR_EX_CHANNELED_2 = 0x00000040, // 6 channeled 2 - SPELL_ATTR_EX_NEGATIVE = 0x00000080, // 7 - SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET = 0x00000100, // 8 Spell req target not to be in combat state - SPELL_ATTR_EX_UNK9 = 0x00000200, // 9 - SPELL_ATTR_EX_NO_THREAT = 0x00000400, // 10 no generates threat on cast 100% - SPELL_ATTR_EX_UNK11 = 0x00000800, // 11 - SPELL_ATTR_EX_UNK12 = 0x00001000, // 12 - SPELL_ATTR_EX_FARSIGHT = 0x00002000, // 13 related to farsight - SPELL_ATTR_EX_UNK14 = 0x00004000, // 14 - SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY = 0x00008000, // 15 remove auras on immunity - SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE = 0x00010000, // 16 unaffected by school immunity - SPELL_ATTR_EX_UNK17 = 0x00020000, // 17 for auras SPELL_AURA_TRACK_CREATURES, SPELL_AURA_TRACK_RESOURCES and SPELL_AURA_TRACK_STEALTHED select non-stacking tracking spells - SPELL_ATTR_EX_UNK18 = 0x00040000, // 18 - SPELL_ATTR_EX_UNK19 = 0x00080000, // 19 - SPELL_ATTR_EX_REQ_TARGET_COMBO_POINTS = 0x00100000, // 20 Req combo points on target - SPELL_ATTR_EX_UNK21 = 0x00200000, // 21 - SPELL_ATTR_EX_REQ_COMBO_POINTS = 0x00400000, // 22 Use combo points (in 4.x not required combo point target selected) - SPELL_ATTR_EX_UNK23 = 0x00800000, // 23 - SPELL_ATTR_EX_UNK24 = 0x01000000, // 24 Req fishing pole?? - SPELL_ATTR_EX_UNK25 = 0x02000000, // 25 - SPELL_ATTR_EX_UNK26 = 0x04000000, // 26 - SPELL_ATTR_EX_UNK27 = 0x08000000, // 27 - SPELL_ATTR_EX_UNK28 = 0x10000000, // 28 - SPELL_ATTR_EX_UNK29 = 0x20000000, // 29 - SPELL_ATTR_EX_UNK30 = 0x40000000, // 30 overpower - SPELL_ATTR_EX_UNK31 = 0x80000000, // 31 + SPELL_ATTR_EX_UNK0 = 0x00000001,// 0 + SPELL_ATTR_EX_DRAIN_ALL_POWER = 0x00000002,// 1 use all power (Only paladin Lay of Hands and Bunyanize) + SPELL_ATTR_EX_CHANNELED_1 = 0x00000004,// 2 channeled 1 + SPELL_ATTR_EX_UNK3 = 0x00000008,// 3 + SPELL_ATTR_EX_UNK4 = 0x00000010,// 4 + SPELL_ATTR_EX_NOT_BREAK_STEALTH = 0x00000020,// 5 Not break stealth + SPELL_ATTR_EX_CHANNELED_2 = 0x00000040,// 6 channeled 2 + SPELL_ATTR_EX_NEGATIVE = 0x00000080,// 7 + SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET = 0x00000100,// 8 Spell req target not to be in combat state + SPELL_ATTR_EX_UNK9 = 0x00000200,// 9 + SPELL_ATTR_EX_NO_THREAT = 0x00000400,// 10 no generates threat on cast 100% + SPELL_ATTR_EX_UNK11 = 0x00000800,// 11 + SPELL_ATTR_EX_UNK12 = 0x00001000,// 12 + SPELL_ATTR_EX_FARSIGHT = 0x00002000,// 13 related to farsight + SPELL_ATTR_EX_UNK14 = 0x00004000,// 14 + SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY = 0x00008000,// 15 remove auras on immunity + SPELL_ATTR_EX_UNAFFECTED_BY_SCHOOL_IMMUNE = 0x00010000,// 16 unaffected by school immunity + SPELL_ATTR_EX_UNK17 = 0x00020000,// 17 for auras SPELL_AURA_TRACK_CREATURES, SPELL_AURA_TRACK_RESOURCES and SPELL_AURA_TRACK_STEALTHED select non-stacking tracking spells + SPELL_ATTR_EX_UNK18 = 0x00040000,// 18 + SPELL_ATTR_EX_UNK19 = 0x00080000,// 19 + SPELL_ATTR_EX_REQ_TARGET_COMBO_POINTS = 0x00100000,// 20 Req combo points on target + SPELL_ATTR_EX_UNK21 = 0x00200000,// 21 + SPELL_ATTR_EX_REQ_COMBO_POINTS = 0x00400000,// 22 Use combo points (in 4.x not required combo point target selected) + SPELL_ATTR_EX_UNK23 = 0x00800000,// 23 + SPELL_ATTR_EX_UNK24 = 0x01000000,// 24 Req fishing pole?? + SPELL_ATTR_EX_UNK25 = 0x02000000,// 25 + SPELL_ATTR_EX_UNK26 = 0x04000000,// 26 + SPELL_ATTR_EX_UNK27 = 0x08000000,// 27 + SPELL_ATTR_EX_UNK28 = 0x10000000,// 28 + SPELL_ATTR_EX_UNK29 = 0x20000000,// 29 + SPELL_ATTR_EX_UNK30 = 0x40000000,// 30 overpower + SPELL_ATTR_EX_UNK31 = 0x80000000,// 31 }; enum SpellAttributesEx2 { - SPELL_ATTR_EX2_UNK0 = 0x00000001, // 0 - SPELL_ATTR_EX2_UNK1 = 0x00000002, // 1 - SPELL_ATTR_EX2_CANT_REFLECTED = 0x00000004, // 2 ? used for detect can or not spell reflected // do not need LOS (e.g. 18220 since 3.3.3) - SPELL_ATTR_EX2_UNK3 = 0x00000008, // 3 auto targeting? (e.g. fishing skill enhancement items since 3.3.3) - SPELL_ATTR_EX2_UNK4 = 0x00000010, // 4 - SPELL_ATTR_EX2_AUTOREPEAT_FLAG = 0x00000020, // 5 - SPELL_ATTR_EX2_UNK6 = 0x00000040, // 6 only usable on tabbed by yourself - SPELL_ATTR_EX2_UNK7 = 0x00000080, // 7 - SPELL_ATTR_EX2_UNK8 = 0x00000100, // 8 not set in 3.0.3 - SPELL_ATTR_EX2_UNK9 = 0x00000200, // 9 - SPELL_ATTR_EX2_UNK10 = 0x00000400, // 10 - SPELL_ATTR_EX2_HEALTH_FUNNEL = 0x00000800, // 11 - SPELL_ATTR_EX2_UNK12 = 0x00001000, // 12 - SPELL_ATTR_EX2_UNK13 = 0x00002000, // 13 - SPELL_ATTR_EX2_UNK14 = 0x00004000, // 14 - SPELL_ATTR_EX2_UNK15 = 0x00008000, // 15 not set in 3.0.3 - SPELL_ATTR_EX2_UNK16 = 0x00010000, // 16 - SPELL_ATTR_EX2_UNK17 = 0x00020000, // 17 suspend weapon timer instead of resetting it, (?Hunters Shot and Stings only have this flag?) - SPELL_ATTR_EX2_UNK18 = 0x00040000, // 18 Only Revive pet - possible req dead pet - SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT = 0x00080000, // 19 does not necessarly need shapeshift - SPELL_ATTR_EX2_UNK20 = 0x00100000, // 20 - SPELL_ATTR_EX2_DAMAGE_REDUCED_SHIELD = 0x00200000, // 21 for ice blocks, pala immunity buffs, priest absorb shields, but used also for other spells -> not sure! - SPELL_ATTR_EX2_UNK22 = 0x00400000, // 22 - SPELL_ATTR_EX2_UNK23 = 0x00800000, // 23 Only mage Arcane Concentration have this flag - SPELL_ATTR_EX2_UNK24 = 0x01000000, // 24 - SPELL_ATTR_EX2_UNK25 = 0x02000000, // 25 - SPELL_ATTR_EX2_UNK26 = 0x04000000, // 26 unaffected by school immunity - SPELL_ATTR_EX2_UNK27 = 0x08000000, // 27 - SPELL_ATTR_EX2_UNK28 = 0x10000000, // 28 no breaks stealth if it fails?? - SPELL_ATTR_EX2_CANT_CRIT = 0x20000000, // 29 Spell can't crit - SPELL_ATTR_EX2_UNK30 = 0x40000000, // 30 - SPELL_ATTR_EX2_FOOD_BUFF = 0x80000000, // 31 Food or Drink Buff (like Well Fed) + SPELL_ATTR_EX2_UNK0 = 0x00000001,// 0 + SPELL_ATTR_EX2_UNK1 = 0x00000002,// 1 + SPELL_ATTR_EX2_CANT_REFLECTED = 0x00000004,// 2 ? used for detect can or not spell reflected // do not need LOS (e.g. 18220 since 3.3.3) + SPELL_ATTR_EX2_UNK3 = 0x00000008,// 3 auto targeting? (e.g. fishing skill enhancement items since 3.3.3) + SPELL_ATTR_EX2_UNK4 = 0x00000010,// 4 + SPELL_ATTR_EX2_AUTOREPEAT_FLAG = 0x00000020,// 5 + SPELL_ATTR_EX2_UNK6 = 0x00000040,// 6 only usable on tabbed by yourself + SPELL_ATTR_EX2_UNK7 = 0x00000080,// 7 + SPELL_ATTR_EX2_UNK8 = 0x00000100,// 8 not set in 3.0.3 + SPELL_ATTR_EX2_UNK9 = 0x00000200,// 9 + SPELL_ATTR_EX2_UNK10 = 0x00000400,// 10 + SPELL_ATTR_EX2_HEALTH_FUNNEL = 0x00000800,// 11 + SPELL_ATTR_EX2_UNK12 = 0x00001000,// 12 + SPELL_ATTR_EX2_UNK13 = 0x00002000,// 13 + SPELL_ATTR_EX2_UNK14 = 0x00004000,// 14 + SPELL_ATTR_EX2_UNK15 = 0x00008000,// 15 not set in 3.0.3 + SPELL_ATTR_EX2_UNK16 = 0x00010000,// 16 + SPELL_ATTR_EX2_UNK17 = 0x00020000,// 17 suspend weapon timer instead of resetting it, (?Hunters Shot and Stings only have this flag?) + SPELL_ATTR_EX2_UNK18 = 0x00040000,// 18 Only Revive pet - possible req dead pet + SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT = 0x00080000,// 19 does not necessarly need shapeshift + SPELL_ATTR_EX2_UNK20 = 0x00100000,// 20 + SPELL_ATTR_EX2_DAMAGE_REDUCED_SHIELD = 0x00200000,// 21 for ice blocks, pala immunity buffs, priest absorb shields, but used also for other spells -> not sure! + SPELL_ATTR_EX2_UNK22 = 0x00400000,// 22 + SPELL_ATTR_EX2_UNK23 = 0x00800000,// 23 Only mage Arcane Concentration have this flag + SPELL_ATTR_EX2_UNK24 = 0x01000000,// 24 + SPELL_ATTR_EX2_UNK25 = 0x02000000,// 25 + SPELL_ATTR_EX2_UNK26 = 0x04000000,// 26 unaffected by school immunity + SPELL_ATTR_EX2_UNK27 = 0x08000000,// 27 + SPELL_ATTR_EX2_UNK28 = 0x10000000,// 28 no breaks stealth if it fails?? + SPELL_ATTR_EX2_CANT_CRIT = 0x20000000,// 29 Spell can't crit + SPELL_ATTR_EX2_UNK30 = 0x40000000,// 30 + SPELL_ATTR_EX2_FOOD_BUFF = 0x80000000,// 31 Food or Drink Buff (like Well Fed) }; enum SpellAttributesEx3 { - SPELL_ATTR_EX3_UNK0 = 0x00000001, // 0 - SPELL_ATTR_EX3_UNK1 = 0x00000002, // 1 - SPELL_ATTR_EX3_UNK2 = 0x00000004, // 2 - SPELL_ATTR_EX3_UNK3 = 0x00000008, // 3 - SPELL_ATTR_EX3_UNK4 = 0x00000010, // 4 Druid Rebirth only this spell have this flag - SPELL_ATTR_EX3_UNK5 = 0x00000020, // 5 - SPELL_ATTR_EX3_UNK6 = 0x00000040, // 6 - SPELL_ATTR_EX3_UNK7 = 0x00000080, // 7 create a separate (de)buff stack for each caster - SPELL_ATTR_EX3_UNK8 = 0x00000100, // 8 - SPELL_ATTR_EX3_UNK9 = 0x00000200, // 9 - SPELL_ATTR_EX3_MAIN_HAND = 0x00000400, // 10 Main hand weapon required - SPELL_ATTR_EX3_BATTLEGROUND = 0x00000800, // 11 Can casted only on battleground - SPELL_ATTR_EX3_CAST_ON_DEAD = 0x00001000, // 12 target is a dead player (not every spell has this flag) - SPELL_ATTR_EX3_UNK13 = 0x00002000, // 13 - SPELL_ATTR_EX3_UNK14 = 0x00004000, // 14 "Honorless Target" only this spells have this flag - SPELL_ATTR_EX3_UNK15 = 0x00008000, // 15 Auto Shoot, Shoot, Throw, - this is autoshot flag - SPELL_ATTR_EX3_UNK16 = 0x00010000, // 16 no triggers effects that trigger on casting a spell?? - SPELL_ATTR_EX3_NO_INITIAL_AGGRO = 0x00020000, // 17 Causes no aggro if not missed - SPELL_ATTR_EX3_CANT_MISS = 0x00040000, // 18 Spell should always hit its target - SPELL_ATTR_EX3_UNK19 = 0x00080000, // 19 - SPELL_ATTR_EX3_DEATH_PERSISTENT = 0x00100000, // 20 Death persistent spells - SPELL_ATTR_EX3_UNK21 = 0x00200000, // 21 - SPELL_ATTR_EX3_REQ_WAND = 0x00400000, // 22 Req wand - SPELL_ATTR_EX3_UNK23 = 0x00800000, // 23 - SPELL_ATTR_EX3_REQ_OFFHAND = 0x01000000, // 24 Req offhand weapon - SPELL_ATTR_EX3_UNK25 = 0x02000000, // 25 no cause spell pushback ? - SPELL_ATTR_EX3_UNK26 = 0x04000000, // 26 - SPELL_ATTR_EX3_UNK27 = 0x08000000, // 27 - SPELL_ATTR_EX3_UNK28 = 0x10000000, // 28 - SPELL_ATTR_EX3_UNK29 = 0x20000000, // 29 - SPELL_ATTR_EX3_UNK30 = 0x40000000, // 30 - SPELL_ATTR_EX3_UNK31 = 0x80000000, // 31 + SPELL_ATTR_EX3_UNK0 = 0x00000001,// 0 + SPELL_ATTR_EX3_UNK1 = 0x00000002,// 1 + SPELL_ATTR_EX3_UNK2 = 0x00000004,// 2 + SPELL_ATTR_EX3_UNK3 = 0x00000008,// 3 + SPELL_ATTR_EX3_UNK4 = 0x00000010,// 4 Druid Rebirth only this spell have this flag + SPELL_ATTR_EX3_UNK5 = 0x00000020,// 5 + SPELL_ATTR_EX3_UNK6 = 0x00000040,// 6 + SPELL_ATTR_EX3_UNK7 = 0x00000080,// 7 create a separate (de)buff stack for each caster + SPELL_ATTR_EX3_UNK8 = 0x00000100,// 8 + SPELL_ATTR_EX3_UNK9 = 0x00000200,// 9 + SPELL_ATTR_EX3_MAIN_HAND = 0x00000400,// 10 Main hand weapon required + SPELL_ATTR_EX3_BATTLEGROUND = 0x00000800,// 11 Can casted only on battleground + SPELL_ATTR_EX3_CAST_ON_DEAD = 0x00001000,// 12 target is a dead player (not every spell has this flag) + SPELL_ATTR_EX3_UNK13 = 0x00002000,// 13 + SPELL_ATTR_EX3_UNK14 = 0x00004000,// 14 "Honorless Target" only this spells have this flag + SPELL_ATTR_EX3_UNK15 = 0x00008000,// 15 Auto Shoot, Shoot, Throw, - this is autoshot flag + SPELL_ATTR_EX3_UNK16 = 0x00010000,// 16 no triggers effects that trigger on casting a spell?? + SPELL_ATTR_EX3_NO_INITIAL_AGGRO = 0x00020000,// 17 Causes no aggro if not missed + SPELL_ATTR_EX3_CANT_MISS = 0x00040000,// 18 Spell should always hit its target + SPELL_ATTR_EX3_UNK19 = 0x00080000,// 19 + SPELL_ATTR_EX3_DEATH_PERSISTENT = 0x00100000,// 20 Death persistent spells + SPELL_ATTR_EX3_UNK21 = 0x00200000,// 21 + SPELL_ATTR_EX3_REQ_WAND = 0x00400000,// 22 Req wand + SPELL_ATTR_EX3_UNK23 = 0x00800000,// 23 + SPELL_ATTR_EX3_REQ_OFFHAND = 0x01000000,// 24 Req offhand weapon + SPELL_ATTR_EX3_UNK25 = 0x02000000,// 25 no cause spell pushback ? + SPELL_ATTR_EX3_UNK26 = 0x04000000,// 26 + SPELL_ATTR_EX3_UNK27 = 0x08000000,// 27 + SPELL_ATTR_EX3_UNK28 = 0x10000000,// 28 + SPELL_ATTR_EX3_UNK29 = 0x20000000,// 29 + SPELL_ATTR_EX3_UNK30 = 0x40000000,// 30 + SPELL_ATTR_EX3_UNK31 = 0x80000000,// 31 }; enum SpellAttributesEx4 { - SPELL_ATTR_EX4_UNK0 = 0x00000001, // 0 - SPELL_ATTR_EX4_UNK1 = 0x00000002, // 1 proc on finishing move? - SPELL_ATTR_EX4_UNK2 = 0x00000004, // 2 - SPELL_ATTR_EX4_UNK3 = 0x00000008, // 3 - SPELL_ATTR_EX4_UNK4 = 0x00000010, // 4 This will no longer cause guards to attack on use?? - SPELL_ATTR_EX4_UNK5 = 0x00000020, // 5 - SPELL_ATTR_EX4_NOT_STEALABLE = 0x00000040, // 6 although such auras might be dispellable, they cannot be stolen - SPELL_ATTR_EX4_UNK7 = 0x00000080, // 7 - SPELL_ATTR_EX4_STACK_DOT_MODIFIER = 0x00000100, // 8 no effect on non DoTs? - SPELL_ATTR_EX4_UNK9 = 0x00000200, // 9 - SPELL_ATTR_EX4_SPELL_VS_EXTEND_COST = 0x00000400, // 10 Rogue Shiv have this flag - SPELL_ATTR_EX4_UNK11 = 0x00000800, // 11 - SPELL_ATTR_EX4_UNK12 = 0x00001000, // 12 - SPELL_ATTR_EX4_UNK13 = 0x00002000, // 13 - SPELL_ATTR_EX4_UNK14 = 0x00004000, // 14 - SPELL_ATTR_EX4_UNK15 = 0x00008000, // 15 - SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA = 0x00010000, // 16 not usable in arena - SPELL_ATTR_EX4_USABLE_IN_ARENA = 0x00020000, // 17 usable in arena - SPELL_ATTR_EX4_UNK18 = 0x00040000, // 18 - SPELL_ATTR_EX4_UNK19 = 0x00080000, // 19 - SPELL_ATTR_EX4_UNK20 = 0x00100000, // 20 do not give "more powerful spell" error message - SPELL_ATTR_EX4_UNK21 = 0x00200000, // 21 - SPELL_ATTR_EX4_UNK22 = 0x00400000, // 22 - SPELL_ATTR_EX4_UNK23 = 0x00800000, // 23 - SPELL_ATTR_EX4_UNK24 = 0x01000000, // 24 - SPELL_ATTR_EX4_UNK25 = 0x02000000, // 25 pet scaling auras - SPELL_ATTR_EX4_CAST_ONLY_IN_OUTLAND = 0x04000000, // 26 Can only be used in Outland. - SPELL_ATTR_EX4_UNK27 = 0x08000000, // 27 - SPELL_ATTR_EX4_UNK28 = 0x10000000, // 28 - SPELL_ATTR_EX4_UNK29 = 0x20000000, // 29 - SPELL_ATTR_EX4_UNK30 = 0x40000000, // 30 - SPELL_ATTR_EX4_UNK31 = 0x80000000, // 31 + SPELL_ATTR_EX4_UNK0 = 0x00000001,// 0 + SPELL_ATTR_EX4_UNK1 = 0x00000002,// 1 proc on finishing move? + SPELL_ATTR_EX4_UNK2 = 0x00000004,// 2 + SPELL_ATTR_EX4_UNK3 = 0x00000008,// 3 + SPELL_ATTR_EX4_UNK4 = 0x00000010,// 4 This will no longer cause guards to attack on use?? + SPELL_ATTR_EX4_UNK5 = 0x00000020,// 5 + SPELL_ATTR_EX4_NOT_STEALABLE = 0x00000040,// 6 although such auras might be dispellable, they cannot be stolen + SPELL_ATTR_EX4_UNK7 = 0x00000080,// 7 + SPELL_ATTR_EX4_STACK_DOT_MODIFIER = 0x00000100,// 8 no effect on non DoTs? + SPELL_ATTR_EX4_UNK9 = 0x00000200,// 9 + SPELL_ATTR_EX4_SPELL_VS_EXTEND_COST = 0x00000400,// 10 Rogue Shiv have this flag + SPELL_ATTR_EX4_UNK11 = 0x00000800,// 11 + SPELL_ATTR_EX4_UNK12 = 0x00001000,// 12 + SPELL_ATTR_EX4_UNK13 = 0x00002000,// 13 + SPELL_ATTR_EX4_UNK14 = 0x00004000,// 14 + SPELL_ATTR_EX4_UNK15 = 0x00008000,// 15 + SPELL_ATTR_EX4_NOT_USABLE_IN_ARENA = 0x00010000,// 16 not usable in arena + SPELL_ATTR_EX4_USABLE_IN_ARENA = 0x00020000,// 17 usable in arena + SPELL_ATTR_EX4_UNK18 = 0x00040000,// 18 + SPELL_ATTR_EX4_UNK19 = 0x00080000,// 19 + SPELL_ATTR_EX4_UNK20 = 0x00100000,// 20 do not give "more powerful spell" error message + SPELL_ATTR_EX4_UNK21 = 0x00200000,// 21 + SPELL_ATTR_EX4_UNK22 = 0x00400000,// 22 + SPELL_ATTR_EX4_UNK23 = 0x00800000,// 23 + SPELL_ATTR_EX4_UNK24 = 0x01000000,// 24 + SPELL_ATTR_EX4_UNK25 = 0x02000000,// 25 pet scaling auras + SPELL_ATTR_EX4_CAST_ONLY_IN_OUTLAND = 0x04000000,// 26 Can only be used in Outland. + SPELL_ATTR_EX4_UNK27 = 0x08000000,// 27 + SPELL_ATTR_EX4_UNK28 = 0x10000000,// 28 + SPELL_ATTR_EX4_UNK29 = 0x20000000,// 29 + SPELL_ATTR_EX4_UNK30 = 0x40000000,// 30 + SPELL_ATTR_EX4_UNK31 = 0x80000000,// 31 }; enum SpellAttributesEx5 { - SPELL_ATTR_EX5_UNK0 = 0x00000001, // 0 - SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP = 0x00000002, // 1 not need reagents if UNIT_FLAG_PREPARATION - SPELL_ATTR_EX5_UNK2 = 0x00000004, // 2 removed at enter arena (e.g. 31850 since 3.3.3) - SPELL_ATTR_EX5_USABLE_WHILE_STUNNED = 0x00000008, // 3 usable while stunned - SPELL_ATTR_EX5_UNK4 = 0x00000010, // 4 - SPELL_ATTR_EX5_SINGLE_TARGET_SPELL = 0x00000020, // 5 Only one target can be apply at a time - SPELL_ATTR_EX5_UNK6 = 0x00000040, // 6 - SPELL_ATTR_EX5_UNK7 = 0x00000080, // 7 - SPELL_ATTR_EX5_UNK8 = 0x00000100, // 8 - SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY = 0x00000200, // 9 begin periodic tick at aura apply - SPELL_ATTR_EX5_UNK10 = 0x00000400, // 10 - SPELL_ATTR_EX5_UNK11 = 0x00000800, // 11 - SPELL_ATTR_EX5_UNK12 = 0x00001000, // 12 - SPELL_ATTR_EX5_UNK13 = 0x00002000, // 13 haste affects duration (e.g. 8050 since 3.3.3) - SPELL_ATTR_EX5_UNK14 = 0x00004000, // 14 - SPELL_ATTR_EX5_UNK15 = 0x00008000, // 15 - SPELL_ATTR_EX5_UNK16 = 0x00010000, // 16 - SPELL_ATTR_EX5_USABLE_WHILE_FEARED = 0x00020000, // 17 usable while feared - SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED = 0x00040000, // 18 usable while confused - SPELL_ATTR_EX5_UNK19 = 0x00080000, // 19 - SPELL_ATTR_EX5_UNK20 = 0x00100000, // 20 - SPELL_ATTR_EX5_UNK21 = 0x00200000, // 21 - SPELL_ATTR_EX5_UNK22 = 0x00400000, // 22 - SPELL_ATTR_EX5_UNK23 = 0x00800000, // 23 - SPELL_ATTR_EX5_UNK24 = 0x01000000, // 24 - SPELL_ATTR_EX5_UNK25 = 0x02000000, // 25 - SPELL_ATTR_EX5_UNK26 = 0x04000000, // 26 - SPELL_ATTR_EX5_UNK27 = 0x08000000, // 27 - SPELL_ATTR_EX5_UNK28 = 0x10000000, // 28 - SPELL_ATTR_EX5_UNK29 = 0x20000000, // 29 - SPELL_ATTR_EX5_UNK30 = 0x40000000, // 30 - SPELL_ATTR_EX5_UNK31 = 0x80000000, // 31 Forces all nearby enemies to focus attacks caster + SPELL_ATTR_EX5_UNK0 = 0x00000001,// 0 + SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP = 0x00000002,// 1 not need reagents if UNIT_FLAG_PREPARATION + SPELL_ATTR_EX5_UNK2 = 0x00000004,// 2 removed at enter arena (e.g. 31850 since 3.3.3) + SPELL_ATTR_EX5_USABLE_WHILE_STUNNED = 0x00000008,// 3 usable while stunned + SPELL_ATTR_EX5_UNK4 = 0x00000010,// 4 + SPELL_ATTR_EX5_SINGLE_TARGET_SPELL = 0x00000020,// 5 Only one target can be apply at a time + SPELL_ATTR_EX5_UNK6 = 0x00000040,// 6 + SPELL_ATTR_EX5_UNK7 = 0x00000080,// 7 + SPELL_ATTR_EX5_UNK8 = 0x00000100,// 8 + SPELL_ATTR_EX5_START_PERIODIC_AT_APPLY = 0x00000200,// 9 begin periodic tick at aura apply + SPELL_ATTR_EX5_UNK10 = 0x00000400,// 10 + SPELL_ATTR_EX5_UNK11 = 0x00000800,// 11 + SPELL_ATTR_EX5_UNK12 = 0x00001000,// 12 + SPELL_ATTR_EX5_UNK13 = 0x00002000,// 13 haste affects duration (e.g. 8050 since 3.3.3) + SPELL_ATTR_EX5_UNK14 = 0x00004000,// 14 + SPELL_ATTR_EX5_UNK15 = 0x00008000,// 15 + SPELL_ATTR_EX5_UNK16 = 0x00010000,// 16 + SPELL_ATTR_EX5_USABLE_WHILE_FEARED = 0x00020000,// 17 usable while feared + SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED = 0x00040000,// 18 usable while confused + SPELL_ATTR_EX5_UNK19 = 0x00080000,// 19 + SPELL_ATTR_EX5_UNK20 = 0x00100000,// 20 + SPELL_ATTR_EX5_UNK21 = 0x00200000,// 21 + SPELL_ATTR_EX5_UNK22 = 0x00400000,// 22 + SPELL_ATTR_EX5_UNK23 = 0x00800000,// 23 + SPELL_ATTR_EX5_UNK24 = 0x01000000,// 24 + SPELL_ATTR_EX5_UNK25 = 0x02000000,// 25 + SPELL_ATTR_EX5_UNK26 = 0x04000000,// 26 + SPELL_ATTR_EX5_UNK27 = 0x08000000,// 27 + SPELL_ATTR_EX5_UNK28 = 0x10000000,// 28 + SPELL_ATTR_EX5_UNK29 = 0x20000000,// 29 + SPELL_ATTR_EX5_UNK30 = 0x40000000,// 30 + SPELL_ATTR_EX5_UNK31 = 0x80000000,// 31 Forces all nearby enemies to focus attacks caster }; enum SpellAttributesEx6 { - SPELL_ATTR_EX6_UNK0 = 0x00000001, // 0 Only Move spell have this flag - SPELL_ATTR_EX6_ONLY_IN_ARENA = 0x00000002, // 1 only usable in arena, not used in 3.2.0a and early - SPELL_ATTR_EX6_UNK2 = 0x00000004, // 2 - SPELL_ATTR_EX6_UNK3 = 0x00000008, // 3 - SPELL_ATTR_EX6_UNK4 = 0x00000010, // 4 - SPELL_ATTR_EX6_UNK5 = 0x00000020, // 5 - SPELL_ATTR_EX6_UNK6 = 0x00000040, // 6 - SPELL_ATTR_EX6_UNK7 = 0x00000080, // 7 - SPELL_ATTR_EX6_UNK8 = 0x00000100, // 8 - SPELL_ATTR_EX6_UNK9 = 0x00000200, // 9 - SPELL_ATTR_EX6_UNK10 = 0x00000400, // 10 - SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE = 0x00000800, // 11 not usable in raid instance - SPELL_ATTR_EX6_UNK12 = 0x00001000, // 12 for auras SPELL_AURA_TRACK_CREATURES, SPELL_AURA_TRACK_RESOURCES and SPELL_AURA_TRACK_STEALTHED select non-stacking tracking spells - SPELL_ATTR_EX6_UNK13 = 0x00002000, // 13 - SPELL_ATTR_EX6_UNK14 = 0x00004000, // 14 - SPELL_ATTR_EX6_UNK15 = 0x00008000, // 15 not set in 3.0.3 - SPELL_ATTR_EX6_UNK16 = 0x00010000, // 16 - SPELL_ATTR_EX6_UNK17 = 0x00020000, // 17 - SPELL_ATTR_EX6_UNK18 = 0x00040000, // 18 - SPELL_ATTR_EX6_UNK19 = 0x00080000, // 19 - SPELL_ATTR_EX6_UNK20 = 0x00100000, // 20 - SPELL_ATTR_EX6_UNK21 = 0x00200000, // 21 - SPELL_ATTR_EX6_UNK22 = 0x00400000, // 22 - SPELL_ATTR_EX6_UNK23 = 0x00800000, // 23 not set in 3.0.3 - SPELL_ATTR_EX6_UNK24 = 0x01000000, // 24 not set in 3.0.3 - SPELL_ATTR_EX6_UNK25 = 0x02000000, // 25 not set in 3.0.3 - SPELL_ATTR_EX6_UNK26 = 0x04000000, // 26 not set in 3.0.3 - SPELL_ATTR_EX6_UNK27 = 0x08000000, // 27 not set in 3.0.3 - SPELL_ATTR_EX6_UNK28 = 0x10000000, // 28 not set in 3.0.3 - SPELL_ATTR_EX6_NO_DMG_MODS = 0x20000000, // 29 do not apply damage mods (usually in cases where it has already been applied) - SPELL_ATTR_EX6_UNK30 = 0x40000000, // 30 not set in 3.0.3 - SPELL_ATTR_EX6_UNK31 = 0x80000000, // 31 not set in 3.0.3 + SPELL_ATTR_EX6_UNK0 = 0x00000001,// 0 Only Move spell have this flag + SPELL_ATTR_EX6_ONLY_IN_ARENA = 0x00000002,// 1 only usable in arena, not used in 3.2.0a and early + SPELL_ATTR_EX6_UNK2 = 0x00000004,// 2 + SPELL_ATTR_EX6_UNK3 = 0x00000008,// 3 + SPELL_ATTR_EX6_UNK4 = 0x00000010,// 4 + SPELL_ATTR_EX6_UNK5 = 0x00000020,// 5 + SPELL_ATTR_EX6_UNK6 = 0x00000040,// 6 + SPELL_ATTR_EX6_UNK7 = 0x00000080,// 7 + SPELL_ATTR_EX6_UNK8 = 0x00000100,// 8 + SPELL_ATTR_EX6_UNK9 = 0x00000200,// 9 + SPELL_ATTR_EX6_UNK10 = 0x00000400,// 10 + SPELL_ATTR_EX6_NOT_IN_RAID_INSTANCE = 0x00000800,// 11 not usable in raid instance + SPELL_ATTR_EX6_UNK12 = 0x00001000,// 12 for auras SPELL_AURA_TRACK_CREATURES, SPELL_AURA_TRACK_RESOURCES and SPELL_AURA_TRACK_STEALTHED select non-stacking tracking spells + SPELL_ATTR_EX6_UNK13 = 0x00002000,// 13 + SPELL_ATTR_EX6_UNK14 = 0x00004000,// 14 + SPELL_ATTR_EX6_UNK15 = 0x00008000,// 15 not set in 3.0.3 + SPELL_ATTR_EX6_UNK16 = 0x00010000,// 16 + SPELL_ATTR_EX6_UNK17 = 0x00020000,// 17 + SPELL_ATTR_EX6_UNK18 = 0x00040000,// 18 + SPELL_ATTR_EX6_UNK19 = 0x00080000,// 19 + SPELL_ATTR_EX6_UNK20 = 0x00100000,// 20 + SPELL_ATTR_EX6_UNK21 = 0x00200000,// 21 + SPELL_ATTR_EX6_UNK22 = 0x00400000,// 22 + SPELL_ATTR_EX6_UNK23 = 0x00800000,// 23 not set in 3.0.3 + SPELL_ATTR_EX6_UNK24 = 0x01000000,// 24 not set in 3.0.3 + SPELL_ATTR_EX6_UNK25 = 0x02000000,// 25 not set in 3.0.3 + SPELL_ATTR_EX6_UNK26 = 0x04000000,// 26 not set in 3.0.3 + SPELL_ATTR_EX6_UNK27 = 0x08000000,// 27 not set in 3.0.3 + SPELL_ATTR_EX6_UNK28 = 0x10000000,// 28 not set in 3.0.3 + SPELL_ATTR_EX6_NO_DMG_MODS = 0x20000000,// 29 do not apply damage mods (usually in cases where it has already been applied) + SPELL_ATTR_EX6_UNK30 = 0x40000000,// 30 not set in 3.0.3 + SPELL_ATTR_EX6_UNK31 = 0x80000000,// 31 not set in 3.0.3 }; enum SpellAttributesEx7 { - SPELL_ATTR_EX7_UNK0 = 0x00000001, // 0 - SPELL_ATTR_EX7_UNK1 = 0x00000002, // 1 - SPELL_ATTR_EX7_PALADIN_AURA = 0x00000004, // 2 - SPELL_ATTR_EX7_UNK3 = 0x00000008, // 3 - SPELL_ATTR_EX7_UNK4 = 0x00000010, // 4 - SPELL_ATTR_EX7_TOTEM_SPELL = 0x00000020, // 5 shaman summon totem spells - SPELL_ATTR_EX7_UNK6 = 0x00000040, // 6 - SPELL_ATTR_EX7_UNK7 = 0x00000080, // 7 - SPELL_ATTR_EX7_UNK8 = 0x00000100, // 8 - SPELL_ATTR_EX7_UNK9 = 0x00000200, // 9 - SPELL_ATTR_EX7_UNK10 = 0x00000400, // 10 - SPELL_ATTR_EX7_UNK11 = 0x00000800, // 11 - SPELL_ATTR_EX7_UNK12 = 0x00001000, // 12 - SPELL_ATTR_EX7_UNK13 = 0x00002000, // 13 - SPELL_ATTR_EX7_UNK14 = 0x00004000, // 14 - SPELL_ATTR_EX7_UNK15 = 0x00008000, // 15 - SPELL_ATTR_EX7_UNK16 = 0x00010000, // 16 - SPELL_ATTR_EX7_UNK17 = 0x00020000, // 17 - SPELL_ATTR_EX7_UNK18 = 0x00040000, // 18 - SPELL_ATTR_EX7_UNK19 = 0x00080000, // 19 - SPELL_ATTR_EX7_UNK20 = 0x00100000, // 20 - SPELL_ATTR_EX7_UNK21 = 0x00200000, // 21 - SPELL_ATTR_EX7_UNK22 = 0x00400000, // 22 - SPELL_ATTR_EX7_UNK23 = 0x00800000, // 23 - SPELL_ATTR_EX7_UNK24 = 0x01000000, // 24 - SPELL_ATTR_EX7_UNK25 = 0x02000000, // 25 - SPELL_ATTR_EX7_UNK26 = 0x04000000, // 26 - SPELL_ATTR_EX7_UNK27 = 0x08000000, // 27 - SPELL_ATTR_EX7_UNK28 = 0x10000000, // 28 - SPELL_ATTR_EX7_UNK29 = 0x20000000, // 29 - SPELL_ATTR_EX7_UNK30 = 0x40000000, // 30 - SPELL_ATTR_EX7_UNK31 = 0x80000000, // 31 + SPELL_ATTR_EX7_UNK0 = 0x00000001,// 0 + SPELL_ATTR_EX7_UNK1 = 0x00000002,// 1 + SPELL_ATTR_EX7_PALADIN_AURA = 0x00000004,// 2 + SPELL_ATTR_EX7_UNK3 = 0x00000008,// 3 + SPELL_ATTR_EX7_UNK4 = 0x00000010,// 4 + SPELL_ATTR_EX7_TOTEM_SPELL = 0x00000020,// 5 shaman summon totem spells + SPELL_ATTR_EX7_UNK6 = 0x00000040,// 6 + SPELL_ATTR_EX7_UNK7 = 0x00000080,// 7 + SPELL_ATTR_EX7_UNK8 = 0x00000100,// 8 + SPELL_ATTR_EX7_UNK9 = 0x00000200,// 9 + SPELL_ATTR_EX7_UNK10 = 0x00000400,// 10 + SPELL_ATTR_EX7_UNK11 = 0x00000800,// 11 + SPELL_ATTR_EX7_UNK12 = 0x00001000,// 12 + SPELL_ATTR_EX7_UNK13 = 0x00002000,// 13 + SPELL_ATTR_EX7_UNK14 = 0x00004000,// 14 + SPELL_ATTR_EX7_UNK15 = 0x00008000,// 15 + SPELL_ATTR_EX7_UNK16 = 0x00010000,// 16 + SPELL_ATTR_EX7_UNK17 = 0x00020000,// 17 + SPELL_ATTR_EX7_UNK18 = 0x00040000,// 18 + SPELL_ATTR_EX7_UNK19 = 0x00080000,// 19 + SPELL_ATTR_EX7_UNK20 = 0x00100000,// 20 + SPELL_ATTR_EX7_UNK21 = 0x00200000,// 21 + SPELL_ATTR_EX7_UNK22 = 0x00400000,// 22 + SPELL_ATTR_EX7_UNK23 = 0x00800000,// 23 + SPELL_ATTR_EX7_UNK24 = 0x01000000,// 24 + SPELL_ATTR_EX7_UNK25 = 0x02000000,// 25 + SPELL_ATTR_EX7_UNK26 = 0x04000000,// 26 + SPELL_ATTR_EX7_UNK27 = 0x08000000,// 27 + SPELL_ATTR_EX7_UNK28 = 0x10000000,// 28 + SPELL_ATTR_EX7_UNK29 = 0x20000000,// 29 + SPELL_ATTR_EX7_UNK30 = 0x40000000,// 30 + SPELL_ATTR_EX7_UNK31 = 0x80000000,// 31 }; #define MAX_TALENT_SPEC_COUNT 2 @@ -1074,14 +1074,14 @@ enum AuraState AURA_STATE_BERSERKING = 3, // C T | AURA_STATE_FROZEN = 4, // cT | frozen target AURA_STATE_JUDGEMENT = 5, // C | - //AURA_STATE_UNKNOWN6 = 6, // | not used + // AURA_STATE_UNKNOWN6 = 6, // | not used AURA_STATE_HUNTER_PARRY = 7, // C | AURA_STATE_ROGUE_ATTACK_FROM_STEALTH = 7, // C | FIX ME: not implemented yet! - //AURA_STATE_UNKNOWN7 = 7, // c | random/focused bursts spells (?) - //AURA_STATE_UNKNOWN8 = 8, // | not used - //AURA_STATE_UNKNOWN9 = 9, // | not used + // AURA_STATE_UNKNOWN7 = 7, // c | random/focused bursts spells (?) + // AURA_STATE_UNKNOWN8 = 8, // | not used + // AURA_STATE_UNKNOWN9 = 9, // | not used AURA_STATE_WARRIOR_VICTORY_RUSH = 10, // C | warrior victory rush - //AURA_STATE_UNKNOWN11 = 11, // t| + // AURA_STATE_UNKNOWN11 = 11, // t| AURA_STATE_FAERIE_FIRE = 12, // c t| AURA_STATE_HEALTHLESS_35_PERCENT = 13, // C T | AURA_STATE_CONFLAGRATE = 14, // T | per-caster @@ -1089,10 +1089,10 @@ enum AuraState AURA_STATE_DEADLY_POISON = 16, // T | AURA_STATE_ENRAGE = 17, // C | AURA_STATE_BLEEDING = 18, // C t| - //AURA_STATE_UNKNOWN19 = 19, // | not used - //AURA_STATE_UNKNOWN20 = 20, // c | only (45317 Suicide) - //AURA_STATE_UNKNOWN21 = 21, // | not used - //AURA_STATE_UNKNOWN22 = 22, // C | not implemented yet (Requires Evasive Charges to use) + // AURA_STATE_UNKNOWN19 = 19, // | not used + // AURA_STATE_UNKNOWN20 = 20, // c | only (45317 Suicide) + // AURA_STATE_UNKNOWN21 = 21, // | not used + // AURA_STATE_UNKNOWN22 = 22, // C | not implemented yet (Requires Evasive Charges to use) AURA_STATE_HEALTH_ABOVE_75_PERCENT = 23, // C | }; @@ -1183,10 +1183,10 @@ enum DispelType #define DISPEL_ALL_MASK ( (1<(only this effect in the spell) can't cast to it, -//some aura(related to Mechanics or ImmuneToState) can't apply to it. +// To all Immune system,if target has immunes, +// some spell that related to ImmuneToDispel or ImmuneToSchool or ImmuneToDamage type can't cast to it, +// some spell_effects that related to ImmuneToEffect(only this effect in the spell) can't cast to it, +// some aura(related to Mechanics or ImmuneToState) can't apply to it. enum SpellImmunity { IMMUNITY_EFFECT = 0, // enum SpellEffects @@ -1389,13 +1389,13 @@ enum GameobjectTypes enum GameObjectFlags { - GO_FLAG_IN_USE = 0x00000001, //disables interaction while animated - GO_FLAG_LOCKED = 0x00000002, //require key, spell, event, etc to be opened. Makes "Locked" appear in tooltip - GO_FLAG_INTERACT_COND = 0x00000004, //cannot interact (condition to interact) - GO_FLAG_TRANSPORT = 0x00000008, //any kind of transport? Object can transport (elevator, boat, car) - GO_FLAG_NO_INTERACT = 0x00000010, //players cannot interact with this go (often need to remove flag in event) - GO_FLAG_NODESPAWN = 0x00000020, //never despawn, typically for doors, they just change state - GO_FLAG_TRIGGERED = 0x00000040, //typically, summoned objects. Triggered by spell or other events + GO_FLAG_IN_USE = 0x00000001, // disables interaction while animated + GO_FLAG_LOCKED = 0x00000002, // require key, spell, event, etc to be opened. Makes "Locked" appear in tooltip + GO_FLAG_INTERACT_COND = 0x00000004, // cannot interact (condition to interact) + GO_FLAG_TRANSPORT = 0x00000008, // any kind of transport? Object can transport (elevator, boat, car) + GO_FLAG_NO_INTERACT = 0x00000010, // players cannot interact with this go (often need to remove flag in event) + GO_FLAG_NODESPAWN = 0x00000020, // never despawn, typically for doors, they just change state + GO_FLAG_TRIGGERED = 0x00000040, // typically, summoned objects. Triggered by spell or other events GO_FLAG_UNK_8 = 0x00000080, GO_FLAG_UNK_9 = 0x00000100, //? Seen on type 33, possible meaning "destruct in progress" GO_FLAG_UNK_10 = 0x00000200, //? Seen on type 33 diff --git a/src/game/SkillHandler.cpp b/src/game/SkillHandler.cpp index fbf7fb9e0..7c811662d 100644 --- a/src/game/SkillHandler.cpp +++ b/src/game/SkillHandler.cpp @@ -72,7 +72,7 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket& recv_data) if (!(_player->resetTalents())) { - WorldPacket data(MSG_TALENT_WIPE_CONFIRM, 8 + 4); //you have not any talent + WorldPacket data(MSG_TALENT_WIPE_CONFIRM, 8 + 4); // you have not any talent data << uint64(0); data << uint32(0); SendPacket(&data); @@ -80,7 +80,7 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket& recv_data) } _player->SendTalentsInfoData(false); - unit->CastSpell(_player, 14867, true); //spell: "Untalent Visual Effect" + unit->CastSpell(_player, 14867, true); // spell: "Untalent Visual Effect" } void WorldSession::HandleUnlearnSkillOpcode(WorldPacket& recv_data) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index a955a8133..e40ccbb6e 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -365,7 +365,7 @@ Spell::Spell(Unit* caster, SpellEntry const* info, bool triggered, ObjectGuid or m_TriggerSpells.clear(); m_preCastSpells.clear(); m_IsTriggeredSpell = triggered; - //m_AreaAura = false; + // m_AreaAura = false; m_CastItem = NULL; unitTarget = NULL; @@ -376,7 +376,7 @@ Spell::Spell(Unit* caster, SpellEntry const* info, bool triggered, ObjectGuid or m_glyphIndex = 0; m_triggeredByAuraSpell = NULL; - //Auto Shot & Shoot (wand) + // Auto Shot & Shoot (wand) m_autoRepeat = IsAutoRepeatRangedSpell(m_spellInfo); m_runesState = 0; @@ -506,12 +506,12 @@ void Spell::FillTargetMap() case TARGET_EFFECT_SELECT: SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetA[i], tmpUnitLists[i /*==effToIndex[i]*/]); break; - case TARGET_AREAEFFECT_INSTANT: // use B case that not dependent from from A in fact + case TARGET_AREAEFFECT_INSTANT: // use B case that not dependent from from A in fact if ((m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION) == 0) m_targets.setDestination(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ()); SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetB[i], tmpUnitLists[i /*==effToIndex[i]*/]); break; - case TARGET_BEHIND_VICTIM: // use B case that not dependent from from A in fact + case TARGET_BEHIND_VICTIM: // use B case that not dependent from from A in fact SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetB[i], tmpUnitLists[i /*==effToIndex[i]*/]); break; default: @@ -604,7 +604,7 @@ void Spell::FillTargetMap() // need some target for processing SetTargetMap(SpellEffectIndex(i), TARGET_EFFECT_SELECT, tmpUnitLists[i /*==effToIndex[i]*/]); break; - case TARGET_AREAEFFECT_INSTANT: // All 17/7 pairs used for dest teleportation, A processed in effect code + case TARGET_AREAEFFECT_INSTANT: // All 17/7 pairs used for dest teleportation, A processed in effect code SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetB[i], tmpUnitLists[i /*==effToIndex[i]*/]); break; default: @@ -655,7 +655,7 @@ void Spell::FillTargetMap() case TARGET_EFFECT_SELECT: SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetA[i], tmpUnitLists[i /*==effToIndex[i]*/]); break; - case TARGET_SCRIPT_COORDINATES: // B case filled in CheckCast but we need fill unit list base at A case + case TARGET_SCRIPT_COORDINATES: // B case filled in CheckCast but we need fill unit list base at A case SetTargetMap(SpellEffectIndex(i), m_spellInfo->EffectImplicitTargetA[i], tmpUnitLists[i /*==effToIndex[i]*/]); break; default: @@ -784,7 +784,7 @@ void Spell::prepareDataForTriggerSystem() } break; default: - if (IsPositiveSpell(m_spellInfo->Id)) // Check for positive spell + if (IsPositiveSpell(m_spellInfo->Id)) // Check for positive spell { m_procAttacker = PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL; m_procVictim = PROC_FLAG_TAKEN_POSITIVE_SPELL; @@ -1901,7 +1901,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& tempTargetUnitMap.sort(TargetDistanceOrderNear(m_caster)); - //Now to get us a random target that's in the initial range of the spell + // Now to get us a random target that's in the initial range of the spell uint32 t = 0; UnitList::iterator itr = tempTargetUnitMap.begin(); while (itr != tempTargetUnitMap.end() && (*itr)->IsWithinDist(m_caster, radius)) @@ -1961,7 +1961,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& tempTargetUnitMap.sort(TargetDistanceOrderNear(m_caster)); - //Now to get us a random target that's in the initial range of the spell + // Now to get us a random target that's in the initial range of the spell uint32 t = 0; UnitList::iterator itr = tempTargetUnitMap.begin(); while (itr != tempTargetUnitMap.end() && (*itr)->IsWithinDist(m_caster, radius)) @@ -2033,7 +2033,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& if (m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE) max_range = radius; else - //FIXME: This very like horrible hack and wrong for most spells + // FIXME: This very like horrible hack and wrong for most spells max_range = radius + unMaxTargets * CHAIN_SPELL_JUMP_RADIUS; UnitList tempTargetUnitMap; @@ -2980,7 +2980,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& break; } default: - //sLog.outError( "SPELL: Unknown implicit target (%u) for spell ID %u", targetMode, m_spellInfo->Id ); + // sLog.outError( "SPELL: Unknown implicit target (%u) for spell ID %u", targetMode, m_spellInfo->Id ); break; } @@ -3077,7 +3077,7 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura) SpellEvent* Event = new SpellEvent(this); m_caster->m_Events.AddEvent(Event, m_caster->m_Events.CalculateTime(1)); - //Prevent casting at cast another spell (ServerSide check) + // Prevent casting at cast another spell (ServerSide check) if (m_caster->IsNonMeleeSpellCasted(false, true, true) && m_cast_count) { SendCastResult(SPELL_FAILED_SPELL_IN_PROGRESS); @@ -3089,7 +3089,7 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura) m_powerCost = CalculatePowerCost(m_spellInfo, m_caster, this, m_CastItem); SpellCastResult result = CheckCast(true); - if (result != SPELL_CAST_OK && !IsAutoRepeat()) //always cast autorepeat dummy for triggering + if (result != SPELL_CAST_OK && !IsAutoRepeat()) // always cast autorepeat dummy for triggering { if (triggeredByAura) { @@ -3399,7 +3399,7 @@ void Spell::cast(bool skipCheck) { // only for self cast if (m_caster == m_targets.getUnitTarget()) - AddPrecastSpell(25771); // Forbearance + AddPrecastSpell(25771); // Forbearance } // Avenging Wrath else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000200000000000)) @@ -3998,7 +3998,7 @@ void Spell::SendSpellStart() if (castFlags & CAST_FLAG_PREDICTED_RUNES) // predicted runes { - uint8 v1 = 0;//m_runesState; + uint8 v1 = 0;// m_runesState; uint8 v2 = 0;//((Player*)m_caster)->GetRunesState(); data << uint8(v1); // runes state before data << uint8(v2); // runes state after @@ -4101,7 +4101,7 @@ void Spell::SendSpellGo() { data << uint32(0); // count - //for(int = 0; i < count; ++i) + // for(int = 0; i < count; ++i) //{ // // position and guid? // data << float(0) << float(0) << float(0) << uint64(0); @@ -4607,13 +4607,13 @@ SpellCastResult Spell::CheckOrTakeRunePower(bool take) if (runeCostMod > 0) { - int32 runeCost[NUM_RUNE_TYPES]; // blood, frost, unholy, death + int32 runeCost[NUM_RUNE_TYPES]; // blood, frost, unholy, death // init cost data and apply mods for (uint32 i = 0; i < RUNE_DEATH; ++i) runeCost[i] = runeCostMod > 0 ? src->RuneCost[i] : 0; - runeCost[RUNE_DEATH] = 0; // calculated later + runeCost[RUNE_DEATH] = 0; // calculated later // scan non-death runes (death rune not used explicitly in rune costs) for (uint32 i = 0; i < MAX_RUNES; ++i) @@ -4627,7 +4627,7 @@ SpellCastResult Spell::CheckOrTakeRunePower(bool take) continue; if (take) - plr->SetRuneCooldown(i, RUNE_COOLDOWN); // 5*2=10 sec + plr->SetRuneCooldown(i, RUNE_COOLDOWN); // 5*2=10 sec --runeCost[rune]; } @@ -4661,7 +4661,7 @@ SpellCastResult Spell::CheckOrTakeRunePower(bool take) } if (!take && runeCost[RUNE_DEATH] > 0) - return SPELL_FAILED_NO_POWER; // not sure if result code is correct + return SPELL_FAILED_NO_POWER; // not sure if result code is correct } if (take) @@ -5066,8 +5066,8 @@ SpellCastResult Spell::CheckCast(bool strict) } } - //check creature type - //ignore self casts (including area casts when caster selected as target) + // check creature type + // ignore self casts (including area casts when caster selected as target) if (non_caster_target) { if (!CheckTargetCreatureType(target)) @@ -5147,7 +5147,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (target->IsImmuneToSpell(m_spellInfo)) return SPELL_FAILED_TARGET_AURASTATE; - //Must be behind the target. + // Must be behind the target. if (m_spellInfo->AttributesEx2 == SPELL_ATTR_EX2_UNK20 && m_spellInfo->HasAttribute(SPELL_ATTR_EX_UNK9) && target->HasInArc(M_PI_F, m_caster)) { // Exclusion for Pounce: Facing Limitation was removed in 2.0.1, but it still uses the same, old Ex-Flags @@ -5162,7 +5162,7 @@ SpellCastResult Spell::CheckCast(bool strict) } } - //Target must be facing you. + // Target must be facing you. if ((m_spellInfo->Attributes == (SPELL_ATTR_UNK4 | SPELL_ATTR_NOT_SHAPESHIFT | SPELL_ATTR_UNK18 | SPELL_ATTR_STOP_ATTACK_TARGET)) && !target->HasInArc(M_PI_F, m_caster)) { SendInterrupted(2); @@ -5357,7 +5357,7 @@ SpellCastResult Spell::CheckCast(bool strict) AddGOTarget(goScriptTarget, SpellEffectIndex(j)); } } - //Missing DB Entry or targets for this spellEffect. + // Missing DB Entry or targets for this spellEffect. else { /* For TARGET_FOCUS_OR_SCRIPTED_GAMEOBJECT makes DB targets optional not required for now @@ -5643,7 +5643,7 @@ SpellCastResult Spell::CheckCast(bool strict) } case SPELL_EFFECT_OPEN_LOCK: { - if (m_caster->GetTypeId() != TYPEID_PLAYER) // only players can open locks, gather etc. + if (m_caster->GetTypeId() != TYPEID_PLAYER) // only players can open locks, gather etc. return SPELL_FAILED_BAD_TARGETS; // we need a go target in case of TARGET_GAMEOBJECT (for other targets acceptable GO and items) @@ -5739,7 +5739,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->getClass() == CLASS_WARLOCK) { - if (strict) //Summoning Disorientation, trigger pet stun (cast by pet so it doesn't attack player) + if (strict) // Summoning Disorientation, trigger pet stun (cast by pet so it doesn't attack player) pet->CastSpell(pet, 32752, true, NULL, NULL, pet->GetObjectGuid()); } else @@ -5814,7 +5814,7 @@ SpellCastResult Spell::CheckCast(bool strict) { case SPELL_AURA_DUMMY: { - //custom check + // custom check switch (m_spellInfo->Id) { case 34026: // Kill Command @@ -6018,14 +6018,14 @@ SpellCastResult Spell::CheckPetCast(Unit* target) if (!m_caster->isAlive()) return SPELL_FAILED_CASTER_DEAD; - if (m_caster->IsNonMeleeSpellCasted(false)) //prevent spellcast interruption by another spellcast + if (m_caster->IsNonMeleeSpellCasted(false)) // prevent spellcast interruption by another spellcast return SPELL_FAILED_SPELL_IN_PROGRESS; if (m_caster->isInCombat() && IsNonCombatSpell(m_spellInfo)) return SPELL_FAILED_AFFECTING_COMBAT; if (m_caster->GetTypeId() == TYPEID_UNIT && (((Creature*)m_caster)->IsPet() || m_caster->isCharmed())) { - //dead owner (pets still alive when owners ressed?) + // dead owner (pets still alive when owners ressed?) if (m_caster->GetCharmerOrOwner() && !m_caster->GetCharmerOrOwner()->isAlive()) return SPELL_FAILED_CASTER_DEAD; @@ -6053,7 +6053,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target) Unit* _target = m_targets.getUnitTarget(); - if (_target) //for target dead/target not valid + if (_target) // for target dead/target not valid { if (!_target->isTargetableForAttack()) return SPELL_FAILED_BAD_TARGETS; // guessed error @@ -6068,7 +6068,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target) bool duelvsplayertar = false; for (int j = 0; j < MAX_EFFECT_INDEX; ++j) { - //TARGET_DUELVSPLAYER is positive AND negative + // TARGET_DUELVSPLAYER is positive AND negative duelvsplayertar |= (m_spellInfo->EffectImplicitTargetA[j] == TARGET_DUELVSPLAYER); } if (m_caster->IsFriendlyTo(target) && !duelvsplayertar) @@ -6077,7 +6077,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target) } } } - //cooldown + // cooldown if (((Creature*)m_caster)->HasSpellCooldown(m_spellInfo->Id)) return SPELL_FAILED_NOT_READY; } @@ -6091,8 +6091,8 @@ SpellCastResult Spell::CheckCasterAuras() const // FIXME: find more nice check for all totally immuned spells // HasAttribute(SPELL_ATTR_EX3_UNK28) ? if (m_spellInfo->Id == 23336 || // Alliance Flag Drop - m_spellInfo->Id == 23334 || // Horde Flag Drop - m_spellInfo->Id == 34991) // Summon Netherstorm Flag + m_spellInfo->Id == 23334 || // Horde Flag Drop + m_spellInfo->Id == 34991) // Summon Netherstorm Flag return SPELL_CAST_OK; uint8 school_immune = 0; @@ -6178,7 +6178,7 @@ SpellCastResult Spell::CheckCasterAuras() const { if (school_immune || mechanic_immune || dispel_immune) { - //Checking auras is needed now, because you are prevented by some state but the spell grants immunity. + // Checking auras is needed now, because you are prevented by some state but the spell grants immunity. Unit::SpellAuraHolderMap const& auras = m_caster->GetSpellAuraHolderMap(); for (Unit::SpellAuraHolderMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr) { @@ -6266,12 +6266,12 @@ bool Spell::CanAutoCast(Unit* target) if (result == SPELL_CAST_OK || result == SPELL_FAILED_UNIT_NOT_INFRONT) { FillTargetMap(); - //check if among target units, our WANTED target is as well (->only self cast spells return false) + // check if among target units, our WANTED target is as well (->only self cast spells return false) for (TargetList::const_iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) if (ihit->targetGUID == targetguid) return true; } - return false; //target invalid + return false; // target invalid } SpellCastResult Spell::CheckRange(bool strict) @@ -6306,7 +6306,7 @@ SpellCastResult Spell::CheckRange(bool strict) } } - //add radius of caster and ~5 yds "give" for non stricred (landing) check + // add radius of caster and ~5 yds "give" for non stricred (landing) check float range_mod = strict ? 1.25f : 6.25; SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex); @@ -6442,7 +6442,7 @@ SpellCastResult Spell::CheckPower() return SPELL_FAILED_UNKNOWN; } - //check rune cost only if a spell has PowerType == POWER_RUNE + // check rune cost only if a spell has PowerType == POWER_RUNE if (m_spellInfo->powerType == POWER_RUNE) { SpellCastResult failReason = CheckOrTakeRunePower(false); diff --git a/src/game/Spell.h b/src/game/Spell.h index 92668ce3c..f100e55eb 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -425,7 +425,7 @@ class Spell void HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOTarget, SpellEffectIndex i, float DamageMultiplier = 1.0); void HandleThreatSpells(); - //void HandleAddAura(Unit* Target); + // void HandleAddAura(Unit* Target); SpellEntry const* m_spellInfo; SpellEntry const* m_triggeredBySpellInfo; @@ -498,7 +498,7 @@ class Spell void CancelGlobalCooldown(); void SendLoot(ObjectGuid guid, LootType loottype, LockType lockType); - bool IgnoreItemRequirements() const; // some item use spells have unexpected reagent data + bool IgnoreItemRequirements() const; // some item use spells have unexpected reagent data void UpdateOriginalCasterPointer(); Unit* m_caster; @@ -509,7 +509,7 @@ class Spell Spell** m_selfContainer; // pointer to our spell container (if applicable) - //Spell data + // Spell data SpellSchoolMask m_spellSchoolMask; // Spell school (can be overwrite for some spells (wand shoot for example) WeaponAttackType m_attackType; // For weapon based attack uint32 m_powerCost; // Calculated spell cost initialized only in Spell::prepare @@ -625,7 +625,7 @@ class Spell SpellCastResult CanOpenLock(SpellEffectIndex effIndex, uint32 lockid, SkillType& skillid, int32& reqSkillValue, int32& skillValue); // ------------------------------------------- - //List For Triggered Spells + // List For Triggered Spells typedef std::list SpellInfoList; SpellInfoList m_TriggerSpells; // casted by caster to same targets settings in m_targets at success finish of current spell SpellInfoList m_preCastSpells; // casted by caster to each target at spell hit before spell effects apply diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index d456e2dd9..5672eaa9b 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1821,10 +1821,10 @@ void Aura::TriggerSpell() // { // switch(auraId) // { -// //Frost Trap Aura +// // Frost Trap Aura // case 13810: // return; -// //Rizzle's Frost Trap +// // Rizzle's Frost Trap // case 39900: // return; // // Tame spells @@ -2859,7 +2859,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real) } return; } - case 40133: //Summon Fire Elemental + case 40133: // Summon Fire Elemental { Unit* caster = GetCaster(); if (!caster) @@ -2875,7 +2875,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real) } return; } - case 40132: //Summon Earth Elemental + case 40132: // Summon Earth Elemental { Unit* caster = GetCaster(); if (!caster) @@ -2891,7 +2891,7 @@ void Aura::HandleAuraDummy(bool apply, bool Real) } return; } - case 40214: //Dragonmaw Illusion + case 40214: // Dragonmaw Illusion { if (apply) { @@ -3063,9 +3063,9 @@ void Aura::HandleAuraDummy(bool apply, bool Real) uint32 spell_id; switch (GetId()) { - case 48384: spell_id = 50170; break; //Rank 1 - case 48395: spell_id = 50171; break; //Rank 2 - case 48396: spell_id = 50172; break; //Rank 3 + case 48384: spell_id = 50170; break; // Rank 1 + case 48395: spell_id = 50171; break; // Rank 2 + case 48396: spell_id = 50172; break; // Rank 3 default: sLog.outError("HandleAuraDummy: Not handled rank of IMF (Spell: %u)", GetId()); return; @@ -3586,10 +3586,10 @@ void Aura::HandleAuraTransform(bool apply, bool Real) case 42365: // Murloc costume target->SetDisplayId(21723); break; - //case 44186: // Gossip NPC Appearance - All, Brewfest - //break; - //case 48305: // Gossip NPC Appearance - All, Spirit of Competition - //break; + // case 44186: // Gossip NPC Appearance - All, Brewfest + // break; + // case 48305: // Gossip NPC Appearance - All, Spirit of Competition + // break; case 50517: // Dread Corsair case 51926: // Corsair Costume { @@ -3635,20 +3635,20 @@ void Aura::HandleAuraTransform(bool apply, bool Real) break; } - //case 50531: // Gossip NPC Appearance - All, Pirate Day - //break; - //case 51010: // Dire Brew - //break; - //case 53806: // Pygmy Oil - //break; - //case 62847: // NPC Appearance - Valiant 02 - //break; - //case 62852: // NPC Appearance - Champion 01 - //break; - //case 63965: // NPC Appearance - Champion 02 - //break; - //case 63966: // NPC Appearance - Valiant 03 - //break; + // case 50531: // Gossip NPC Appearance - All, Pirate Day + // break; + // case 51010: // Dire Brew + // break; + // case 53806: // Pygmy Oil + // break; + // case 62847: // NPC Appearance - Valiant 02 + // break; + // case 62852: // NPC Appearance - Champion 01 + // break; + // case 63965: // NPC Appearance - Champion 02 + // break; + // case 63966: // NPC Appearance - Valiant 03 + // break; case 65386: // Honor the Dead case 65495: { @@ -3664,20 +3664,20 @@ void Aura::HandleAuraTransform(bool apply, bool Real) } break; } - //case 65511: // Gossip NPC Appearance - Brewfest - //break; - //case 65522: // Gossip NPC Appearance - Winter Veil - //break; - //case 65523: // Gossip NPC Appearance - Default - //break; - //case 65524: // Gossip NPC Appearance - Lunar Festival - //break; - //case 65525: // Gossip NPC Appearance - Hallow's End - //break; - //case 65526: // Gossip NPC Appearance - Midsummer - //break; - //case 65527: // Gossip NPC Appearance - Spirit of Competition - //break; + // case 65511: // Gossip NPC Appearance - Brewfest + // break; + // case 65522: // Gossip NPC Appearance - Winter Veil + // break; + // case 65523: // Gossip NPC Appearance - Default + // break; + // case 65524: // Gossip NPC Appearance - Lunar Festival + // break; + // case 65525: // Gossip NPC Appearance - Hallow's End + // break; + // case 65526: // Gossip NPC Appearance - Midsummer + // break; + // case 65527: // Gossip NPC Appearance - Spirit of Competition + // break; case 65528: // Gossip NPC Appearance - Pirates' Day { // expecting npc's using this spell to have models with race info. @@ -3725,21 +3725,21 @@ void Aura::HandleAuraTransform(bool apply, bool Real) // random, regardless of current gender target->SetDisplayId(roll_chance_i(50) ? 29203 : 29204); break; - //case 66236: // Incinerate Flesh - //break; - //case 69999: // [DND] Swap IDs - //break; - //case 70764: // Citizen Costume (note: many spells w/same name) - //break; - //case 71309: // [DND] Spawn Portal - //break; + // case 66236: // Incinerate Flesh + // break; + // case 69999: // [DND] Swap IDs + // break; + // case 70764: // Citizen Costume (note: many spells w/same name) + // break; + // case 71309: // [DND] Spawn Portal + // break; case 71450: // Crown Parcel Service Uniform target->SetDisplayId(target->getGender() == GENDER_MALE ? 31002 : 31003); break; - //case 75531: // Gnomeregan Pride - //break; - //case 75532: // Darkspear Pride - //break; + // case 75531: // Gnomeregan Pride + // break; + // case 75532: // Darkspear Pride + // break; default: sLog.outError("Aura::HandleAuraTransform, spell %u does not have creature entry defined, need custom defined model.", GetId()); break; @@ -3787,7 +3787,7 @@ void Aura::HandleAuraTransform(bool apply, bool Real) if (GetCasterGuid().IsPlayer()) ((Player*)target)->setRegenTimer(1 * IN_MILLISECONDS); - //dismount polymorphed target (after patch 2.4.2) + // dismount polymorphed target (after patch 2.4.2) if (target->IsMounted()) target->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED, GetHolder()); } @@ -3902,7 +3902,7 @@ void Aura::HandleChannelDeathItem(bool apply, bool Real) return; } - //Adding items + // Adding items uint32 noSpaceForCount = 0; uint32 count = m_modifier.m_amount; @@ -4234,9 +4234,9 @@ void Aura::HandleModCharm(bool apply, bool Real) target->SetByteValue(UNIT_FIELD_BYTES_0, 1, CLASS_MAGE); } - //just to enable stat window + // just to enable stat window charmInfo->SetPetNumber(sObjectMgr.GeneratePetNumber(), true); - //if charmed two demons the same session, the 2nd gets the 1st one's name + // if charmed two demons the same session, the 2nd gets the 1st one's name target->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(time(NULL))); } } @@ -4688,7 +4688,7 @@ void Aura::HandleAuraModRoot(bool apply, bool Real) target->addUnitState(UNIT_STAT_ROOT); target->SetTargetGuid(ObjectGuid()); - //Save last orientation + // Save last orientation if (target->getVictim()) target->SetOrientation(target->GetAngle(target->getVictim())); @@ -4699,7 +4699,7 @@ void Aura::HandleAuraModRoot(bool apply, bool Real) data << (uint32)2; target->SendMessageToSet(&data, true); - //Clear unit movement flags + // Clear unit movement flags ((Player*)target)->m_movementInfo.SetMovementFlags(MOVEFLAG_NONE); } else @@ -4926,10 +4926,10 @@ void Aura::HandleAuraModIncreaseFlightSpeed(bool apply, bool Real) else data.Initialize(SMSG_MOVE_UNSET_CAN_FLY, 12); data << target->GetPackGUID(); - data << uint32(0); // unknown + data << uint32(0); // unknown target->SendMessageToSet(&data, true); - //Players on flying mounts must be immune to polymorph + // Players on flying mounts must be immune to polymorph if (target->GetTypeId() == TYPEID_PLAYER) target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, apply); @@ -5082,7 +5082,7 @@ void Aura::HandleModMechanicImmunityMask(bool apply, bool /*Real*/) // check implemented in Unit::IsImmuneToSpell and Unit::IsImmuneToSpellEffect } -//this method is called whenever we add / remove aura which gives m_target some imunity to some spell effect +// this method is called whenever we add / remove aura which gives m_target some imunity to some spell effect void Aura::HandleAuraModEffectImmunity(bool apply, bool /*Real*/) { Unit* target = GetTarget(); @@ -5130,7 +5130,7 @@ void Aura::HandleAuraModSchoolImmunity(bool apply, bool Real) // TODO: optimalize this cycle - use RemoveAurasWithInterruptFlags call or something else if (Real && apply && GetSpellProto()->HasAttribute(SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY) - && IsPositiveSpell(GetId())) // Only positive immunity removes auras + && IsPositiveSpell(GetId())) // Only positive immunity removes auras { uint32 school_mask = m_modifier.m_miscvalue; Unit::SpellAuraHolderMap& Auras = target->GetSpellAuraHolderMap(); @@ -5140,9 +5140,9 @@ void Aura::HandleAuraModSchoolImmunity(bool apply, bool Real) ++next; SpellEntry const* spell = iter->second->GetSpellProto(); if ((GetSpellSchoolMask(spell) & school_mask) // Check for school mask - && !spell->HasAttribute(SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) //Spells unaffected by invulnerability - && !iter->second->IsPositive() // Don't remove positive spells - && spell->Id != GetId()) // Don't remove self + && !spell->HasAttribute(SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) // Spells unaffected by invulnerability + && !iter->second->IsPositive() // Don't remove positive spells + && spell->Id != GetId()) // Don't remove self { target->RemoveAurasDueToSpell(spell->Id); if (Auras.empty()) @@ -5660,7 +5660,7 @@ void Aura::HandleAuraModBaseResistancePCT(bool apply, bool /*Real*/) // only players have base stats if (GetTarget()->GetTypeId() != TYPEID_PLAYER) { - //pets only have base armor + // pets only have base armor if (((Creature*)GetTarget())->IsPet() && (m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)) GetTarget()->HandleStatModifier(UNIT_MOD_ARMOR, BASE_PCT, float(m_modifier.m_amount), apply); } @@ -5697,7 +5697,7 @@ void Aura::HandleModBaseResistance(bool apply, bool /*Real*/) // only players have base stats if (GetTarget()->GetTypeId() != TYPEID_PLAYER) { - //only pets have base stats + // only pets have base stats if (((Creature*)GetTarget())->IsPet() && (m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)) GetTarget()->HandleStatModifier(UNIT_MOD_ARMOR, TOTAL_VALUE, float(m_modifier.m_amount), apply); } @@ -5726,7 +5726,7 @@ void Aura::HandleAuraModStat(bool apply, bool /*Real*/) // -1 or -2 is all stats ( misc < -2 checked in function beginning ) if (m_modifier.m_miscvalue < 0 || m_modifier.m_miscvalue == i) { - //m_target->ApplyStatMod(Stats(i), m_modifier.m_amount,apply); + // m_target->ApplyStatMod(Stats(i), m_modifier.m_amount,apply); GetTarget()->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_VALUE, float(m_modifier.m_amount), apply); if (GetTarget()->GetTypeId() == TYPEID_PLAYER || ((Creature*)GetTarget())->IsPet()) GetTarget()->ApplyStatBuffMod(Stats(i), float(m_modifier.m_amount), apply); @@ -5821,7 +5821,7 @@ void Aura::HandleModTotalPercentStat(bool apply, bool /*Real*/) Unit* target = GetTarget(); - //save current and max HP before applying aura + // save current and max HP before applying aura uint32 curHPValue = target->GetHealth(); uint32 maxHPValue = target->GetMaxHealth(); @@ -5835,7 +5835,7 @@ void Aura::HandleModTotalPercentStat(bool apply, bool /*Real*/) } } - //recalculate current HP/MP after applying aura modifications (only for spells with 0x10 flag) + // recalculate current HP/MP after applying aura modifications (only for spells with 0x10 flag) if (m_modifier.m_miscvalue == STAT_STAMINA && maxHPValue > 0 && GetSpellProto()->HasAttribute(SPELL_ATTR_UNK4)) { // newHP = (curHP / maxHP) * newMaxHP = (newMaxHP * curHP) / maxHP -> which is better because no int -> double -> int conversion is needed @@ -5933,7 +5933,7 @@ void Aura::HandleModManaRegen(bool /*apply*/, bool Real) if (GetTarget()->GetTypeId() != TYPEID_PLAYER) return; - //Note: an increase in regen does NOT cause threat. + // Note: an increase in regen does NOT cause threat. ((Player*)GetTarget())->UpdateManaRegen(); } @@ -6089,7 +6089,7 @@ void Aura::HandleAuraModDodgePercent(bool /*apply*/, bool /*Real*/) return; ((Player*)GetTarget())->UpdateDodgePercentage(); - //sLog.outError("BONUS DODGE CHANCE: + %f", float(m_modifier.m_amount)); + // sLog.outError("BONUS DODGE CHANCE: + %f", float(m_modifier.m_amount)); } void Aura::HandleAuraModBlockPercent(bool /*apply*/, bool /*Real*/) @@ -6098,7 +6098,7 @@ void Aura::HandleAuraModBlockPercent(bool /*apply*/, bool /*Real*/) return; ((Player*)GetTarget())->UpdateBlockPercentage(); - //sLog.outError("BONUS BLOCK CHANCE: + %f", float(m_modifier.m_amount)); + // sLog.outError("BONUS BLOCK CHANCE: + %f", float(m_modifier.m_amount)); } void Aura::HandleAuraModRegenInterrupt(bool /*apply*/, bool Real) @@ -6271,7 +6271,7 @@ void Aura::HandleAuraModRangedAttackPower(bool apply, bool /*Real*/) void Aura::HandleAuraModAttackPowerPercent(bool apply, bool /*Real*/) { - //UNIT_FIELD_ATTACK_POWER_MULTIPLIER = multiplier - 1 + // UNIT_FIELD_ATTACK_POWER_MULTIPLIER = multiplier - 1 GetTarget()->HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_PCT, float(m_modifier.m_amount), apply); } @@ -6280,7 +6280,7 @@ void Aura::HandleAuraModRangedAttackPowerPercent(bool apply, bool /*Real*/) if ((GetTarget()->getClassMask() & CLASSMASK_WAND_USERS) != 0) return; - //UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = multiplier - 1 + // UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = multiplier - 1 GetTarget()->HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_PCT, float(m_modifier.m_amount), apply); } @@ -6701,9 +6701,9 @@ void Aura::HandleShapeshiftBoosts(bool apply) uint32 spell_id = 0; switch ((*i)->GetId()) { - case 48384: spell_id = 50170; break; //Rank 1 - case 48395: spell_id = 50171; break; //Rank 2 - case 48396: spell_id = 50172; break; //Rank 3 + case 48384: spell_id = 50170; break; // Rank 1 + case 48395: spell_id = 50171; break; // Rank 2 + case 48396: spell_id = 50172; break; // Rank 3 default: sLog.outError("Aura::HandleShapeshiftBoosts: Not handled rank of IMF (Spell: %u)", (*i)->GetId()); break; @@ -6998,7 +6998,7 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real) { //+80.68% from +spell bonus DoneActualBenefit = caster->SpellBaseHealingBonusDone(GetSpellSchoolMask(spellProto)) * 0.8068f; - //Borrowed Time + // Borrowed Time Unit::AuraList const& borrowedTime = caster->GetAurasByType(SPELL_AURA_DUMMY); for (Unit::AuraList::const_iterator itr = borrowedTime.begin(); itr != borrowedTime.end(); ++itr) { @@ -7100,7 +7100,7 @@ void Aura::HandleSchoolAbsorb(bool apply, bool Real) break; } - //cooldown aura + // cooldown aura caster->CastSpell(caster, 63853, true); break; } @@ -7303,7 +7303,7 @@ void Aura::PeriodicTick() uint32 pdamage = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0; - //Calculate armor mitigation if it is a physical spell + // Calculate armor mitigation if it is a physical spell if (GetSpellSchoolMask(spellProto) & SPELL_SCHOOL_MASK_NORMAL) { uint32 pdamageReductedArmor = pCaster->CalcArmorReducedDamage(target, pdamage); @@ -7465,7 +7465,7 @@ void Aura::PeriodicTick() } // uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC;// | PROC_FLAG_SUCCESSFUL_HEAL; -// uint32 procVictim = 0;//ROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_TAKEN_HEAL; +// uint32 procVictim = 0;// ROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_TAKEN_HEAL; // ignore item heals // if(procSpell && !haveCastItem) // pCaster->ProcDamageAndSpell(target, procAttacker, procVictim, PROC_EX_NORMAL_HIT, pdamage, BASE_ATTACK, spellProto); @@ -8370,14 +8370,14 @@ void Aura::HandleAuraControlVehicle(bool apply, bool Real) if (caster->GetTypeId() == TYPEID_PLAYER) ((Player*)caster)->RemovePet(PET_SAVE_AS_CURRENT); - //caster->EnterVehicle(target); + // caster->EnterVehicle(target); } else { // some SPELL_AURA_CONTROL_VEHICLE auras have a dummy effect on the player - remove them caster->RemoveAurasDueToSpell(GetId()); - //caster->ExitVehicle(); + // caster->ExitVehicle(); if (caster->GetTypeId() == TYPEID_PLAYER) ((Player*)caster)->ResummonPetTemporaryUnSummonedIfAny(); @@ -8836,9 +8836,9 @@ void SpellAuraHolder::_RemoveSpellAuraHolder() if (Item* castItem = ((Player*)m_target)->GetItemByGuid(castItemGuid)) ((Player*)m_target)->DestroyItemWithOnStoreSpell(castItem, GetId()); - //passive auras do not get put in slots - said who? ;) + // passive auras do not get put in slots - said who? ;) // Note: but totem can be not accessible for aura target in time remove (to far for find in grid) - //if(m_isPassive && !(caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->IsTotem())) + // if(m_isPassive && !(caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->IsTotem())) // return; uint8 slot = GetAuraSlot(); @@ -9198,7 +9198,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) return; break; } - case 58914: // Kill Command, pet aura + case 58914: // Kill Command, pet aura { // Removal is needed here because the dummy aura handler is applied / removed at stacks change if (!apply) @@ -9593,7 +9593,7 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) // apply in special way if (percent) { - spellId1 = 57318; // Sanctified Wrath (triggered) + spellId1 = 57318; // Sanctified Wrath (triggered) // prevent aura deletion, specially in multi-boost case SetInUse(true); m_target->CastCustomSpell(m_target, spellId1, &percent, &percent, NULL, true, NULL); @@ -9679,10 +9679,10 @@ void SpellAuraHolder::HandleSpellSpecificBoosts(bool apply) } } if (power_pct || !apply) - spellId2 = 49772; // Unholy Presence, speed part, spell1 used for Improvement presence fit to own presence + spellId2 = 49772; // Unholy Presence, speed part, spell1 used for Improvement presence fit to own presence } else - spellId1 = 49772; // Unholy Presence move speed + spellId1 = 49772; // Unholy Presence move speed if (GetId() == 48265 || GetId() == 48266) // Unholy Presence or Blood Presence { diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 3da323e37..7e20b62c9 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -209,7 +209,7 @@ class MANGOS_DLL_SPEC Aura friend Aura* CreateAura(SpellEntry const* spellproto, SpellEffectIndex eff, int32* currentBasePoints, SpellAuraHolder* holder, Unit* target, Unit* caster, Item* castItem); public: - //aura handlers + // aura handlers void HandleNULL(bool, bool) { // NOT IMPLEMENTED diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 2b069bff6..e1805ee2e 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -380,14 +380,14 @@ void Spell::EffectSchoolDMG(SpellEffectIndex effect_idx) case 67485: damage += uint32(0.5f * m_caster->GetTotalAttackPowerValue(BASE_ATTACK)); break; - //Magic Bane normal (Forge of Souls - Bronjahm) + // Magic Bane normal (Forge of Souls - Bronjahm) case 68793: { damage += uint32(unitTarget->GetMaxPower(POWER_MANA) / 2); damage = std::min(damage, 10000); break; } - //Magic Bane heroic (Forge of Souls - Bronjahm) + // Magic Bane heroic (Forge of Souls - Bronjahm) case 69050: { damage += uint32(unitTarget->GetMaxPower(POWER_MANA) / 2); @@ -650,7 +650,7 @@ void Spell::EffectSchoolDMG(SpellEffectIndex effect_idx) } case SPELLFAMILY_HUNTER: { - //Gore + // Gore if (m_spellInfo->SpellIconID == 1578) { if (m_caster->HasAura(57627)) // Charge 6 sec post-affect @@ -954,8 +954,8 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) return; uint32 spell_id = roll_chance_i(50) - ? 17269 // Create Resonating Skull - : 17270; // Create Bone Dust + ? 17269 // Create Resonating Skull + : 17270; // Create Bone Dust m_caster->CastSpell(m_caster, spell_id, true, NULL); return; @@ -1226,8 +1226,8 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) return; uint32 spell_id = roll_chance_i(50) - ? 29277 // Summon Purified Helboar Meat - : 29278; // Summon Toxic Helboar Meat + ? 29277 // Summon Purified Helboar Meat + : 29278; // Summon Toxic Helboar Meat m_caster->CastSpell(m_caster, spell_id, true, NULL); return; @@ -1561,13 +1561,13 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) creatureTarget->ForcedDespawn(); - //cast spell Raptor Capture Credit + // cast spell Raptor Capture Credit m_caster->CastSpell(m_caster, 42337, true, NULL); return; } case 44997: // Converting Sentry { - //Converted Sentry Credit + // Converted Sentry Credit m_caster->CastSpell(m_caster, 45009, true); return; } @@ -1585,11 +1585,11 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) case 0: spellId = 45446; break; // Summon Arcane Prisoner - Male case 1: spellId = 45448; break; // Summon Arcane Prisoner - Female } - //Spawn + // Spawn m_caster->CastSpell(m_caster, spellId, true); if (!unitTarget) return; - //Arcane Prisoner Kill Credit + // Arcane Prisoner Kill Credit unitTarget->CastSpell(m_caster, 45456, true); break; @@ -2683,7 +2683,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) { if (unitTarget && unitTarget->GetTypeId() == TYPEID_UNIT) { - //Polymorph Cast Visual Rank 1 + // Polymorph Cast Visual Rank 1 const uint32 spell_list[6] = { 32813, // Squirrel Form @@ -2900,7 +2900,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) // Starfall if (m_spellInfo->IsFitToFamilyMask(UI64LIT(0x0000000000000000), 0x00000100)) { - //Shapeshifting into an animal form or mounting cancels the effect. + // Shapeshifting into an animal form or mounting cancels the effect. if (m_caster->GetCreatureType() == CREATURE_TYPE_BEAST || m_caster->IsMounted()) { if (m_triggeredByAuraSpell) @@ -2908,7 +2908,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) return; } - //Any effect which causes you to lose control of your character will supress the starfall effect. + // Any effect which causes you to lose control of your character will supress the starfall effect. if (m_caster->hasUnitState(UNIT_STAT_NO_FREE_MOVE)) return; @@ -2969,7 +2969,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) if (m_caster->GetTypeId() != TYPEID_PLAYER) return; - //immediately finishes the cooldown on certain Rogue abilities + // immediately finishes the cooldown on certain Rogue abilities const SpellCooldowns& cm = ((Player*)m_caster)->GetSpellCooldownMap(); for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();) { @@ -3047,7 +3047,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) if (m_caster->GetTypeId() != TYPEID_PLAYER) return; - //immediately finishes the cooldown for hunter abilities + // immediately finishes the cooldown for hunter abilities const SpellCooldowns& cm = ((Player*)m_caster)->GetSpellCooldownMap(); for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();) { @@ -4001,7 +4001,7 @@ void Spell::EffectPowerDrain(SpellEffectIndex eff_idx) uint32 curPower = unitTarget->GetPower(drain_power); - //add spell damage bonus + // add spell damage bonus damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); @@ -4622,7 +4622,7 @@ void Spell::EffectOpenLock(SpellEffectIndex eff_idx) if ((goInfo->type == GAMEOBJECT_TYPE_BUTTON && goInfo->button.noDamageImmune) || (goInfo->type == GAMEOBJECT_TYPE_GOOBER && goInfo->goober.losOK)) { - //CanUseBattleGroundObject() already called in CheckCast() + // CanUseBattleGroundObject() already called in CheckCast() // in battleground check if (BattleGround* bg = player->GetBattleGround()) { @@ -4634,7 +4634,7 @@ void Spell::EffectOpenLock(SpellEffectIndex eff_idx) } else if (goInfo->type == GAMEOBJECT_TYPE_FLAGSTAND) { - //CanUseBattleGroundObject() already called in CheckCast() + // CanUseBattleGroundObject() already called in CheckCast() // in battleground check if (BattleGround* bg = player->GetBattleGround()) { @@ -5047,7 +5047,7 @@ bool Spell::DoSummonCritter(CreatureSummonPositions& list, SummonPropertiesEntry critter->SetSummonPoint(pos); - //critter->SetName(""); // generated by client + // critter->SetName(""); // generated by client critter->SetOwnerGuid(m_caster->GetObjectGuid()); critter->SetCreatorGuid(m_caster->GetObjectGuid()); @@ -5055,7 +5055,7 @@ bool Spell::DoSummonCritter(CreatureSummonPositions& list, SummonPropertiesEntry critter->InitPetCreateSpells(); // e.g. disgusting oozeling has a create spell as critter... - //critter->InitLevelupSpellsForLevel(); // none? + // critter->InitLevelupSpellsForLevel(); // none? critter->SelectLevel(critter->GetCreatureInfo()); // some summoned creaters have different from 1 DB data for level/hp critter->SetUInt32Value(UNIT_NPC_FLAGS, critter->GetCreatureInfo()->npcflag); // some mini-pets have quests @@ -5124,7 +5124,7 @@ bool Spell::DoSummonGuardian(CreatureSummonPositions& list, SummonPropertiesEntr if (m_duration > 0) spawnCreature->SetDuration(m_duration); - //spawnCreature->SetName(""); // generated by client + // spawnCreature->SetName(""); // generated by client spawnCreature->SetOwnerGuid(m_caster->GetObjectGuid()); spawnCreature->setPowerType(POWER_MANA); spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS, spawnCreature->GetCreatureInfo()->npcflag); @@ -5178,7 +5178,7 @@ bool Spell::DoSummonTotem(SpellEffectIndex eff_idx, uint8 slot_dbc) if (slot < MAX_TOTEM_SLOT) m_caster->_AddTotem(TotemSlot(slot), pTotem); - //pTotem->SetName(""); // generated by client + // pTotem->SetName(""); // generated by client pTotem->SetOwner(m_caster); pTotem->SetTypeBySummonSpell(m_spellInfo); // must be after Create call where m_spells initialized @@ -5348,7 +5348,7 @@ bool Spell::DoSummonPet(SpellEffectIndex eff_idx) spawnCreature->SetHealth(spawnCreature->GetMaxHealth()); spawnCreature->SetPower(POWER_MANA, spawnCreature->GetMaxPower(POWER_MANA)); - //spawnCreature->SetName(""); // generated by client + // spawnCreature->SetName(""); // generated by client map->Add((Creature*)spawnCreature); @@ -5570,7 +5570,7 @@ void Spell::EffectPickPocket(SpellEffectIndex /*eff_idx*/) if (chance > irand(0, 19)) { // Stealing successful - //DEBUG_LOG("Sending loot from pickpocket"); + // DEBUG_LOG("Sending loot from pickpocket"); ((Player*)m_caster)->SendLoot(unitTarget->GetObjectGuid(), LOOT_PICKPOCKETING); } else @@ -5654,7 +5654,7 @@ void Spell::EffectAddHonor(SpellEffectIndex /*eff_idx*/) } else { - //maybe we have correct honor_gain in damage already + // maybe we have correct honor_gain in damage already ((Player*)unitTarget)->RewardHonor(NULL, 1, (float)damage); sLog.outError("SpellEffect::AddHonor (spell_id %u) rewards %u honor points (non scale) for player: %u", m_spellInfo->Id, damage, ((Player*)unitTarget)->GetGUIDLow()); } @@ -5909,7 +5909,7 @@ void Spell::EffectTameCreature(SpellEffectIndex /*eff_idx*/) Creature* creatureTarget = (Creature*)unitTarget; // cast finish successfully - //SendChannelUpdate(0); + // SendChannelUpdate(0); finish(); Pet* pet = new Pet(HUNTER_PET); @@ -6165,7 +6165,7 @@ void Spell::EffectWeaponDmg(SpellEffectIndex eff_idx) case SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL: case SPELL_EFFECT_NORMALIZED_WEAPON_DMG: case SPELL_EFFECT_WEAPON_PERCENT_DAMAGE: - if (j < int(eff_idx)) // we must calculate only at last weapon effect + if (j < int(eff_idx)) // we must calculate only at last weapon effect return; break; } @@ -6565,7 +6565,7 @@ void Spell::EffectSummonObjectWild(SpellEffectIndex eff_idx) switch (pGameObj->GetMapId()) { - case 489: //WS + case 489: // WS { if (bg && bg->GetTypeID() == BATTLEGROUND_WS && bg->GetStatus() == STATUS_IN_PROGRESS) { @@ -6575,7 +6575,7 @@ void Spell::EffectSummonObjectWild(SpellEffectIndex eff_idx) } break; } - case 566: //EY + case 566: // EY { if (bg && bg->GetTypeID() == BATTLEGROUND_EY && bg->GetStatus() == STATUS_IN_PROGRESS) { @@ -7548,7 +7548,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx) unitTarget->CastSpell(m_caster, m_spellInfo->Id == 49380 ? 49381 : 59805, true, NULL, NULL, m_caster->GetObjectGuid()); return; } - case 49405: //Invader Taunt Trigger + case 49405: // Invader Taunt Trigger { if (!unitTarget) return; @@ -8325,7 +8325,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx) if (familyFlag.IsFitToFamilyMask(UI64LIT(0x0000000000008000))) spellId = 53359; // Chimera Shot - Scorpid // ?? nothing say in spell desc (possibly need addition check) - //if ((familyFlag & UI64LIT(0x0000010000000000)) || // dot + // if ((familyFlag & UI64LIT(0x0000010000000000)) || // dot // (familyFlag & UI64LIT(0x0000100000000000))) // stun //{ // spellId = 53366; // 53366 Chimera Shot - Wyvern @@ -8528,7 +8528,7 @@ void Spell::EffectSanctuary(SpellEffectIndex /*eff_idx*/) { if (!unitTarget) return; - //unitTarget->CombatStop(); + // unitTarget->CombatStop(); unitTarget->CombatStop(); unitTarget->getHostileRefManager().deleteReferences(); // stop all fighting @@ -8579,7 +8579,7 @@ void Spell::EffectDuel(SpellEffectIndex eff_idx) return; } - //CREATE DUEL FLAG OBJECT + // CREATE DUEL FLAG OBJECT GameObject* pGameObj = new GameObject; uint32 gameobject_id = m_spellInfo->EffectMiscValue[eff_idx]; @@ -8603,7 +8603,7 @@ void Spell::EffectDuel(SpellEffectIndex eff_idx) m_caster->AddGameObject(pGameObj); map->Add(pGameObj); - //END + // END // Send request WorldPacket data(SMSG_DUEL_REQUESTED, 8 + 8); @@ -9045,9 +9045,9 @@ void Spell::EffectQuestComplete(SpellEffectIndex eff_idx) } // TODO: implement these! // "this spell awards credit for the entire raid (all spell targets as this is area target) if just ONE member has both auras (yes, both effect's basepoints)" - //case 72155: // Harvest Blight Specimen - //case 72162: // Harvest Blight Specimen - //break; + // case 72155: // Harvest Blight Specimen + // case 72162: // Harvest Blight Specimen + // break; default: break; } @@ -9121,7 +9121,7 @@ void Spell::EffectCharge(SpellEffectIndex /*eff_idx*/) if (!unitTarget) return; - //TODO: research more ContactPoint/attack distance. + // TODO: research more ContactPoint/attack distance. //3.666666 instead of ATTACK_DISTANCE(5.0f) in below seem to give more accurate result. float x, y, z; unitTarget->GetContactPoint(m_caster, x, y, z, 3.666666f); @@ -9365,7 +9365,7 @@ void Spell::EffectTransmitted(SpellEffectIndex eff_idx) fy = m_targets.m_destY; fz = m_targets.m_destZ; } - //FIXME: this can be better check for most objects but still hack + // FIXME: this can be better check for most objects but still hack else if (m_spellInfo->EffectRadiusIndex[eff_idx] && m_spellInfo->speed == 0) { float dis = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[eff_idx])); @@ -9471,8 +9471,8 @@ void Spell::EffectTransmitted(SpellEffectIndex eff_idx) pGameObj->SetSpellId(m_spellInfo->Id); DEBUG_LOG("AddObject at SpellEfects.cpp EffectTransmitted"); - //m_caster->AddGameObject(pGameObj); - //m_ObjToDel.push_back(pGameObj); + // m_caster->AddGameObject(pGameObj); + // m_ObjToDel.push_back(pGameObj); cMap->Add(pGameObj); diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index 021d0eb5d..8d176573c 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -176,7 +176,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) return; } - //Note: If script stop casting it must send appropriate data to client to prevent stuck item in gray state. + // Note: If script stop casting it must send appropriate data to client to prevent stuck item in gray state. if (!sScriptMgr.OnItemUse(pUser, pItem, targets)) { // no script or script not process request by self @@ -367,8 +367,8 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) if (!((Player*)mover)->HasActiveSpell(spellId) || IsPassiveSpell(spellInfo)) { sLog.outError("World: Player %u casts spell %u which he shouldn't have", mover->GetGUIDLow(), spellId); - //cheater? kick? ban? - recvPacket.rpos(recvPacket.wpos()); // prevent spam at ignore packet + // cheater? kick? ban? + recvPacket.rpos(recvPacket.wpos()); // prevent spam at ignore packet return; } } @@ -377,8 +377,8 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) // not have spell in spellbook or spell passive and not casted by client if (!((Creature*)mover)->HasSpell(spellId) || IsPassiveSpell(spellInfo)) { - //cheater? kick? ban? - recvPacket.rpos(recvPacket.wpos()); // prevent spam at ignore packet + // cheater? kick? ban? + recvPacket.rpos(recvPacket.wpos()); // prevent spam at ignore packet return; } } @@ -432,7 +432,7 @@ void WorldSession::HandleCancelCastOpcode(WorldPacket& recvPacket) if (mover != _player && mover->GetTypeId() == TYPEID_PLAYER) return; - //FIXME: hack, ignore unexpected client cancel Deadly Throw cast + // FIXME: hack, ignore unexpected client cancel Deadly Throw cast if (spellId == 26679) return; diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 5b99627ec..95172121a 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -780,7 +780,7 @@ bool IsPositiveEffect(SpellEntry const* spellproto, SpellEffectIndex effIndex) case SPELL_AURA_PROC_TRIGGER_SPELL: // many positive auras have negative triggered spells at damage for example and this not make it negative (it can be canceled for example) break; - case SPELL_AURA_MOD_STUN: //have positive and negative spells, we can't sort its correctly at this moment. + case SPELL_AURA_MOD_STUN: // have positive and negative spells, we can't sort its correctly at this moment. if (effIndex == EFFECT_INDEX_0 && spellproto->Effect[EFFECT_INDEX_1] == 0 && spellproto->Effect[EFFECT_INDEX_2] == 0) return false; // but all single stun aura spells is negative @@ -1018,7 +1018,7 @@ SpellCastResult GetErrorAtShapeshiftedCast(SpellEntry const* spellInfo, uint32 f void SpellMgr::LoadSpellTargetPositions() { - mSpellTargetPositions.clear(); // need for reload case + mSpellTargetPositions.clear(); // need for reload case uint32 count = 0; @@ -1541,7 +1541,7 @@ void SpellMgr::LoadSpellBonuses() } } - //TODO: maybe add explicit list possible direct damage spell effects... + // TODO: maybe add explicit list possible direct damage spell effects... if (x < MAX_EFFECT_INDEX) need_direct = true; @@ -2110,7 +2110,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons (spellInfo_2->SpellIconID == 152 && spellInfo_1->SpellIconID == 546)) return false; - //Corruption & Seed of corruption + // Corruption & Seed of corruption if ((spellInfo_1->SpellIconID == 313 && spellInfo_2->SpellIconID == 1932) || (spellInfo_2->SpellIconID == 313 && spellInfo_1->SpellIconID == 1932)) if (spellInfo_1->SpellVisual[0] != 0 && spellInfo_2->SpellVisual[0] != 0) @@ -2184,12 +2184,12 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons case SPELLFAMILY_PRIEST: if (spellInfo_2->SpellFamilyName == SPELLFAMILY_PRIEST) { - //Devouring Plague and Shadow Vulnerability + // Devouring Plague and Shadow Vulnerability if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x2000000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x800000000))) || ((spellInfo_2->SpellFamilyFlags & UI64LIT(0x2000000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x800000000)))) return false; - //StarShards and Shadow Word: Pain + // StarShards and Shadow Word: Pain if (((spellInfo_1->SpellFamilyFlags & UI64LIT(0x200000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x8000))) || ((spellInfo_2->SpellFamilyFlags & UI64LIT(0x200000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x8000)))) return false; @@ -2203,7 +2203,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons case SPELLFAMILY_DRUID: if (spellInfo_2->SpellFamilyName == SPELLFAMILY_DRUID) { - //Omen of Clarity and Blood Frenzy + // Omen of Clarity and Blood Frenzy if (((spellInfo_1->SpellFamilyFlags == UI64LIT(0x0) && spellInfo_1->SpellIconID == 108) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x20000000000000))) || ((spellInfo_2->SpellFamilyFlags == UI64LIT(0x0) && spellInfo_2->SpellIconID == 108) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x20000000000000)))) return false; @@ -2276,7 +2276,7 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons return false; } - //Overkill + // Overkill if (spellInfo_1->SpellIconID == 2285 && spellInfo_2->SpellIconID == 2285) return false; @@ -2697,7 +2697,7 @@ void SpellMgr::LoadSpellChains() if (!sSpellStore.LookupEntry(spell_id)) { - //sLog.outErrorDb("Talent %u not exist as spell",spell_id); + // sLog.outErrorDb("Talent %u not exist as spell",spell_id); continue; } @@ -2725,7 +2725,7 @@ void SpellMgr::LoadSpellChains() // some forward spells not exist and can be ignored (some outdated data) SpellEntry const* spell_entry = sSpellStore.LookupEntry(spell_id); - if (!spell_entry) // no cases + if (!spell_entry) // no cases continue; // ignore spell without forwards (non ranked or missing info in skill abilities) @@ -3339,7 +3339,7 @@ void SpellMgr::LoadSpellScriptTarget() void SpellMgr::LoadSpellPetAuras() { - mSpellPetAuraMap.clear(); // need for reload case + mSpellPetAuraMap.clear(); // need for reload case uint32 count = 0; diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index 2761adbc6..05f07c294 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -184,7 +184,7 @@ bool IsNoStackAuraDueToAura(uint32 spellId_1, uint32 spellId_2); inline bool IsSealSpell(SpellEntry const* spellInfo) { - //Collection of all the seal family flags. No other paladin spell has any of those. + // Collection of all the seal family flags. No other paladin spell has any of those. return spellInfo->IsFitToFamily(SPELLFAMILY_PALADIN, UI64LIT(0x26000C000A000000)) && // avoid counting target triggered effect as seal for avoid remove it or seal by it. spellInfo->EffectImplicitTargetA[EFFECT_INDEX_0] == TARGET_SELF; @@ -201,7 +201,7 @@ inline bool IsExplicitDiscoverySpell(SpellEntry const* spellInfo) return (((spellInfo->Effect[EFFECT_INDEX_0] == SPELL_EFFECT_CREATE_RANDOM_ITEM || spellInfo->Effect[EFFECT_INDEX_0] == SPELL_EFFECT_CREATE_ITEM_2) && spellInfo->Effect[EFFECT_INDEX_1] == SPELL_EFFECT_SCRIPT_EFFECT) - || spellInfo->Id == 64323); // Book of Glyph Mastery (Effect0==SPELL_EFFECT_SCRIPT_EFFECT without any other data) + || spellInfo->Id == 64323); // Book of Glyph Mastery (Effect0==SPELL_EFFECT_SCRIPT_EFFECT without any other data) } inline bool IsLootCraftingSpell(SpellEntry const* spellInfo) diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index 511b04dc0..d034eceea 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -60,7 +60,7 @@ bool Player::UpdateStats(Stats stat) case STAT_INTELLECT: UpdateMaxPower(POWER_MANA); UpdateAllSpellCritChances(); - UpdateArmor(); //SPELL_AURA_MOD_RESISTANCE_OF_INTELLECT_PERCENT, only armor currently + UpdateArmor(); // SPELL_AURA_MOD_RESISTANCE_OF_INTELLECT_PERCENT, only armor currently break; case STAT_SPIRIT: @@ -169,7 +169,7 @@ void Player::UpdateArmor() value += GetStat(STAT_AGILITY) * 2.0f; // armor bonus from stats value += GetModifierValue(unitMod, TOTAL_VALUE); - //add dynamic flat mods + // add dynamic flat mods AuraList const& mResbyIntellect = GetAurasByType(SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT); for (AuraList::const_iterator i = mResbyIntellect.begin(); i != mResbyIntellect.end(); ++i) { @@ -293,7 +293,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) case CLASS_DRUID: { ShapeshiftForm form = GetShapeshiftForm(); - //Check if Predatory Strikes is skilled + // Check if Predatory Strikes is skilled float mLevelBonus = 0.0f; float mBonusWeaponAtt = 0.0f; switch (form) @@ -349,7 +349,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) float base_attPower = GetModifierValue(unitMod, BASE_VALUE) * GetModifierValue(unitMod, BASE_PCT); float attPowerMod = GetModifierValue(unitMod, TOTAL_VALUE); - //add dynamic flat mods + // add dynamic flat mods if (ranged) { if ((getClassMask() & CLASSMASK_WAND_USERS) == 0) @@ -373,23 +373,23 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f; - SetInt32Value(index, (uint32)base_attPower); //UNIT_FIELD_(RANGED)_ATTACK_POWER field - SetInt32Value(index_mod, (uint32)attPowerMod); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field - SetFloatValue(index_mult, attPowerMultiplier); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field + SetInt32Value(index, (uint32)base_attPower); // UNIT_FIELD_(RANGED)_ATTACK_POWER field + SetInt32Value(index_mod, (uint32)attPowerMod); // UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field + SetFloatValue(index_mult, attPowerMultiplier); // UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field - //automatically update weapon damage after attack power modification + // automatically update weapon damage after attack power modification if (ranged) { UpdateDamagePhysical(RANGED_ATTACK); - Pet* pet = GetPet(); //update pet's AP + Pet* pet = GetPet(); // update pet's AP if (pet) pet->UpdateAttackPowerAndDamage(); } else { UpdateDamagePhysical(BASE_ATTACK); - if (CanDualWield() && haveOffhandWeapon()) //allow update offhand damage only if player knows DualWield Spec and has equipped offhand weapon + if (CanDualWield() && haveOffhandWeapon()) // allow update offhand damage only if player knows DualWield Spec and has equipped offhand weapon UpdateDamagePhysical(OFF_ATTACK); } } @@ -881,14 +881,14 @@ void Creature::UpdateAttackPowerAndDamage(bool ranged) float attPowerMod = GetModifierValue(unitMod, TOTAL_VALUE); float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f; - SetInt32Value(index, (uint32)base_attPower); //UNIT_FIELD_(RANGED)_ATTACK_POWER field - SetInt32Value(index_mod, (uint32)attPowerMod); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field - SetFloatValue(index_mult, attPowerMultiplier); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field + SetInt32Value(index, (uint32)base_attPower); // UNIT_FIELD_(RANGED)_ATTACK_POWER field + SetInt32Value(index_mod, (uint32)attPowerMod); // UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field + SetFloatValue(index_mult, attPowerMultiplier); // UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field if (ranged) return; - //automatically update weapon damage after attack power modification + // automatically update weapon damage after attack power modification UpdateDamagePhysical(BASE_ATTACK); UpdateDamagePhysical(OFF_ATTACK); } @@ -938,7 +938,7 @@ bool Pet::UpdateStats(Stats stat) if (owner) value += float(owner->GetStat(stat)) * 0.3f; } - //warlock's and mage's pets gain 30% of owner's intellect + // warlock's and mage's pets gain 30% of owner's intellect else if (stat == STAT_INTELLECT && getPetType() == SUMMON_PET) { if (owner && (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE)) @@ -1056,12 +1056,12 @@ void Pet::UpdateAttackPowerAndDamage(bool ranged) Unit* owner = GetOwner(); if (owner && owner->GetTypeId() == TYPEID_PLAYER) { - if (getPetType() == HUNTER_PET) //hunter pets benefit from owner's attack power + if (getPetType() == HUNTER_PET) // hunter pets benefit from owner's attack power { bonusAP = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.22f; SetBonusDamage(int32(owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.1287f)); } - //demons benefit from warlocks shadow or fire damage + // demons benefit from warlocks shadow or fire damage else if (getPetType() == SUMMON_PET && owner->getClass() == CLASS_WARLOCK) { int32 fire = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE); @@ -1072,7 +1072,7 @@ void Pet::UpdateAttackPowerAndDamage(bool ranged) SetBonusDamage(int32(maximum * 0.15f)); bonusAP = maximum * 0.57f; } - //water elementals benefit from mage's frost damage + // water elementals benefit from mage's frost damage else if (getPetType() == SUMMON_PET && owner->getClass() == CLASS_MAGE) { int32 frost = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FROST)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FROST); @@ -1084,19 +1084,19 @@ void Pet::UpdateAttackPowerAndDamage(bool ranged) SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, val + bonusAP); - //in BASE_VALUE of UNIT_MOD_ATTACK_POWER for creatures we store data of meleeattackpower field in DB + // in BASE_VALUE of UNIT_MOD_ATTACK_POWER for creatures we store data of meleeattackpower field in DB float base_attPower = GetModifierValue(unitMod, BASE_VALUE) * GetModifierValue(unitMod, BASE_PCT); float attPowerMod = GetModifierValue(unitMod, TOTAL_VALUE); float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f; - //UNIT_FIELD_(RANGED)_ATTACK_POWER field + // UNIT_FIELD_(RANGED)_ATTACK_POWER field SetInt32Value(UNIT_FIELD_ATTACK_POWER, (int32)base_attPower); - //UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field + // UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field SetInt32Value(UNIT_FIELD_ATTACK_POWER_MODS, (int32)attPowerMod); - //UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field + // UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field SetFloatValue(UNIT_FIELD_ATTACK_POWER_MULTIPLIER, attPowerMultiplier); - //automatically update weapon damage after attack power modification + // automatically update weapon damage after attack power modification UpdateDamagePhysical(BASE_ATTACK); } diff --git a/src/game/TargetedMovementGenerator.cpp b/src/game/TargetedMovementGenerator.cpp index 0e29641e7..2c25d1061 100644 --- a/src/game/TargetedMovementGenerator.cpp +++ b/src/game/TargetedMovementGenerator.cpp @@ -67,7 +67,7 @@ void TargetedMovementGeneratorMedium::_setTargetLocation(T& owner) The system will freeze. ralf - //We don't update Mob Movement, if the difference between New destination and last destination is < BothObjectSize + // We don't update Mob Movement, if the difference between New destination and last destination is < BothObjectSize float bothObjectSize = i_target->GetObjectBoundingRadius() + owner.GetObjectBoundingRadius() + CONTACT_DISTANCE; if( i_destinationHolder.HasDestination() && i_destinationHolder.GetDestinationDiff(x,y,z) < bothObjectSize ) return; @@ -154,7 +154,7 @@ bool TargetedMovementGeneratorMedium::Update(T& owner, const uint32& time_ { i_recheckDistance.Reset(100); - //More distance let have better performance, less distance let have more sensitive reaction at target move. + // More distance let have better performance, less distance let have more sensitive reaction at target move. float allowed_dist = owner.GetObjectBoundingRadius() + sWorld.getConfig(CONFIG_FLOAT_RATE_TARGET_POS_RECALCULATION_RANGE); G3D::Vector3 dest = owner.movespline->FinalDestination(); diff --git a/src/game/ThreatManager.cpp b/src/game/ThreatManager.cpp index f2dff1afd..cd7c22f14 100644 --- a/src/game/ThreatManager.cpp +++ b/src/game/ThreatManager.cpp @@ -406,10 +406,10 @@ void ThreatManager::clearReferences() void ThreatManager::addThreat(Unit* pVictim, float pThreat, bool crit, SpellSchoolMask schoolMask, SpellEntry const* pThreatSpell) { - //function deals with adding threat and adding players and pets into ThreatList - //mobs, NPCs, guards have ThreatList and HateOfflineList - //players and pets have only InHateListOf - //HateOfflineList is used co contain unattackable victims (in-flight, in-water, GM etc.) + // function deals with adding threat and adding players and pets into ThreatList + // mobs, NPCs, guards have ThreatList and HateOfflineList + // players and pets have only InHateListOf + // HateOfflineList is used co contain unattackable victims (in-flight, in-water, GM etc.) // not to self if (pVictim == getOwner()) diff --git a/src/game/Totem.cpp b/src/game/Totem.cpp index 9734d267f..a854c3a25 100644 --- a/src/game/Totem.cpp +++ b/src/game/Totem.cpp @@ -58,9 +58,9 @@ bool Totem::Create(uint32 guidlow, CreatureCreatePos& cPos, CreatureInfo const* if (!cPos.Relocate(this)) return false; - //Notify the map's instance data. - //Only works if you create the object in it, not if it is moves to that map. - //Normally non-players do not teleport to other maps. + // Notify the map's instance data. + // Only works if you create the object in it, not if it is moves to that map. + // Normally non-players do not teleport to other maps. if (InstanceData* iData = GetMap()->GetInstanceData()) iData->OnCreatureCreate(this); @@ -123,7 +123,7 @@ void Totem::UnSummon() owner->_RemoveTotem(this); owner->RemoveAurasDueToSpell(GetSpell()); - //remove aura all party members too + // remove aura all party members too if (owner->GetTypeId() == TYPEID_PLAYER) { ((Player*)owner)->SendAutoRepeatCancel(this); @@ -178,7 +178,7 @@ void Totem::SetTypeBySummonSpell(SpellEntry const* spellProto) m_type = TOTEM_ACTIVE; } if (spellProto->SpellIconID == 2056) - m_type = TOTEM_STATUE; //Jewelery statue + m_type = TOTEM_STATUE; // Jewelery statue } bool Totem::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const diff --git a/src/game/TotemAI.cpp b/src/game/TotemAI.cpp index fb5340d54..32006d10f 100644 --- a/src/game/TotemAI.cpp +++ b/src/game/TotemAI.cpp @@ -91,7 +91,7 @@ TotemAI::UpdateAI(const uint32 /*diff*/) i_victimGuid = victim->GetObjectGuid(); // attack - m_creature->SetInFront(victim); // client change orientation by self + m_creature->SetInFront(victim); // client change orientation by self m_creature->CastSpell(victim, getTotem().GetSpell(), false); } else diff --git a/src/game/TradeHandler.cpp b/src/game/TradeHandler.cpp index 5211a54bb..6e8a7c170 100644 --- a/src/game/TradeHandler.cpp +++ b/src/game/TradeHandler.cpp @@ -218,7 +218,7 @@ static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item** m if (Item* item = myTrade->GetItem(TradeSlots(i))) { DEBUG_LOG("player trade %s bag: %u slot: %u", item->GetGuidStr().c_str(), item->GetBagSlot(), item->GetSlot()); - //Can return NULL + // Can return NULL myItems[i] = item; myItems[i]->SetInTrade(); } diff --git a/src/game/Transports.cpp b/src/game/Transports.cpp index 67b4ecabc..5bd9fb9f0 100644 --- a/src/game/Transports.cpp +++ b/src/game/Transports.cpp @@ -91,7 +91,7 @@ void MapManager::LoadTransports() uint32 mapid; x = t->m_WayPoints[0].x; y = t->m_WayPoints[0].y; z = t->m_WayPoints[0].z; mapid = t->m_WayPoints[0].mapid; o = 1; - //current code does not support transports in dungeon! + // current code does not support transports in dungeon! const MapEntry* pMapInfo = sMapStore.LookupEntry(mapid); if (!pMapInfo || pMapInfo->Instanceable()) { @@ -111,10 +111,10 @@ void MapManager::LoadTransports() for (std::set::const_iterator i = mapsUsed.begin(); i != mapsUsed.end(); ++i) m_TransportsByMap[*i].insert(t); - //If we someday decide to use the grid to track transports, here: + // If we someday decide to use the grid to track transports, here: t->SetMap(sMapMgr.CreateMap(mapid, t)); - //t->GetMap()->Add((GameObject *)t); + // t->GetMap()->Add((GameObject *)t); ++count; } while (result->NextRow()); @@ -174,7 +174,7 @@ bool Transport::Create(uint32 guidlow, uint32 mapid, float x, float y, float z, SetObjectScale(goinfo->size); SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction); - //SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); + // SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags); SetUInt32Value(GAMEOBJECT_FLAGS, (GO_FLAG_TRANSPORT | GO_FLAG_NODESPAWN)); SetUInt32Value(GAMEOBJECT_LEVEL, m_period); SetEntry(goinfo->id); @@ -408,7 +408,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set& mapids) // sLog.outString("T: %d, x: %f, y: %f, z: %f, t:%d", t, pos.x, pos.y, pos.z, teleport); - //if (teleport) + // if (teleport) m_WayPoints[t] = pos; t += keyFrames[i + 1].node->delay * 1000; @@ -462,14 +462,14 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z) } plr->TeleportTo(newMapid, x, y, z, GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT); - //WorldPacket data(SMSG_811, 4); - //data << uint32(0); - //plr->GetSession()->SendPacket(&data); + // WorldPacket data(SMSG_811, 4); + // data << uint32(0); + // plr->GetSession()->SendPacket(&data); } - //we need to create and save new Map object with 'newMapid' because if not done -> lead to invalid Map object reference... - //player far teleport would try to create same instance, but we need it NOW for transport... - //correct me if I'm wrong O.o + // we need to create and save new Map object with 'newMapid' because if not done -> lead to invalid Map object reference... + // player far teleport would try to create same instance, but we need it NOW for transport... + // correct me if I'm wrong O.o Map* newMap = sMapMgr.CreateMap(newMapid, this); SetMap(newMap); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 54f220dad..5819604a5 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -210,9 +210,9 @@ Unit::Unit() : m_castCounter = 0; - //m_Aura = NULL; - //m_AurasCheck = 2000; - //m_removeAuraTimer = 4; + // m_Aura = NULL; + // m_AurasCheck = 2000; + // m_removeAuraTimer = 4; m_spellAuraHoldersUpdateIterator = m_spellAuraHolders.end(); m_AuraFlags = 0; @@ -254,7 +254,7 @@ Unit::Unit() : m_CombatTimer = 0; m_lastManaUseTimer = 0; - //m_victimThreat = 0.0f; + // m_victimThreat = 0.0f; for (int i = 0; i < MAX_SPELL_SCHOOL; ++i) m_threatModifier[i] = 1.0f; m_isSorted = true; @@ -507,8 +507,8 @@ void Unit::DealDamageMods(Unit* pVictim, uint32& damage, uint32* absorb) return; } - //You don't lose health from damage taken from another player while in a sanctuary - //You still see it in the combat log though + // You don't lose health from damage taken from another player while in a sanctuary + // You still see it in the combat log though if (!IsAllowedDamageInArea(pVictim)) { if (absorb) @@ -518,10 +518,10 @@ void Unit::DealDamageMods(Unit* pVictim, uint32& damage, uint32* absorb) uint32 originalDamage = damage; - //Script Event damage Deal + // Script Event damage Deal if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->AI()) ((Creature*)this)->AI()->DamageDeal(pVictim, damage); - //Script Event damage taken + // Script Event damage taken if (pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->AI()) ((Creature*)pVictim)->AI()->DamageTaken(this, damage); @@ -588,7 +588,7 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa duel_hasEnded = true; } - //Get in CombatState + // Get in CombatState if (pVictim != this && damagetype != DOT) { SetInCombatWith(pVictim); @@ -692,9 +692,9 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa { player_tap->ProcDamageAndSpell(pVictim, PROC_FLAG_KILL, PROC_FLAG_KILLED, PROC_EX_NONE, 0); - WorldPacket data(SMSG_PARTYKILLLOG, (8 + 8)); //send event PARTY_KILL - data << player_tap->GetObjectGuid(); //player with killing blow - data << pVictim->GetObjectGuid(); //victim + WorldPacket data(SMSG_PARTYKILLLOG, (8 + 8)); // send event PARTY_KILL + data << player_tap->GetObjectGuid(); // player with killing blow + data << pVictim->GetObjectGuid(); // victim if (group_tap) group_tap->BroadcastPacket(&data, false, group_tap->GetMemberGroup(player_tap->GetObjectGuid()), player_tap->GetObjectGuid()); @@ -750,7 +750,7 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa if (!ressSpellId) ressSpellId = ((Player*)pVictim)->GetResurrectionSpellId(); - //Remove all expected to remove at death auras (most important negative case like DoT or periodic triggers) + // Remove all expected to remove at death auras (most important negative case like DoT or periodic triggers) pVictim->RemoveAllAurasOnDeath(); // restore for use at real death @@ -846,7 +846,7 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa if (!getVictim()) { // if not have main target then attack state with target (including AI call) - //start melee attacks only after melee hit + // start melee attacks only after melee hit Attack(pVictim, (damagetype == DIRECT_DAMAGE)); } @@ -936,7 +936,7 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa uint32 channelInterruptFlags = spell->m_spellInfo->ChannelInterruptFlags; if (channelInterruptFlags & CHANNEL_FLAG_DELAY) { - if (pVictim != this) //don't shorten the duration of channeling if you damage yourself + if (pVictim != this) // don't shorten the duration of channeling if you damage yourself spell->DelayedChannel(); } else if ((channelInterruptFlags & (CHANNEL_FLAG_DAMAGE | CHANNEL_FLAG_DAMAGE2))) @@ -1302,7 +1302,7 @@ void Unit::CalculateSpellDamage(SpellNonMeleeDamage* damageInfo, int32 damage, S case SPELL_DAMAGE_CLASS_RANGED: case SPELL_DAMAGE_CLASS_MELEE: { - //Calculate damage bonus + // Calculate damage bonus damage = MeleeDamageBonusDone(pVictim, damage, attackType, spellInfo, SPELL_DIRECT_DAMAGE); damage = pVictim->MeleeDamageBonusTaken(this, damage, attackType, spellInfo, SPELL_DIRECT_DAMAGE); @@ -1383,8 +1383,8 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss) return; } - //You don't lose health from damage taken from another player while in a sanctuary - //You still see it in the combat log though + // You don't lose health from damage taken from another player while in a sanctuary + // You still see it in the combat log though if (!IsAllowedDamageInArea(pVictim)) return; @@ -1393,7 +1393,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss) DealDamage(pVictim, damageInfo->damage, &cleanDamage, SPELL_DIRECT_DAMAGE, damageInfo->schoolMask, spellProto, durabilityLoss); } -//TODO for melee need create structure as in +// TODO for melee need create structure as in void Unit::CalculateMeleeDamage(Unit* pVictim, uint32 damage, CalcDamageInfo* damageInfo, WeaponAttackType attackType) { damageInfo->attacker = this; @@ -1574,7 +1574,7 @@ void Unit::CalculateMeleeDamage(Unit* pVictim, uint32 damage, CalcDamageInfo* da damageInfo->HitInfo |= HITINFO_GLANCING; damageInfo->TargetState = VICTIMSTATE_NORMAL; damageInfo->procEx |= PROC_EX_NORMAL_HIT; - float reducePercent = 1.0f; //damage factor + float reducePercent = 1.0f; // damage factor // calculate base values and mods float baseLowEnd = 1.3f; float baseHighEnd = 1.2f; @@ -1595,7 +1595,7 @@ void Unit::CalculateMeleeDamage(Unit* pVictim, uint32 damage, CalcDamageInfo* da { case CLASS_WARRIOR: case CLASS_ROGUE: - maxLowEnd = 0.91f; //If the attacker is a melee class then instead the lower value of 0.91 + maxLowEnd = 0.91f; // If the attacker is a melee class then instead the lower value of 0.91 } // calculate values @@ -1604,12 +1604,12 @@ void Unit::CalculateMeleeDamage(Unit* pVictim, uint32 damage, CalcDamageInfo* da float highEnd = baseHighEnd - (0.03f * diff); // apply max/min bounds - if (lowEnd < 0.01f) //the low end must not go bellow 0.01f + if (lowEnd < 0.01f) // the low end must not go bellow 0.01f lowEnd = 0.01f; - else if (lowEnd > maxLowEnd) //the smaller value of this and 0.6 is kept as the low end + else if (lowEnd > maxLowEnd) // the smaller value of this and 0.6 is kept as the low end lowEnd = maxLowEnd; - if (highEnd < 0.2f) //high end limits + if (highEnd < 0.2f) // high end limits highEnd = 0.2f; if (highEnd > 0.99f) highEnd = 0.99f; @@ -1683,8 +1683,8 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) if (!pVictim->isAlive() || pVictim->IsTaxiFlying() || (pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())) return; - //You don't lose health from damage taken from another player while in a sanctuary - //You still see it in the combat log though + // You don't lose health from damage taken from another player while in a sanctuary + // You still see it in the combat log though if (!IsAllowedDamageInArea(pVictim)) return; @@ -1742,7 +1742,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) // 20% base chance float Probability = 20.0f; - //there is a newbie protection, at level 10 just 7% base chance; assuming linear function + // there is a newbie protection, at level 10 just 7% base chance; assuming linear function if (pVictim->getLevel() < 30) Probability = 0.65f * pVictim->getLevel() + 0.5f; @@ -1775,11 +1775,11 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss) alreadyDone.insert(*i); uint32 damage = (*i)->GetModifier()->m_amount; SpellEntry const* i_spellProto = (*i)->GetSpellProto(); - //Calculate absorb resist ??? no data in opcode for this possibly unable to absorb or resist? - //uint32 absorb; - //uint32 resist; - //CalcAbsorbResist(pVictim, SpellSchools(spellProto->School), SPELL_DIRECT_DAMAGE, damage, &absorb, &resist); - //damage-=absorb + resist; + // Calculate absorb resist ??? no data in opcode for this possibly unable to absorb or resist? + // uint32 absorb; + // uint32 resist; + // CalcAbsorbResist(pVictim, SpellSchools(spellProto->School), SPELL_DIRECT_DAMAGE, damage, &absorb, &resist); + // damage-=absorb + resist; pVictim->DealDamageMods(this, damage, NULL); @@ -2033,7 +2033,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM // Astral Shift if (spellProto->SpellIconID == 3066) { - //reduces all damage taken while stun, fear or silence + // reduces all damage taken while stun, fear or silence if (unitflag & (UNIT_FLAG_STUNNED | UNIT_FLAG_FLEEING | UNIT_FLAG_SILENCED)) RemainingDamage -= RemainingDamage * currentAbsorb / 100; continue; @@ -2050,7 +2050,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM if (spellProto->SpellIconID == 3006) { // You have a chance equal to your Parry chance - if (damagetype == SPELL_DIRECT_DAMAGE && // Only for direct spell damage + if (damagetype == SPELL_DIRECT_DAMAGE &&// Only for direct spell damage roll_chance_f(GetUnitParryChance())) // Roll chance RemainingDamage -= RemainingDamage * currentAbsorb / 100; continue; @@ -2068,7 +2068,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM break; } if (spellProto->Id == 39228 || // Argussian Compass - spellProto->Id == 60218) // Essence of Gossamer + spellProto->Id == 60218) // Essence of Gossamer { // Max absorb stored in 1 dummy effect int32 max_absorb = spellProto->CalculateSimpleValue(EFFECT_INDEX_1); @@ -2083,7 +2083,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM // Primal Tenacity if (spellProto->SpellIconID == 2253) { - //reduces all damage taken while Stunned and in Cat Form + // reduces all damage taken while Stunned and in Cat Form if (GetShapeshiftForm() == FORM_CAT && (unitflag & UNIT_FLAG_STUNNED)) RemainingDamage -= RemainingDamage * currentAbsorb / 100; continue; @@ -2091,7 +2091,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM // Moonkin Form passive if (spellProto->Id == 69366) { - //reduces all damage taken while Stunned + // reduces all damage taken while Stunned if (unitflag & UNIT_FLAG_STUNNED) RemainingDamage -= RemainingDamage * currentAbsorb / 100; continue; @@ -2104,7 +2104,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM if (spellProto->SpellIconID == 2109) { if (!preventDeathSpell && - GetTypeId() == TYPEID_PLAYER && // Only players + GetTypeId() == TYPEID_PLAYER && // Only players !((Player*)this)->HasSpellCooldown(31231) && // Only if no cooldown roll_chance_i((*i)->GetModifier()->m_amount)) @@ -2162,7 +2162,7 @@ void Unit::CalculateDamageAbsorbAndResist(Unit* pCaster, SpellSchoolMask schoolM // Astral Shift if (spellProto->SpellIconID == 3066) { - //reduces all damage taken while stun, fear or silence + // reduces all damage taken while stun, fear or silence if (unitflag & (UNIT_FLAG_STUNNED | UNIT_FLAG_FLEEING | UNIT_FLAG_SILENCED)) RemainingDamage -= RemainingDamage * currentAbsorb / 100; continue; @@ -2669,7 +2669,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* pVictim, WeaponAttackT dodge_chance += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_COMBAT_RESULT_CHANCE, VICTIMSTATE_DODGE) * 100; tmp = dodge_chance; - if ((tmp > 0) // check if unit _can_ dodge + if ((tmp > 0) // check if unit _can_ dodge && ((tmp -= skillBonus) > 0) && roll < (sum += tmp)) { @@ -2692,7 +2692,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* pVictim, WeaponAttackT { parry_chance -= skillBonus; - //if (from_behind) -- only 100% currently and not 100% sure way value apply + // if (from_behind) -- only 100% currently and not 100% sure way value apply // parry_chance = int32(parry_chance * (pVictim->GetTotalAuraMultiplier(SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT) - 1); if (parry_chance > 0 && // check if unit _can_ parry @@ -2731,7 +2731,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* pVictim, WeaponAttackT if (pVictim->GetTypeId() == TYPEID_PLAYER || !(((Creature*)pVictim)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK)) { tmp = block_chance; - if ((tmp > 0) // check if unit _can_ block + if ((tmp > 0) // check if unit _can_ block && ((tmp -= skillBonus) > 0) && (roll < (sum += tmp))) { @@ -3001,7 +3001,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* pVictim, SpellEntry const* spell) { int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS) * 100; - //if (from_behind) -- only 100% currently and not 100% sure way value apply + // if (from_behind) -- only 100% currently and not 100% sure way value apply // deflect_chance = int32(deflect_chance * (pVictim->GetTotalAuraMultiplier(SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT) - 1); tmp += deflect_chance; @@ -3076,7 +3076,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* pVictim, SpellEntry const* spell) if (parryChance < 0) parryChance = 0; - //if (from_behind) -- only 100% currently and not 100% sure way value apply + // if (from_behind) -- only 100% currently and not 100% sure way value apply // parryChance = int32(parryChance * (pVictim->GetTotalAuraMultiplier(SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT) - 1)); tmp += parryChance; @@ -3163,7 +3163,7 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* pVictim, SpellEntry const* spell) { int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS) * 100; - //if (from_behind) -- only 100% currently and not 100% sure way value apply + // if (from_behind) -- only 100% currently and not 100% sure way value apply // deflect_chance = int32(deflect_chance * (pVictim->GetTotalAuraMultiplier(SPELL_AURA_MOD_PARRY_FROM_BEHIND_PERCENT)) - 1); tmp += deflect_chance; @@ -3498,7 +3498,7 @@ void Unit::_UpdateSpells(uint32 time) for (m_spellAuraHoldersUpdateIterator = m_spellAuraHolders.begin(); m_spellAuraHoldersUpdateIterator != m_spellAuraHolders.end();) { SpellAuraHolder* i_holder = m_spellAuraHoldersUpdateIterator->second; - ++m_spellAuraHoldersUpdateIterator; // need shift to next for allow update if need into aura update + ++m_spellAuraHoldersUpdateIterator; // need shift to next for allow update if need into aura update i_holder->UpdateHolder(time); } @@ -3540,7 +3540,7 @@ void Unit::_UpdateAutoRepeatSpell() { bool isAutoShot = m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id == SPELL_ID_AUTOSHOT; - //check movement + // check movement if (GetTypeId() == TYPEID_PLAYER && ((Player*)this)->isMoving()) { // cancel wand shoot @@ -3564,7 +3564,7 @@ void Unit::_UpdateAutoRepeatSpell() return; } - //castroutine + // castroutine if (isAttackReady(RANGED_ATTACK)) { // Check if able to cast @@ -4794,7 +4794,7 @@ void Unit::RemoveAura(Aura* Aur, AuraRemoveMode mode) // some ShapeshiftBoosts at remove trigger removing other auras including parent Shapeshift aura // remove aura from list before to prevent deleting it before - ///m_Auras.erase(i); + /// m_Auras.erase(i); DEBUG_FILTER_LOG(LOG_FILTER_SPELL_CAST, "Aura %u now is remove mode %d", Aur->GetModifier()->m_auraname, mode); @@ -4845,11 +4845,11 @@ void Unit::RemoveArenaAuras(bool onleave) { if (!iter->second->GetSpellProto()->HasAttribute(SPELL_ATTR_EX4_UNK21) && // don't remove stances, shadowform, pally/hunter auras - !iter->second->IsPassive() && // don't remove passive auras + !iter->second->IsPassive() && // don't remove passive auras (!iter->second->GetSpellProto()->HasAttribute(SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) || !iter->second->GetSpellProto()->HasAttribute(SPELL_ATTR_UNK8)) && // not unaffected by invulnerability auras or not having that unknown flag (that seemed the most probable) - (iter->second->IsPositive() != onleave)) // remove positive buffs on enter, negative buffs on leave + (iter->second->IsPositive() != onleave)) // remove positive buffs on enter, negative buffs on leave { RemoveSpellAuraHolder(iter->second); iter = m_spellAuraHolders.begin(); @@ -6474,7 +6474,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* pVictim, SpellEntry const* spellProto, u if ((spellProto->SpellFamilyFlags & UI64LIT(0x0000900020200021)) && (pVictim->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || pVictim->HasAuraType(SPELL_AURA_HASTE_ALL))) { - //Search for Torment the weak dummy aura + // Search for Torment the weak dummy aura Unit::AuraList const& ttw = GetAurasByType(SPELL_AURA_DUMMY); for (Unit::AuraList::const_iterator i = ttw.begin(); i != ttw.end(); ++i) { @@ -6787,15 +6787,15 @@ bool Unit::IsSpellCrit(Unit* pVictim, SpellEntry const* spellProto, SpellSchoolM continue; switch ((*i)->GetModifier()->m_miscvalue) { - case 849: //Shatter Rank 1 + case 849: // Shatter Rank 1 if (pVictim->isFrozen() || IsIgnoreUnitState(spellProto, IGNORE_UNIT_TARGET_NON_FROZEN)) crit_chance += 17.0f; break; - case 910: //Shatter Rank 2 + case 910: // Shatter Rank 2 if (pVictim->isFrozen() || IsIgnoreUnitState(spellProto, IGNORE_UNIT_TARGET_NON_FROZEN)) crit_chance += 34.0f; break; - case 911: //Shatter Rank 3 + case 911: // Shatter Rank 3 if (pVictim->isFrozen() || IsIgnoreUnitState(spellProto, IGNORE_UNIT_TARGET_NON_FROZEN)) crit_chance += 50.0f; break; @@ -7092,7 +7092,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* pVictim, SpellEntry const* spellProto, if (ownHotCount) { - DoneTotalMod *= 1.2f; // base bonus at HoTs + DoneTotalMod *= 1.2f; // base bonus at HoTs if (Aura* glyph = GetAura(62971, EFFECT_INDEX_0))// Glyph of Nourish DoneTotalMod *= (glyph->GetModifier()->m_amount * ownHotCount + 100.0f) / 100.0f; @@ -7106,8 +7106,8 @@ uint32 Unit::SpellHealingBonusDone(Unit* pVictim, SpellEntry const* spellProto, { switch ((*i)->GetId()) { - case 34246: // Idol of the Emerald Queen TODO: can be flat modifier aura - case 60779: // Idol of Lush Moss + case 34246: // Idol of the Emerald Queen TODO: can be flat modifier aura + case 60779: // Idol of Lush Moss DoneTotal += (*i)->GetModifier()->m_amount / 7; break; } @@ -7248,8 +7248,8 @@ bool Unit::IsImmuneToSpell(SpellEntry const* spellInfo) if (!spellInfo) return false; - //TODO add spellEffect immunity checks!, player with flag in bg is immune to immunity buffs from other friendly players! - //SpellImmuneList const& dispelList = m_spellImmune[IMMUNITY_EFFECT]; + // TODO add spellEffect immunity checks!, player with flag in bg is immune to immunity buffs from other friendly players! + // SpellImmuneList const& dispelList = m_spellImmune[IMMUNITY_EFFECT]; SpellImmuneList const& dispelList = m_spellImmune[IMMUNITY_DISPEL]; for (SpellImmuneList::const_iterator itr = dispelList.begin(); itr != dispelList.end(); ++itr) @@ -7284,7 +7284,7 @@ bool Unit::IsImmuneToSpell(SpellEntry const* spellInfo) bool Unit::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const { - //If m_immuneToEffect type contain this effect type, IMMUNE effect. + // If m_immuneToEffect type contain this effect type, IMMUNE effect. uint32 effect = spellInfo->Effect[index]; SpellImmuneList const& effectList = m_spellImmune[IMMUNITY_EFFECT]; for (SpellImmuneList::const_iterator itr = effectList.begin(); itr != effectList.end(); ++itr) @@ -7314,8 +7314,8 @@ bool Unit::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex i // Check for immune to application of harmful magical effects AuraList const& immuneAuraApply = GetAurasByType(SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL); if (!immuneAuraApply.empty() && - spellInfo->Dispel == DISPEL_MAGIC && // Magic debuff) - !IsPositiveEffect(spellInfo, index)) // Harmful + spellInfo->Dispel == DISPEL_MAGIC && // Magic debuff) + !IsPositiveEffect(spellInfo, index)) // Harmful { // Check school SpellSchoolMask schoolMask = GetSpellSchoolMask(spellInfo); @@ -7818,7 +7818,7 @@ void Unit::SetInCombatWith(Unit* enemy) return; } - //check for duel + // check for duel if (eOwner->GetTypeId() == TYPEID_PLAYER && ((Player*)eOwner)->duel) { if (Player const* myOwner = GetCharmerOrOwnerPlayerOrPlayerItself()) @@ -8130,9 +8130,9 @@ bool Unit::isVisibleForOrDetect(Unit const* u, WorldObject const* viewPoint, boo // NOW ONLY STEALTH CASE - //if in non-detect mode then invisible for unit - //mobs always detect players (detect == true)... return 'false' for those mobs which have (detect == false) - //players detect players only in Player::HandleStealthedUnitsDetection() + // if in non-detect mode then invisible for unit + // mobs always detect players (detect == true)... return 'false' for those mobs which have (detect == false) + // players detect players only in Player::HandleStealthedUnitsDetection() if (!detect) return (u->GetTypeId() == TYPEID_PLAYER) ? ((Player*)u)->HaveAtClient(this) : false; @@ -8146,14 +8146,14 @@ bool Unit::isVisibleForOrDetect(Unit const* u, WorldObject const* viewPoint, boo if (IsWithinDist(u, 0.24f)) return true; - //If a mob or player is stunned he will not be able to detect stealth + // If a mob or player is stunned he will not be able to detect stealth if (u->hasUnitState(UNIT_STAT_STUNNED) && (u != this)) return false; // set max ditance float visibleDistance = (u->GetTypeId() == TYPEID_PLAYER) ? MAX_PLAYER_STEALTH_DETECT_RANGE : ((Creature const*)u)->GetAttackDistance(this); - //Always invisible from back (when stealth detection is on), also filter max distance cases + // Always invisible from back (when stealth detection is on), also filter max distance cases bool isInFront = viewPoint->isInFrontInMap(this, visibleDistance); if (!isInFront) return false; @@ -8161,22 +8161,22 @@ bool Unit::isVisibleForOrDetect(Unit const* u, WorldObject const* viewPoint, boo // if doesn't have stealth detection (Shadow Sight), then check how stealthy the unit is, otherwise just check los if (!u->HasAuraType(SPELL_AURA_DETECT_STEALTH)) { - //Calculation if target is in front + // Calculation if target is in front - //Visible distance based on stealth value (stealth rank 4 300MOD, 10.5 - 3 = 7.5) + // Visible distance based on stealth value (stealth rank 4 300MOD, 10.5 - 3 = 7.5) visibleDistance = 10.5f - (GetTotalAuraModifier(SPELL_AURA_MOD_STEALTH) / 100.0f); - //Visible distance is modified by + // Visible distance is modified by //-Level Diff (every level diff = 1.0f in visible distance) visibleDistance += int32(u->GetLevelForTarget(this)) - int32(GetLevelForTarget(u)); - //This allows to check talent tree and will add addition stealth dependent on used points) + // This allows to check talent tree and will add addition stealth dependent on used points) int32 stealthMod = GetTotalAuraModifier(SPELL_AURA_MOD_STEALTH_LEVEL); if (stealthMod < 0) stealthMod = 0; //-Stealth Mod(positive like Master of Deception) and Stealth Detection(negative like paranoia) - //based on wowwiki every 5 mod we have 1 more level diff in calculation + // based on wowwiki every 5 mod we have 1 more level diff in calculation visibleDistance += (int32(u->GetTotalAuraModifier(SPELL_AURA_MOD_STEALTH_DETECT)) - stealthMod) / 5.0f; visibleDistance = visibleDistance > MAX_PLAYER_STEALTH_DETECT_RANGE ? MAX_PLAYER_STEALTH_DETECT_RANGE : visibleDistance; @@ -8456,9 +8456,9 @@ void Unit::SetSpeedRate(UnitMoveType mtype, float rate, bool forced) WorldPacket data(SetSpeed2Opc_table[mtype][1], 18); data << GetPackGUID(); - data << (uint32)0; // moveEvent, NUM_PMOVE_EVTS = 0x39 + data << (uint32)0; // moveEvent, NUM_PMOVE_EVTS = 0x39 if (mtype == MOVE_RUN) - data << uint8(0); // new 2.1.0 + data << uint8(0); // new 2.1.0 data << float(GetSpeed(mtype)); SendMessageToSet(&data, true); } @@ -8673,16 +8673,16 @@ bool Unit::IsSecondChoiceTarget(Unit* pTarget, bool checkThreatArea) const bool Unit::SelectHostileTarget() { - //function provides main threat functionality - //next-victim-selection algorithm and evade mode are called - //threat list sorting etc. + // function provides main threat functionality + // next-victim-selection algorithm and evade mode are called + // threat list sorting etc. MANGOS_ASSERT(GetTypeId() == TYPEID_UNIT); if (!this->isAlive()) return false; - //This function only useful once AI has been initialized + // This function only useful once AI has been initialized if (!((Creature*)this)->AI()) return false; @@ -9079,7 +9079,7 @@ bool Unit::HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, f break; case BASE_PCT: case TOTAL_PCT: - if (amount <= -100.0f) //small hack-fix for -100% modifiers + if (amount <= -100.0f) // small hack-fix for -100% modifiers amount = -200.0f; val = (100.0f + amount) / 100.0f; @@ -9547,9 +9547,9 @@ void CharmInfo::InitEmptyActionBar() void CharmInfo::InitPossessCreateSpells() { - InitEmptyActionBar(); //charm action bar + InitEmptyActionBar(); // charm action bar - if (m_unit->GetTypeId() == TYPEID_PLAYER) //possessed players don't have spells, keep the action bar empty + if (m_unit->GetTypeId() == TYPEID_PLAYER) // possessed players don't have spells, keep the action bar empty return; for (uint32 x = 0; x < CREATURE_MAX_SPELLS; ++x) @@ -9563,7 +9563,7 @@ void CharmInfo::InitPossessCreateSpells() void CharmInfo::InitCharmCreateSpells() { - if (m_unit->GetTypeId() == TYPEID_PLAYER) //charmed players don't have spells + if (m_unit->GetTypeId() == TYPEID_PLAYER) // charmed players don't have spells { InitEmptyActionBar(); return; @@ -9595,7 +9595,7 @@ void CharmInfo::InitCharmCreateSpells() SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId); if (!spellInfo) onlyselfcast = false; - for (uint32 i = 0; i < 3 && onlyselfcast; ++i) //nonexistent spell will not make any problems as onlyselfcast would be false -> break right away + for (uint32 i = 0; i < 3 && onlyselfcast; ++i) // nonexistent spell will not make any problems as onlyselfcast would be false -> break right away { if (spellInfo->EffectImplicitTargetA[i] != TARGET_SELF && spellInfo->EffectImplicitTargetA[i] != 0) onlyselfcast = false; @@ -9804,7 +9804,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag, // if victim and dodge attack if (procExtra & PROC_EX_DODGE) { - //Update AURA_STATE on dodge + // Update AURA_STATE on dodge if (getClass() != CLASS_ROGUE) // skip Rogue Riposte { ModifyAuraState(AURA_STATE_DEFENSE, true); @@ -9833,7 +9833,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag, StartReactiveTimer(REACTIVE_DEFENSE); } } - else //For attacker + else // For attacker { // Overpower on victim dodge if (procExtra & PROC_EX_DODGE && GetTypeId() == TYPEID_PLAYER && getClass() == CLASS_WARRIOR) @@ -10459,7 +10459,7 @@ float Unit::GetAPMultiplier(WeaponAttackType attType, bool normalized) Item* Weapon = ((Player*)this)->GetWeaponForAttack(attType, true, false); if (!Weapon) - return 2.4f; // fist attack + return 2.4f; // fist attack switch (Weapon->GetProto()->InventoryType) { @@ -10903,7 +10903,7 @@ class RelocationNotifyEvent : public BasicEvent MaNGOS::PlayerRelocationNotifier notify((Player&)m_owner); Cell::VisitAllObjects(&m_owner, notify, radius); } - else //if(m_owner.GetTypeId() == TYPEID_UNIT) + else // if(m_owner.GetTypeId() == TYPEID_UNIT) { MaNGOS::CreatureRelocationNotifier notify((Creature&)m_owner); Cell::VisitAllObjects(&m_owner, notify, radius); diff --git a/src/game/Unit.h b/src/game/Unit.h index fac5578d4..84c5c5796 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -44,7 +44,7 @@ enum SpellInterruptFlags SPELL_INTERRUPT_FLAG_INTERRUPT = 0x04, SPELL_INTERRUPT_FLAG_AUTOATTACK = 0x08, SPELL_INTERRUPT_FLAG_ABORT_ON_DMG = 0x10, // _complete_ interrupt on direct damage - //SPELL_INTERRUPT_UNK = 0x20 // unk, 564 of 727 spells having this spell start with "Glyph" + // SPELL_INTERRUPT_UNK = 0x20 // unk, 564 of 727 spells having this spell start with "Glyph" }; enum SpellChannelInterruptFlags @@ -253,7 +253,7 @@ enum HitInfo HITINFO_UNK22 = 0x00800000 }; -//i would like to remove this: (it is defined in item.h +// i would like to remove this: (it is defined in item.h enum InventorySlot { NULL_BAG = 0, @@ -387,32 +387,32 @@ enum DeathState enum UnitState { // persistent state (applied by aura/etc until expire) - UNIT_STAT_MELEE_ATTACKING = 0x00000001, // unit is melee attacking someone Unit::Attack - UNIT_STAT_ATTACK_PLAYER = 0x00000002, // unit attack player or player's controlled unit and have contested pvpv timer setup, until timer expire, combat end and etc - UNIT_STAT_DIED = 0x00000004, // Unit::SetFeignDeath - UNIT_STAT_STUNNED = 0x00000008, // Aura::HandleAuraModStun - UNIT_STAT_ROOT = 0x00000010, // Aura::HandleAuraModRoot - UNIT_STAT_ISOLATED = 0x00000020, // area auras do not affect other players, Aura::HandleAuraModSchoolImmunity - UNIT_STAT_CONTROLLED = 0x00000040, // Aura::HandleAuraModPossess + UNIT_STAT_MELEE_ATTACKING = 0x00000001, // unit is melee attacking someone Unit::Attack + UNIT_STAT_ATTACK_PLAYER = 0x00000002, // unit attack player or player's controlled unit and have contested pvpv timer setup, until timer expire, combat end and etc + UNIT_STAT_DIED = 0x00000004, // Unit::SetFeignDeath + UNIT_STAT_STUNNED = 0x00000008, // Aura::HandleAuraModStun + UNIT_STAT_ROOT = 0x00000010, // Aura::HandleAuraModRoot + UNIT_STAT_ISOLATED = 0x00000020, // area auras do not affect other players, Aura::HandleAuraModSchoolImmunity + UNIT_STAT_CONTROLLED = 0x00000040, // Aura::HandleAuraModPossess // persistent movement generator state (all time while movement generator applied to unit (independent from top state of movegen) - UNIT_STAT_TAXI_FLIGHT = 0x00000080, // player is in flight mode (in fact interrupted at far teleport until next map telport landing) - UNIT_STAT_DISTRACTED = 0x00000100, // DistractedMovementGenerator active + UNIT_STAT_TAXI_FLIGHT = 0x00000080, // player is in flight mode (in fact interrupted at far teleport until next map telport landing) + UNIT_STAT_DISTRACTED = 0x00000100, // DistractedMovementGenerator active // persistent movement generator state with non-persistent mirror states for stop support // (can be removed temporary by stop command or another movement generator apply) // not use _MOVE versions for generic movegen state, it can be removed temporary for unit stop and etc - UNIT_STAT_CONFUSED = 0x00000200, // ConfusedMovementGenerator active/onstack + UNIT_STAT_CONFUSED = 0x00000200, // ConfusedMovementGenerator active/onstack UNIT_STAT_CONFUSED_MOVE = 0x00000400, - UNIT_STAT_ROAMING = 0x00000800, // RandomMovementGenerator/PointMovementGenerator/WaypointMovementGenerator active (now always set) + UNIT_STAT_ROAMING = 0x00000800, // RandomMovementGenerator/PointMovementGenerator/WaypointMovementGenerator active (now always set) UNIT_STAT_ROAMING_MOVE = 0x00001000, - UNIT_STAT_CHASE = 0x00002000, // ChaseMovementGenerator active + UNIT_STAT_CHASE = 0x00002000, // ChaseMovementGenerator active UNIT_STAT_CHASE_MOVE = 0x00004000, - UNIT_STAT_FOLLOW = 0x00008000, // FollowMovementGenerator active + UNIT_STAT_FOLLOW = 0x00008000, // FollowMovementGenerator active UNIT_STAT_FOLLOW_MOVE = 0x00010000, - UNIT_STAT_FLEEING = 0x00020000, // FleeMovementGenerator/TimedFleeingMovementGenerator active/onstack + UNIT_STAT_FLEEING = 0x00020000, // FleeMovementGenerator/TimedFleeingMovementGenerator active/onstack UNIT_STAT_FLEEING_MOVE = 0x00040000, - UNIT_STAT_IGNORE_PATHFINDING = 0x00080000, // do not use pathfinding in any MovementGenerator + UNIT_STAT_IGNORE_PATHFINDING = 0x00080000, // do not use pathfinding in any MovementGenerator // masks (only for check) @@ -1008,7 +1008,7 @@ struct CharmInfo void InitPetActionBar(); void InitEmptyActionBar(); - //return true if successful + // return true if successful bool AddSpellToActionBar(uint32 spellid, ActiveStates newstate = ACT_DECIDE); bool RemoveSpellFromActionBar(uint32 spell_id); void LoadPetActionBar(const std::string& data); @@ -1927,7 +1927,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject SpellAuraHolderMap m_spellAuraHolders; SpellAuraHolderMap::iterator m_spellAuraHoldersUpdateIterator; // != end() in Unit::m_spellAuraHolders update and point to next element - AuraList m_deletedAuras; // auras removed while in ApplyModifier and waiting deleted + AuraList m_deletedAuras; // auras removed while in ApplyModifier and waiting deleted SpellAuraHolderList m_deletedHolders; SingleCastSpellTargetMap m_singleCastSpellTargets; // casted by unit single per-caster auras @@ -1945,7 +1945,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject float m_auraModifiersGroup[UNIT_MOD_END][MODIFIER_TYPE_END]; float m_weaponDamage[MAX_ATTACK][2]; bool m_canModifyStats; - //std::list< spellEffectPair > AuraSpells[TOTAL_AURAS]; // TODO: use this if ok for mem + // std::list< spellEffectPair > AuraSpells[TOTAL_AURAS]; // TODO: use this if ok for mem VisibleAuraMap m_visibleAuras; float m_speed_rate[MAX_MOVE_TYPE]; diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp index 107d81892..0ebdc5f98 100644 --- a/src/game/UnitAuraProcHandler.cpp +++ b/src/game/UnitAuraProcHandler.cpp @@ -654,7 +654,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura { case SPELL_SCHOOL_NORMAL: case SPELL_SCHOOL_HOLY: - return SPELL_AURA_PROC_FAILED; // ignored + return SPELL_AURA_PROC_FAILED; // ignored case SPELL_SCHOOL_FIRE: triggered_spell_id = 28765; break; case SPELL_SCHOOL_NATURE: triggered_spell_id = 28768; break; case SPELL_SCHOOL_FROST: triggered_spell_id = 28766; break; @@ -676,7 +676,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura switch (GetFirstSchoolInMask(GetSpellSchoolMask(procSpell))) { case SPELL_SCHOOL_NORMAL: - return SPELL_AURA_PROC_FAILED; // ignore + return SPELL_AURA_PROC_FAILED; // ignore case SPELL_SCHOOL_HOLY: triggered_spell_id = 27536; break; case SPELL_SCHOOL_FIRE: triggered_spell_id = 27533; break; case SPELL_SCHOOL_NATURE: triggered_spell_id = 27538; break; @@ -737,7 +737,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura // Vampiric Aura (boss spell) case 38196: { - basepoints[0] = 3 * damage; // 300% + basepoints[0] = 3 * damage; // 300% if (basepoints[0] < 0) return SPELL_AURA_PROC_FAILED; @@ -915,7 +915,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura // cast ??? Light's Wrath if Exalted by Aldor // cast ??? Arcane Bolt if Exalted by Scryers*/ case 46569: - return SPELL_AURA_PROC_FAILED; // old unused version + return SPELL_AURA_PROC_FAILED; // old unused version // Living Seed case 48504: { @@ -1227,7 +1227,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura // Cast finish spell (triggeredByAura already not exist!) CastSpell(this, 27285, true, castItem, NULL, casterGuid); - return SPELL_AURA_PROC_OK; // no hidden cooldown + return SPELL_AURA_PROC_OK; // no hidden cooldown } // Damage counting @@ -1249,7 +1249,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura // Cast finish spell (triggeredByAura already not exist!) CastSpell(this, 32865, true, castItem, NULL, casterGuid); - return SPELL_AURA_PROC_OK; // no hidden cooldown + return SPELL_AURA_PROC_OK; // no hidden cooldown } // Damage counting mod->m_amount -= damage; @@ -1276,7 +1276,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura triggered_spell_id = 17941; break; } - //Soul Leech + // Soul Leech case 30293: case 30295: case 30296: @@ -1339,7 +1339,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura // Energize 0.25% of max. mana pVictim->CastSpell(pVictim, 57669, true, castItem, triggeredByAura); - return SPELL_AURA_PROC_OK; // no hidden cooldown + return SPELL_AURA_PROC_OK; // no hidden cooldown } switch (dummySpell->SpellIconID) @@ -1408,7 +1408,7 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit* pVictim, uint32 damage, Aura int32 team = triggerAmount * damage / 500; int32 self = triggerAmount * damage / 100 - team; CastCustomSpell(this, 15290, &team, &self, NULL, true, castItem, triggeredByAura); - return SPELL_AURA_PROC_OK; // no hidden cooldown + return SPELL_AURA_PROC_OK; // no hidden cooldown } // Priest Tier 6 Trinket (Ashtongue Talisman of Acumen) case 40438: @@ -2814,7 +2814,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d case SPELLFAMILY_GENERIC: switch (auraSpellInfo->Id) { - //case 191: // Elemental Response + // case 191: // Elemental Response // switch (procSpell->School) // { // case SPELL_SCHOOL_FIRE: trigger_spell_id = 34192; break; @@ -2826,21 +2826,21 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d // case SPELL_SCHOOL_NORMAL:trigger_spell_id = 34198; break; // } // break; - //case 5301: break; // Defensive State (DND) - //case 7137: break: // Shadow Charge (Rank 1) - //case 7377: break: // Take Immune Periodic Damage - //case 13358: break; // Defensive State (DND) - //case 16092: break; // Defensive State (DND) - //case 18943: break; // Double Attack - //case 19194: break; // Double Attack - //case 19817: break; // Double Attack - //case 19818: break; // Double Attack - //case 22835: break; // Drunken Rage + // case 5301: break; // Defensive State (DND) + // case 7137: break: // Shadow Charge (Rank 1) + // case 7377: break: // Take Immune Periodic Damage + // case 13358: break; // Defensive State (DND) + // case 16092: break; // Defensive State (DND) + // case 18943: break; // Double Attack + // case 19194: break; // Double Attack + // case 19817: break; // Double Attack + // case 19818: break; // Double Attack + // case 22835: break; // Drunken Rage // trigger_spell_id = 14822; break; case 23780: // Aegis of Preservation (Aegis of Preservation trinket) trigger_spell_id = 23781; break; - //case 24949: break; // Defensive State 2 (DND) + // case 24949: break; // Defensive State 2 (DND) case 27522: // Mana Drain Trigger case 40336: // Mana Drain Trigger case 46939: // Black Bow of the Betrayer @@ -2860,60 +2860,60 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d trigger_spell_id = 22588; break; } - //case 33207: break; // Gossip NPC Periodic - Fidget + // case 33207: break; // Gossip NPC Periodic - Fidget case 33896: // Desperate Defense (Stonescythe Whelp, Stonescythe Alpha, Stonescythe Ambusher) trigger_spell_id = 33898; break; - //case 34082: break; // Advantaged State (DND) - //case 34783: break: // Spell Reflection - //case 35205: break: // Vanish - //case 35321: break; // Gushing Wound - //case 36096: break: // Spell Reflection - //case 36207: break: // Steal Weapon - //case 36576: break: // Shaleskin (Shaleskin Flayer, Shaleskin Ripper) 30023 trigger - //case 37030: break; // Chaotic Temperament - //case 38363: break; // Gushing Wound - //case 39215: break; // Gushing Wound - //case 40250: break; // Improved Duration - //case 40329: break; // Demo Shout Sensor - //case 40364: break; // Entangling Roots Sensor - //case 41054: break; // Copy Weapon + // case 34082: break; // Advantaged State (DND) + // case 34783: break: // Spell Reflection + // case 35205: break: // Vanish + // case 35321: break; // Gushing Wound + // case 36096: break: // Spell Reflection + // case 36207: break: // Steal Weapon + // case 36576: break: // Shaleskin (Shaleskin Flayer, Shaleskin Ripper) 30023 trigger + // case 37030: break; // Chaotic Temperament + // case 38363: break; // Gushing Wound + // case 39215: break; // Gushing Wound + // case 40250: break; // Improved Duration + // case 40329: break; // Demo Shout Sensor + // case 40364: break; // Entangling Roots Sensor + // case 41054: break; // Copy Weapon // trigger_spell_id = 41055; break; - //case 41248: break; // Consuming Strikes + // case 41248: break; // Consuming Strikes // trigger_spell_id = 41249; break; - //case 42730: break: // Woe Strike - //case 43453: break: // Rune Ward - //case 43504: break; // Alterac Valley OnKill Proc Aura - //case 44326: break: // Pure Energy Passive - //case 44526: break; // Hate Monster (Spar) (30 sec) - //case 44527: break; // Hate Monster (Spar Buddy) (30 sec) - //case 44819: break; // Hate Monster (Spar Buddy) (>30% Health) - //case 44820: break; // Hate Monster (Spar) (<30%) + // case 42730: break: // Woe Strike + // case 43453: break: // Rune Ward + // case 43504: break; // Alterac Valley OnKill Proc Aura + // case 44326: break: // Pure Energy Passive + // case 44526: break; // Hate Monster (Spar) (30 sec) + // case 44527: break; // Hate Monster (Spar Buddy) (30 sec) + // case 44819: break; // Hate Monster (Spar Buddy) (>30% Health) + // case 44820: break; // Hate Monster (Spar) (<30%) case 45057: // Evasive Maneuvers (Commendation of Kael`thas trinket) // reduce you below $s1% health (in fact in this specific case can proc from any attack while health in result less $s1%) if (int32(GetHealth()) - int32(damage) >= int32(GetMaxHealth() * triggerAmount / 100)) return SPELL_AURA_PROC_FAILED; break; - //case 45903: break: // Offensive State - //case 46146: break: // [PH] Ahune Spanky Hands + // case 45903: break: // Offensive State + // case 46146: break: // [PH] Ahune Spanky Hands case 43820: // Charm of the Witch Doctor (Amani Charm of the Witch Doctor trinket) // Pct value stored in dummy basepoints[0] = pVictim->GetCreateHealth() * auraSpellInfo->CalculateSimpleValue(EFFECT_INDEX_1) / 100; target = pVictim; break; - //case 45205: break; // Copy Offhand Weapon - //case 45343: break; // Dark Flame Aura - //case 47300: break; // Dark Flame Aura - //case 48876: break; // Beast's Mark + // case 45205: break; // Copy Offhand Weapon + // case 45343: break; // Dark Flame Aura + // case 47300: break; // Dark Flame Aura + // case 48876: break; // Beast's Mark // trigger_spell_id = 48877; break; - //case 49059: break; // Horde, Hate Monster (Spar Buddy) (>30% Health) - //case 50051: break; // Ethereal Pet Aura - //case 50689: break; // Blood Presence (Rank 1) - //case 50844: break; // Blood Mirror - //case 52856: break; // Charge - //case 54072: break; // Knockback Ball Passive - //case 54476: break; // Blood Presence - //case 54775: break; // Abandon Vehicle on Poly + // case 49059: break; // Horde, Hate Monster (Spar Buddy) (>30% Health) + // case 50051: break; // Ethereal Pet Aura + // case 50689: break; // Blood Presence (Rank 1) + // case 50844: break; // Blood Mirror + // case 52856: break; // Charge + // case 54072: break; // Knockback Ball Passive + // case 54476: break; // Blood Presence + // case 54775: break; // Abandon Vehicle on Poly case 57345: // Darkmoon Card: Greatness { float stat = 0.0f; @@ -2927,14 +2927,14 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d if (GetStat(STAT_SPIRIT) > stat) { trigger_spell_id = 60235; } break; } - //case 55580: break: // Mana Link - //case 57587: break: // Steal Ranged () - //case 57594: break; // Copy Ranged Weapon - //case 59237: break; // Beast's Mark + // case 55580: break: // Mana Link + // case 57587: break: // Steal Ranged () + // case 57594: break; // Copy Ranged Weapon + // case 59237: break; // Beast's Mark // trigger_spell_id = 59233; break; - //case 59288: break; // Infra-Green Shield - //case 59532: break; // Abandon Passengers on Poly - //case 59735: break: // Woe Strike + // case 59288: break; // Infra-Green Shield + // case 59532: break; // Abandon Passengers on Poly + // case 59735: break: // Woe Strike case 64415: // // Val'anyr Hammer of Ancient Kings - Equip Effect { // for DOT procs @@ -3099,7 +3099,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d switch (GetFirstSchoolInMask(GetSpellSchoolMask(procSpell))) { case SPELL_SCHOOL_NORMAL: - return SPELL_AURA_PROC_FAILED; // ignore + return SPELL_AURA_PROC_FAILED; // ignore case SPELL_SCHOOL_HOLY: trigger_spell_id = 54370; break; case SPELL_SCHOOL_FIRE: trigger_spell_id = 54371; break; case SPELL_SCHOOL_NATURE: trigger_spell_id = 54375; break; @@ -3426,7 +3426,7 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit* pVictim, uint32 d switch (GetFirstSchoolInMask(GetSpellSchoolMask(procSpell))) { case SPELL_SCHOOL_NORMAL: - return SPELL_AURA_PROC_FAILED; // ignore + return SPELL_AURA_PROC_FAILED; // ignore case SPELL_SCHOOL_HOLY: trigger_spell_id = 50490; break; case SPELL_SCHOOL_FIRE: trigger_spell_id = 50362; break; case SPELL_SCHOOL_NATURE: trigger_spell_id = 50488; break; @@ -3886,7 +3886,7 @@ SpellAuraProcResult Unit::HandleAddFlatModifierAuraProc(Unit* pVictim, uint32 /* { SpellEntry const* spellInfo = triggeredByAura->GetSpellProto(); - if (spellInfo->Id == 55166) // Tidal Force + if (spellInfo->Id == 55166) // Tidal Force { // Remove only single aura from stack if (triggeredByAura->GetStackAmount() > 1 && !triggeredByAura->GetHolder()->ModStackAmount(-1)) @@ -3920,9 +3920,9 @@ SpellAuraProcResult Unit::HandleAddPctModifierAuraProc(Unit* /*pVictim*/, uint32 // Combustion if (spellInfo->Id == 11129) { - //last charge and crit + // last charge and crit if (triggeredByAura->GetHolder()->GetAuraCharges() <= 1 && (procEx & PROC_EX_CRITICAL_HIT)) - return SPELL_AURA_PROC_OK; // charge counting (will removed) + return SPELL_AURA_PROC_OK; // charge counting (will removed) CastSpell(this, 28682, true, castItem, triggeredByAura); return (procEx & PROC_EX_CRITICAL_HIT) ? SPELL_AURA_PROC_OK : SPELL_AURA_PROC_FAILED; // charge update only at crit hits, no hidden cooldowns diff --git a/src/game/World.cpp b/src/game/World.cpp index c20352ff5..00c43843f 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -137,7 +137,7 @@ World::~World() VMAP::VMapFactory::clear(); MMAP::MMapFactory::clear(); - //TODO free addSessQueue + // TODO free addSessQueue } /// Find a player in a specified zone @@ -198,7 +198,7 @@ World::AddSession_(WorldSession* s) { MANGOS_ASSERT(s); - //NOTE - Still there is race condition in WorldSession* being used in the Sockets + // NOTE - Still there is race condition in WorldSession* being used in the Sockets ///- kick already loaded player with same account (if any) and remove session ///- if player is in loading and want to load again, return @@ -231,10 +231,10 @@ World::AddSession_(WorldSession* s) uint32 Sessions = GetActiveAndQueuedSessionCount(); uint32 pLimit = GetPlayerAmountLimit(); - uint32 QueueSize = GetQueuedSessionCount(); //number of players in the queue + uint32 QueueSize = GetQueuedSessionCount(); // number of players in the queue - //so we don't count the user trying to - //login as a session and queue the socket that we are using + // so we don't count the user trying to + // login as a session and queue the socket that we are using if (decrease_session) --Sessions; @@ -797,7 +797,7 @@ void World::LoadConfigSettings(bool reload) m_VisibleObjectGreyDistance = MAX_VISIBILITY_DISTANCE; } - //visibility on continents + // visibility on continents m_MaxVisibleDistanceOnContinents = sConfig.GetFloatDefault("Visibility.Distance.Continents", DEFAULT_VISIBILITY_DISTANCE); if (m_MaxVisibleDistanceOnContinents < 45 * getConfig(CONFIG_FLOAT_RATE_CREATURE_AGGRO)) { @@ -810,7 +810,7 @@ void World::LoadConfigSettings(bool reload) m_MaxVisibleDistanceOnContinents = MAX_VISIBILITY_DISTANCE - m_VisibleUnitGreyDistance; } - //visibility in instances + // visibility in instances m_MaxVisibleDistanceInInstances = sConfig.GetFloatDefault("Visibility.Distance.Instances", DEFAULT_VISIBILITY_INSTANCE); if (m_MaxVisibleDistanceInInstances < 45 * getConfig(CONFIG_FLOAT_RATE_CREATURE_AGGRO)) { @@ -823,7 +823,7 @@ void World::LoadConfigSettings(bool reload) m_MaxVisibleDistanceInInstances = MAX_VISIBILITY_DISTANCE - m_VisibleUnitGreyDistance; } - //visibility in BG/Arenas + // visibility in BG/Arenas m_MaxVisibleDistanceInBGArenas = sConfig.GetFloatDefault("Visibility.Distance.BGArenas", DEFAULT_VISIBILITY_BGARENAS); if (m_MaxVisibleDistanceInBGArenas < 45 * getConfig(CONFIG_FLOAT_RATE_CREATURE_AGGRO)) { @@ -938,7 +938,7 @@ void World::SetInitialWorldSettings() } ///- Update the realm entry in the database with the realm type from the config file - //No SQL injection as values are treated as integers + // No SQL injection as values are treated as integers // not send custom type REALM_FFA_PVP to realm list uint32 server_type = IsFFAPvPRealm() ? REALM_TYPE_PVP : getConfig(CONFIG_UINT32_GAME_TYPE); @@ -1204,7 +1204,7 @@ void World::SetInitialWorldSettings() sLog.outString(">>> Achievements loaded"); sLog.outString(); - sLog.outString("Loading Instance encounters data..."); // must be after Creature loading + sLog.outString("Loading Instance encounters data..."); // must be after Creature loading sObjectMgr.LoadInstanceEncounters(); sLog.outString("Loading Npc Text Id..."); @@ -1285,12 +1285,12 @@ void World::SetInitialWorldSettings() ///- Load and initialize scripts sLog.outString("Loading Scripts..."); sLog.outString(); - sScriptMgr.LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate - sScriptMgr.LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate - sScriptMgr.LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data) - sScriptMgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data) - sScriptMgr.LoadGameObjectTemplateScripts(); // must be after load Creature/Gameobject(Template/Data) - sScriptMgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data) + sScriptMgr.LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate + sScriptMgr.LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate + sScriptMgr.LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data) + sScriptMgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data) + sScriptMgr.LoadGameObjectTemplateScripts(); // must be after load Creature/Gameobject(Template/Data) + sScriptMgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data) sLog.outString(">>> Scripts loaded"); sLog.outString(); @@ -1342,16 +1342,16 @@ void World::SetInitialWorldSettings() m_timers[WUPDATE_WEATHERS].SetInterval(1 * IN_MILLISECONDS); m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE * IN_MILLISECONDS); m_timers[WUPDATE_UPTIME].SetInterval(getConfig(CONFIG_UINT32_UPTIME_UPDATE)*MINUTE * IN_MILLISECONDS); - //Update "uptime" table based on configuration entry in minutes. + // Update "uptime" table based on configuration entry in minutes. m_timers[WUPDATE_CORPSES].SetInterval(20 * MINUTE * IN_MILLISECONDS); m_timers[WUPDATE_DELETECHARS].SetInterval(DAY * IN_MILLISECONDS); // check for chars to delete every day // for AhBot m_timers[WUPDATE_AHBOT].SetInterval(20 * IN_MILLISECONDS); // every 20 sec - //to set mailtimer to return mails every day between 4 and 5 am - //mailtimer is increased when updating auctions - //one second is 1000 -(tested on win system) + // to set mailtimer to return mails every day between 4 and 5 am + // mailtimer is increased when updating auctions + // one second is 1000 -(tested on win system) mail_timer = uint32((((localtime(&m_gameTime)->tm_hour + 20) % 24) * HOUR * IN_MILLISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval()); //1440 mail_timer_expires = uint32((DAY * IN_MILLISECONDS) / (m_timers[WUPDATE_AUCTIONS].GetInterval())); @@ -1370,7 +1370,7 @@ void World::SetInitialWorldSettings() sBattleGroundMgr.CreateInitialBattleGrounds(); sBattleGroundMgr.InitAutomaticArenaPointDistribution(); - //Not sure if this can be moved up in the sequence (with static data loading) as it uses MapManager + // Not sure if this can be moved up in the sequence (with static data loading) as it uses MapManager sLog.outString("Loading Transports..."); sMapMgr.LoadTransports(); @@ -1388,7 +1388,7 @@ void World::SetInitialWorldSettings() sLog.outString("Starting Game Event system..."); uint32 nextGameEvent = sGameEventMgr.Initialize(); - m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event + m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); // depend on next event // Delete all characters which have been deleted X days before Player::DeleteOldCharacters(); @@ -1512,7 +1512,7 @@ void World::Update(uint32 diff) for (WeatherMap::iterator itr = m_weathers.begin(); itr != m_weathers.end();) { ///- and remove Weather objects for zones with no player - //As interval > WorldTick + // As interval > WorldTick if (!itr->second->Update(m_timers[WUPDATE_WEATHERS].GetInterval())) { delete itr->second; @@ -1576,7 +1576,7 @@ void World::Update(uint32 diff) // And last, but not least handle the issued cli commands ProcessCliCommands(); - //cleanup unused GridMap objects as well as VMaps + // cleanup unused GridMap objects as well as VMaps sTerrainMgr.Update(diff); } @@ -1635,11 +1635,11 @@ namespace MaNGOS uint32 lineLength = (line ? strlen(line) : 0) + 1; - data->Initialize(SMSG_MESSAGECHAT, 100); // guess size + data->Initialize(SMSG_MESSAGECHAT, 100);// guess size *data << uint8(CHAT_MSG_SYSTEM); *data << uint32(LANG_UNIVERSAL); *data << uint64(0); - *data << uint32(0); // can be chat msg group or something + *data << uint32(0); // can be chat msg group or something *data << uint64(0); *data << uint32(lineLength); *data << line; @@ -1744,22 +1744,22 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, uint32 duration_ std::string safe_author = author; LoginDatabase.escape_string(safe_author); - QueryResult* resultAccounts = NULL; //used for kicking + QueryResult* resultAccounts = NULL; // used for kicking ///- Update the database with ban information switch (mode) { case BAN_IP: - //No SQL injection as strings are escaped + // No SQL injection as strings are escaped resultAccounts = LoginDatabase.PQuery("SELECT id FROM account WHERE last_ip = '%s'", nameOrIP.c_str()); LoginDatabase.PExecute("INSERT INTO ip_banned VALUES ('%s',UNIX_TIMESTAMP(),UNIX_TIMESTAMP()+%u,'%s','%s')", nameOrIP.c_str(), duration_secs, safe_author.c_str(), reason.c_str()); break; case BAN_ACCOUNT: - //No SQL injection as string is escaped + // No SQL injection as string is escaped resultAccounts = LoginDatabase.PQuery("SELECT id FROM account WHERE username = '%s'", nameOrIP.c_str()); break; case BAN_CHARACTER: - //No SQL injection as string is escaped + // No SQL injection as string is escaped resultAccounts = CharacterDatabase.PQuery("SELECT account FROM characters WHERE name = '%s'", nameOrIP.c_str()); break; default: @@ -1771,7 +1771,7 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, uint32 duration_ if (mode == BAN_IP) return BAN_SUCCESS; // ip correctly banned but nobody affected (yet) else - return BAN_NOTFOUND; // Nobody to ban + return BAN_NOTFOUND; // Nobody to ban } ///- Disconnect all affected players (for IP it can be several) @@ -1782,7 +1782,7 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, uint32 duration_ if (mode != BAN_IP) { - //No SQL injection as strings are escaped + // No SQL injection as strings are escaped LoginDatabase.PExecute("INSERT INTO account_banned VALUES ('%u', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+%u, '%s', '%s', '1')", account, duration_secs, safe_author.c_str(), reason.c_str()); } @@ -1816,7 +1816,7 @@ bool World::RemoveBanAccount(BanMode mode, std::string nameOrIP) if (!account) return false; - //NO SQL injection as account is uint32 + // NO SQL injection as account is uint32 LoginDatabase.PExecute("UPDATE account_banned SET active = '0' WHERE id = '%u'", account); } return true; @@ -1867,7 +1867,7 @@ void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode) if (!(options & SHUTDOWN_MASK_IDLE) || GetActiveAndQueuedSessionCount() == 0) m_stopEvent = true; // exist code already set else - m_ShutdownTimer = 1; //So that the session count is re-evaluated at next world tick + m_ShutdownTimer = 1; // So that the session count is re-evaluated at next world tick } ///- Else set the shutdown timer and warn users else @@ -1983,7 +1983,7 @@ void World::InitResultQueue() void World::UpdateResultQueue() { - //process async result queues + // process async result queues CharacterDatabase.ProcessResultQueue(); WorldDatabase.ProcessResultQueue(); LoginDatabase.ProcessResultQueue(); diff --git a/src/game/World.h b/src/game/World.h index c46aba62c..3af4445ef 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -464,7 +464,7 @@ class World /// Set the active session server limit (or security level limitation) void SetPlayerLimit(int32 limit, bool needUpdate = false); - //player Queue + // player Queue typedef std::list Queue; void AddQueuedSession(WorldSession*); bool RemoveQueuedSession(WorldSession* session); @@ -577,7 +577,7 @@ class World LocaleConstant GetAvailableDbcLocale(LocaleConstant locale) const { if (m_availableDbcLocaleMask & (1 << locale)) return locale; else return m_defaultDbcLocale; } - //used World DB version + // used World DB version void LoadDBVersion(); char const* GetDBVersion() { return m_DBVersion.c_str(); } char const* GetCreatureEventAIVersion() { return m_CreatureEventAIVersion.c_str(); } @@ -635,8 +635,8 @@ class World bool m_configBoolValues[CONFIG_BOOL_VALUE_COUNT]; int32 m_playerLimit; - LocaleConstant m_defaultDbcLocale; // from config for one from loaded DBC locales - uint32 m_availableDbcLocaleMask; // by loaded DBC + LocaleConstant m_defaultDbcLocale; // from config for one from loaded DBC locales + uint32 m_availableDbcLocaleMask; // by loaded DBC void DetectDBCLang(); bool m_allowMovement; std::string m_motd; @@ -662,14 +662,14 @@ class World time_t m_NextWeeklyQuestReset; time_t m_NextMonthlyQuestReset; - //Player Queue + // Player Queue Queue m_QueuedSessions; - //sessions that are added async + // sessions that are added async void AddSession_(WorldSession* s); ACE_Based::LockedQueue addSessQueue; - //used versions + // used versions std::string m_DBVersion; std::string m_CreatureEventAIVersion; }; diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index 6a6e02f37..9ed283997 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -306,8 +306,8 @@ bool WorldSession::Update(PacketFilter& updater) m_Socket = NULL; } - //check if we are safe to proceed with logout - //logout procedure should happen only in World::UpdateSessions() method!!! + // check if we are safe to proceed with logout + // logout procedure should happen only in World::UpdateSessions() method!!! if (updater.ProcessLogout()) { ///- If necessary, log the player out @@ -316,7 +316,7 @@ bool WorldSession::Update(PacketFilter& updater) LogoutPlayer(true); if (!m_Socket) - return false; //Will remove this session from the world session map + return false; // Will remove this session from the world session map } return true; @@ -340,7 +340,7 @@ void WorldSession::LogoutPlayer(bool Save) DoLootRelease(lootGuid); ///- If the player just died before logging out, make him appear as a ghost - //FIXME: logout must be delayed in case lost connection with client in time of combat + // FIXME: logout must be delayed in case lost connection with client in time of combat if (_player->GetDeathTimer()) { _player->getHostileRefManager().deleteReferences(); @@ -391,7 +391,7 @@ void WorldSession::LogoutPlayer(bool Save) _player->BuildPlayerRepop(); _player->RepopAtGraveyard(); } - //drop a flag if player is carrying it + // drop a flag if player is carrying it if (BattleGround* bg = _player->GetBattleGround()) bg->EventPlayerLoggedOut(_player); @@ -399,8 +399,8 @@ void WorldSession::LogoutPlayer(bool Save) if (!_player->m_InstanceValid && !_player->isGameMaster()) { _player->TeleportToHomebind(); - //this is a bad place to call for far teleport because we need player to be in world for successful logout - //maybe we should implement delayed far teleport logout? + // this is a bad place to call for far teleport because we need player to be in world for successful logout + // maybe we should implement delayed far teleport logout? } // FG: finish pending transfers after starting the logout @@ -486,7 +486,7 @@ void WorldSession::LogoutPlayer(bool Save) SendPacket(&data); ///- Since each account can only have one online character at any given time, ensure all characters for active account are marked as offline - //No SQL injection as AccountId is uint32 + // No SQL injection as AccountId is uint32 static SqlStatementID updChars; @@ -958,8 +958,8 @@ void WorldSession::ExecuteOpcode(OpcodeHandler const& opHandle, WorldPacket* pac // can be not set in fact for login opcode, but this not create porblems. _player->SetCanDelayTeleport(false); - //we should execute delayed teleports only for alive(!) players - //because we don't want player's ghost teleported from graveyard + // we should execute delayed teleports only for alive(!) players + // because we don't want player's ghost teleported from graveyard if (_player->IsHasDelayedTeleport()) _player->TeleportTo(_player->m_teleport_dest, _player->m_teleport_options); } diff --git a/src/game/WorldSession.h b/src/game/WorldSession.h index 5a8a81b07..13bdb01c0 100644 --- a/src/game/WorldSession.h +++ b/src/game/WorldSession.h @@ -185,8 +185,8 @@ enum TutorialDataState TUTORIALDATA_NEW = 2 }; -//class to deal with packet processing -//allows to determine if next packet is safe to be processed +// class to deal with packet processing +// allows to determine if next packet is safe to be processed class PacketFilter { public: @@ -200,7 +200,7 @@ class PacketFilter WorldSession* const m_pSession; }; -//process only thread-safe packets in Map::Update() +// process only thread-safe packets in Map::Update() class MapSessionFilter : public PacketFilter { public: @@ -208,12 +208,12 @@ class MapSessionFilter : public PacketFilter ~MapSessionFilter() {} virtual bool Process(WorldPacket* packet); - //in Map::Update() we do not process player logout! + // in Map::Update() we do not process player logout! virtual bool ProcessLogout() const { return false; } }; -//class used to filer only thread-unsafe packets from queue -//in order to update only be used in World::UpdateSessions() +// class used to filer only thread-unsafe packets from queue +// in order to update only be used in World::UpdateSessions() class WorldSessionFilter : public PacketFilter { public: @@ -318,7 +318,7 @@ class MANGOS_DLL_SPEC WorldSession void SendPetitionQueryOpcode(ObjectGuid petitionguid); - //pet + // pet void SendPetNameQuery(ObjectGuid guid, uint32 petnumber); void SendStablePet(ObjectGuid guid); void SendStableResult(uint8 res); @@ -347,10 +347,10 @@ class MANGOS_DLL_SPEC WorldSession m_tutorialState = TUTORIALDATA_CHANGED; } } - //used with item_page table + // used with item_page table bool SendItemInfo(uint32 itemid, WorldPacket data); - //auction + // auction void SendAuctionHello(Unit* unit); void SendAuctionCommandResult(AuctionEntry* auc, AuctionAction Action, AuctionError ErrorCode, InventoryResult invError = EQUIP_ERR_OK); void SendAuctionBidderNotification(AuctionEntry* auction); @@ -363,11 +363,11 @@ class MANGOS_DLL_SPEC WorldSession AuctionHouseEntry const* GetCheckedAuctionHouseForAuctioneer(ObjectGuid guid); - //Item Enchantment + // Item Enchantment void SendEnchantmentLog(ObjectGuid targetGuid, ObjectGuid casterGuid, uint32 itemId, uint32 spellId); void SendItemEnchantTimeUpdate(ObjectGuid playerGuid, ObjectGuid itemGuid, uint32 slot, uint32 duration); - //Taxi + // Taxi void SendTaxiStatus(ObjectGuid guid); void SendTaxiMenu(Creature* unit); void SendDoFlight(uint32 mountDisplayId, uint32 path, uint32 pathNode = 0); @@ -730,7 +730,7 @@ class MANGOS_DLL_SPEC WorldSession void HandleTutorialClearOpcode(WorldPacket& recv_data); void HandleTutorialResetOpcode(WorldPacket& recv_data); - //Pet + // Pet void HandlePetAction(WorldPacket& recv_data); void HandlePetStopAttack(WorldPacket& recv_data); void HandlePetNameQueryOpcode(WorldPacket& recv_data); @@ -752,7 +752,7 @@ class MANGOS_DLL_SPEC WorldSession void HandleTotemDestroyed(WorldPacket& recv_data); - //BattleGround + // BattleGround void HandleBattlemasterHelloOpcode(WorldPacket& recv_data); void HandleBattlemasterJoinOpcode(WorldPacket& recv_data); void HandleBattleGroundPlayerPositionsOpcode(WorldPacket& recv_data); diff --git a/src/game/WorldSocket.cpp b/src/game/WorldSocket.cpp index 4649cc9e0..921b2aca0 100644 --- a/src/game/WorldSocket.cpp +++ b/src/game/WorldSocket.cpp @@ -346,7 +346,7 @@ int WorldSocket::handle_output(ACE_HANDLE) return -1; } - else if (n < (ssize_t)send_len) //now n > 0 + else if (n < (ssize_t)send_len) // now n > 0 { m_OutBuffer->rd_ptr(static_cast(n)); @@ -355,7 +355,7 @@ int WorldSocket::handle_output(ACE_HANDLE) return schedule_wakeup_output(Guard); } - else //now n == send_len + else // now n == send_len { m_OutBuffer->reset(); @@ -403,7 +403,7 @@ int WorldSocket::handle_output_queue(GuardType& g) mblk->release(); return -1; } - else if (n < (ssize_t)send_len) //now n > 0 + else if (n < (ssize_t)send_len) // now n > 0 { mblk->rd_ptr(static_cast(n)); @@ -416,7 +416,7 @@ int WorldSocket::handle_output_queue(GuardType& g) return schedule_wakeup_output(g); } - else //now n == send_len + else // now n == send_len { mblk->release(); @@ -557,7 +557,7 @@ int WorldSocket::handle_input_missing_data(void) { if (m_Header.space() > 0) { - //need to receive the header + // need to receive the header const size_t to_header = (message_block.length() > m_Header.space() ? m_Header.space() : message_block.length()); m_Header.copy(message_block.rd_ptr(), to_header); message_block.rd_ptr(to_header); @@ -591,7 +591,7 @@ int WorldSocket::handle_input_missing_data(void) // We have full read header, now check the data payload if (m_RecvPct.space() > 0) { - //need more data in the payload + // need more data in the payload const size_t to_data = (message_block.length() > m_RecvPct.space() ? m_RecvPct.space() : message_block.length()); m_RecvPct.copy(message_block.rd_ptr(), to_data); message_block.rd_ptr(to_data); @@ -605,7 +605,7 @@ int WorldSocket::handle_input_missing_data(void) } } - //just received fresh new payload + // just received fresh new payload if (handle_input_payload() == -1) { MANGOS_ASSERT((errno != EWOULDBLOCK) && (errno != EAGAIN)); @@ -825,8 +825,8 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) s.SetHexStr(fields[6].GetString()); m_s = s; - const char* sStr = s.AsHexStr(); //Must be freed by OPENSSL_free() - const char* vStr = v.AsHexStr(); //Must be freed by OPENSSL_free() + const char* sStr = s.AsHexStr(); // Must be freed by OPENSSL_free() + const char* vStr = v.AsHexStr(); // Must be freed by OPENSSL_free() DEBUG_LOG("WorldSocket::HandleAuthSession: (s,v) check s: %s v: %s", sStr, @@ -962,7 +962,7 @@ int WorldSocket::HandlePing(WorldPacket& recvPacket) recvPacket >> latency; if (m_LastPingTime == ACE_Time_Value::zero) - m_LastPingTime = ACE_OS::gettimeofday(); // for 1st ping + m_LastPingTime = ACE_OS::gettimeofday(); // for 1st ping else { ACE_Time_Value cur_time = ACE_OS::gettimeofday(); diff --git a/src/game/debugcmds.cpp b/src/game/debugcmds.cpp index 1efa79e7f..36fa0db73 100644 --- a/src/game/debugcmds.cpp +++ b/src/game/debugcmds.cpp @@ -245,7 +245,7 @@ bool ChatHandler::HandleDebugPlayMovieCommand(char* args) return true; } -//Play sound +// Play sound bool ChatHandler::HandleDebugPlaySoundCommand(char* args) { // USAGE: .debug playsound #soundid @@ -278,7 +278,7 @@ bool ChatHandler::HandleDebugPlaySoundCommand(char* args) return true; } -//Send notification in channel +// Send notification in channel bool ChatHandler::HandleDebugSendChannelNotifyCommand(char* args) { const char* name = "test"; @@ -296,7 +296,7 @@ bool ChatHandler::HandleDebugSendChannelNotifyCommand(char* args) return true; } -//Send notification in chat +// Send notification in chat bool ChatHandler::HandleDebugSendChatMsgCommand(char* args) { const char* msg = "testtest"; @@ -671,7 +671,7 @@ bool ChatHandler::HandleDebugSendSetPhaseShiftCommand(char* args) return true; } -//show animation +// show animation bool ChatHandler::HandleDebugAnimCommand(char* args) { uint32 emote_id; diff --git a/src/game/movement/MoveSpline.cpp b/src/game/movement/MoveSpline.cpp index f2f6ef98c..217b52f13 100644 --- a/src/game/movement/MoveSpline.cpp +++ b/src/game/movement/MoveSpline.cpp @@ -52,7 +52,7 @@ namespace Movement c.orientation = facing.angle; else if (splineflags.final_point) c.orientation = atan2(facing.f.y - c.y, facing.f.x - c.x); - //nothing to do for MoveSplineFlag::Final_Target flag + // nothing to do for MoveSplineFlag::Final_Target flag } else { @@ -74,7 +74,7 @@ namespace Movement if (time_passed > effect_start_time) { float t_passedf = MSToSec(time_passed - effect_start_time); - float t_durationf = MSToSec(Duration() - effect_start_time); //client use not modified duration here + float t_durationf = MSToSec(Duration() - effect_start_time); // client use not modified duration here // -a*x*x + bx + c: //(dur * v3->z_acceleration * dt)/2 - (v3->z_acceleration * dt * dt)/2 + Z; @@ -131,8 +131,8 @@ namespace Movement { uint32 cyclic_point = 0; // MoveSplineFlag::Enter_Cycle support dropped - //if (splineflags & SPLINEFLAG_ENTER_CYCLE) - //cyclic_point = 1; // shouldn't be modified, came from client + // if (splineflags & SPLINEFLAG_ENTER_CYCLE) + // cyclic_point = 1; // shouldn't be modified, came from client spline.init_cyclic_spline(&args.path[0], args.path.size(), modes[args.flags.isSmooth()], cyclic_point); } else @@ -207,7 +207,7 @@ namespace Movement CHECK(path.size() > 1); CHECK(velocity > 0.f); CHECK(time_perc >= 0.f && time_perc <= 1.f); - //CHECK(_checkPathBounds()); + // CHECK(_checkPathBounds()); return true; #undef CHECK } diff --git a/src/game/movement/MoveSpline.h b/src/game/movement/MoveSpline.h index f2319f434..edff11eaa 100644 --- a/src/game/movement/MoveSpline.h +++ b/src/game/movement/MoveSpline.h @@ -60,8 +60,8 @@ namespace Movement int32 time_passed; // currently duration mods are unused, but its _currently_ - //float duration_mod; - //float duration_mod_next; + // float duration_mod; + // float duration_mod_next; float vertical_acceleration; float initialOrientation; int32 effect_start_time; diff --git a/src/game/movement/MoveSplineInit.cpp b/src/game/movement/MoveSplineInit.cpp index 4ceb22592..d668645de 100644 --- a/src/game/movement/MoveSplineInit.cpp +++ b/src/game/movement/MoveSplineInit.cpp @@ -41,7 +41,7 @@ namespace Movement } else if (moveFlags & MOVEFLAG_WALK_MODE) { - //if ( speed_obj.run > speed_obj.walk ) + // if ( speed_obj.run > speed_obj.walk ) return MOVE_WALK; } else if (moveFlags & MOVEFLAG_BACKWARD /*&& speed_obj.run >= speed_obj.run_back*/) diff --git a/src/game/movement/packet_builder.cpp b/src/game/movement/packet_builder.cpp index 3668ab73b..752e99bb4 100644 --- a/src/game/movement/packet_builder.cpp +++ b/src/game/movement/packet_builder.cpp @@ -148,9 +148,9 @@ namespace Movement void PacketBuilder::WriteCreate(const MoveSpline& move_spline, ByteBuffer& data) { - //WriteClientStatus(mov,data); - //data.append(&mov.m_float_values[SpeedWalk], SpeedMaxCount); - //if (mov.SplineEnabled()) + // WriteClientStatus(mov,data); + // data.append(&mov.m_float_values[SpeedWalk], SpeedMaxCount); + // if (mov.SplineEnabled()) { MoveSplineFlag splineFlags = move_spline.splineflags; diff --git a/src/game/movement/spline.cpp b/src/game/movement/spline.cpp index ff7157ce6..94aef891d 100644 --- a/src/game/movement/spline.cpp +++ b/src/game/movement/spline.cpp @@ -281,7 +281,7 @@ namespace Movement index_lo = 0; index_hi = t - 1; - //mov_assert(points.size() % 3 == 0); + // mov_assert(points.size() % 3 == 0); } void SplineBase::clear() diff --git a/src/game/movement/util.cpp b/src/game/movement/util.cpp index b419a5ac1..fcdc9f48e 100644 --- a/src/game/movement/util.cpp +++ b/src/game/movement/util.cpp @@ -88,7 +88,7 @@ namespace Movement if (t_passed > terminalFallTime) { - //result = terminalVelocity * (t_passed - terminal_time) + gravity*terminal_time*terminal_time*0.5f; + // result = terminalVelocity * (t_passed - terminal_time) + gravity*terminal_time*terminal_time*0.5f; // simplified view: result = terminalVelocity * (t_passed - terminalFallTime) + terminal_length; } @@ -111,7 +111,7 @@ namespace Movement STR(Pitch_Up), // 0x00000040, STR(Pitch_Down), // 0x00000080, - STR(Walk), // 0x00000100, // Walking + STR(Walk), // 0x00000100, // Walking STR(Ontransport), // 0x00000200, STR(Levitation), // 0x00000400, STR(Root), // 0x00000800, @@ -124,15 +124,15 @@ namespace Movement STR(PendingSTRafeleft), // 0x00040000, STR(PendingSTRaferight), // 0x00080000, STR(Pendingroot), // 0x00100000, - STR(Swimming), // 0x00200000, // Appears With Fly Flag Also - STR(Ascending), // 0x00400000, // Swim Up Also - STR(Descending), // 0x00800000, // Swim Down Also - STR(Can_Fly), // 0x01000000, // Can Fly In 3.3? - STR(Flying), // 0x02000000, // Actual Flying Mode - STR(Spline_Elevation), // 0x04000000, // Used For Flight Paths - STR(Spline_Enabled), // 0x08000000, // Used For Flight Paths - STR(Waterwalking), // 0x10000000, // Prevent Unit From Falling Through Water - STR(Safe_Fall), // 0x20000000, // Active Rogue Safe Fall Spell (Passive) + STR(Swimming), // 0x00200000, // Appears With Fly Flag Also + STR(Ascending), // 0x00400000, // Swim Up Also + STR(Descending), // 0x00800000, // Swim Down Also + STR(Can_Fly), // 0x01000000, // Can Fly In 3.3? + STR(Flying), // 0x02000000, // Actual Flying Mode + STR(Spline_Elevation), // 0x04000000, // Used For Flight Paths + STR(Spline_Enabled), // 0x08000000, // Used For Flight Paths + STR(Waterwalking), // 0x10000000, // Prevent Unit From Falling Through Water + STR(Safe_Fall), // 0x20000000, // Active Rogue Safe Fall Spell (Passive) STR(Hover), // 0x40000000 STR(Unknown13), // 0x80000000 STR(Unk1), diff --git a/src/game/pchdef.h b/src/game/pchdef.h index c070d8015..34e0fc856 100644 --- a/src/game/pchdef.h +++ b/src/game/pchdef.h @@ -1,4 +1,4 @@ -//add here most rarely modified headers to speed up debug build compilation +// add here most rarely modified headers to speed up debug build compilation #include "WorldSocket.h" // must be first to make ACE happy with ACE includes in it #include "Common.h" diff --git a/src/game/vmap/BIH.cpp b/src/game/vmap/BIH.cpp index 4d8d224f9..01ab86af2 100644 --- a/src/game/vmap/BIH.cpp +++ b/src/game/vmap/BIH.cpp @@ -23,7 +23,7 @@ void BIH::buildHierarchy(std::vector& tempTree, buildData& dat, BuildSta // create space for the first node tempTree.push_back(3 << 30); // dummy leaf tempTree.insert(tempTree.end(), 2, 0); - //tempTree.add(0); + // tempTree.add(0); // seed bbox AABound gridBox = { bounds.low(), bounds.high() }; @@ -58,7 +58,7 @@ void BIH::subdivide(int left, int right, std::vector& tempTree, buildDat { if (nodeBox.hi[i] < gridBox.lo[i] || nodeBox.lo[i] > gridBox.hi[i]) { - //UI.printError(Module.ACCEL, "Reached tree area in error - discarding node with: %d objects", right - left + 1); + // UI.printError(Module.ACCEL, "Reached tree area in error - discarding node with: %d objects", right - left + 1); throw std::logic_error("invalid node overlap"); } } diff --git a/src/game/vmap/BIH.h b/src/game/vmap/BIH.h index 23a5df612..7b46f2f13 100644 --- a/src/game/vmap/BIH.h +++ b/src/game/vmap/BIH.h @@ -108,7 +108,7 @@ class BIH objects.resize(dat.numPrims); for (uint32 i = 0; i < dat.numPrims; ++i) objects[i] = dat.indices[i]; - //nObjects = dat.numPrims; + // nObjects = dat.numPrims; tree = tempTree; delete[] dat.primBound; delete[] dat.indices; diff --git a/src/game/vmap/MapTree.cpp b/src/game/vmap/MapTree.cpp index ff1b4742a..6e89f7dd2 100644 --- a/src/game/vmap/MapTree.cpp +++ b/src/game/vmap/MapTree.cpp @@ -90,7 +90,7 @@ namespace VMAP std::stringstream tilefilename; tilefilename.fill('0'); tilefilename << std::setw(3) << mapID << "_"; - //tilefilename << std::setw(2) << tileX << "_" << std::setw(2) << tileY << ".vmtile"; + // tilefilename << std::setw(2) << tileX << "_" << std::setw(2) << tileY << ".vmtile"; tilefilename << std::setw(2) << tileY << "_" << std::setw(2) << tileX << ".vmtile"; return tilefilename.str(); } @@ -278,7 +278,7 @@ namespace VMAP else { char chunk[8]; - //general info + // general info if (!readChunk(rf, chunk, VMAP_MAGIC, 8)) success = false; char tiled; if (success && fread(&tiled, sizeof(char), 1, rf) != 1) success = false; diff --git a/src/game/vmap/MapTree.h b/src/game/vmap/MapTree.h index 8982a5cb8..69775b8fe 100644 --- a/src/game/vmap/MapTree.h +++ b/src/game/vmap/MapTree.h @@ -58,7 +58,7 @@ namespace VMAP private: bool getIntersectionTime(const G3D::Ray& pRay, float& pMaxDist, bool pStopAtFirstHit) const; - //bool containsLoadedMapTile(unsigned int pTileIdent) const { return(iLoadedMapTiles.containsKey(pTileIdent)); } + // bool containsLoadedMapTile(unsigned int pTileIdent) const { return(iLoadedMapTiles.containsKey(pTileIdent)); } public: static std::string getTileFileName(uint32 mapID, uint32 tileX, uint32 tileY); static uint32 packTileID(uint32 tileX, uint32 tileY) { return tileX << 16 | tileY; } diff --git a/src/game/vmap/ModelInstance.cpp b/src/game/vmap/ModelInstance.cpp index 4aba0d517..8f1201818 100644 --- a/src/game/vmap/ModelInstance.cpp +++ b/src/game/vmap/ModelInstance.cpp @@ -136,7 +136,7 @@ namespace VMAP { // child bounds are defined in object space: Vector3 pModel = iInvRot * (p - iPos) * iInvScale; - //Vector3 zDirModel = iInvRot * Vector3(0.f, 0.f, -1.f); + // Vector3 zDirModel = iInvRot * Vector3(0.f, 0.f, -1.f); float zLevel; if (info.hitModel->GetLiquidLevel(pModel, zLevel)) { diff --git a/src/game/vmap/ModelInstance.h b/src/game/vmap/ModelInstance.h index d53286941..1266847ce 100644 --- a/src/game/vmap/ModelInstance.h +++ b/src/game/vmap/ModelInstance.h @@ -42,7 +42,7 @@ namespace VMAP class ModelSpawn { public: - //mapID, tileX, tileY, Flags, ID, Pos, Rot, Scale, Bound_lo, Bound_hi, name + // mapID, tileX, tileY, Flags, ID, Pos, Rot, Scale, Bound_lo, Bound_hi, name uint32 flags; uint16 adtId; uint32 ID; @@ -52,7 +52,7 @@ namespace VMAP G3D::AABox iBound; std::string name; bool operator==(const ModelSpawn& other) const { return ID == other.ID; } - //uint32 hashCode() const { return ID; } + // uint32 hashCode() const { return ID; } // temp? const G3D::AABox& getBounds() const { return iBound; } diff --git a/src/game/vmap/TileAssembler.cpp b/src/game/vmap/TileAssembler.cpp index 3456f2076..6bb65c807 100644 --- a/src/game/vmap/TileAssembler.cpp +++ b/src/game/vmap/TileAssembler.cpp @@ -60,13 +60,13 @@ namespace VMAP iFilterMethod = NULL; iSrcDir = pSrcDirName; iDestDir = pDestDirName; - //mkdir(iDestDir); - //init(); + // mkdir(iDestDir); + // init(); } TileAssembler::~TileAssembler() { - //delete iCoordModelMapping; + // delete iCoordModelMapping; } bool TileAssembler::convertWorld2() @@ -94,7 +94,7 @@ namespace VMAP else if (entry->second.flags & MOD_WORLDSPAWN) // WMO maps and terrain maps use different origin, so we need to adapt :/ { // TODO: remove extractor hack and uncomment below line: - //entry->second.iPos += Vector3(533.33333f*32, 533.33333f*32, 0.f); + // entry->second.iPos += Vector3(533.33333f*32, 533.33333f*32, 0.f); entry->second.iBound = entry->second.iBound + Vector3(533.33333f * 32, 533.33333f * 32, 0.f); } mapSpawns.push_back(&(entry->second)); @@ -121,7 +121,7 @@ namespace VMAP break; } - //general info + // general info if (success && fwrite(VMAP_MAGIC, 1, 8, mapfile) != 8) success = false; uint32 globalTileID = StaticMapTree::packTileID(65, 65); pair globalRange = map_iter->second->TileEntries.equal_range(globalTileID); @@ -148,7 +148,7 @@ namespace VMAP for (tile = tileEntries.begin(); tile != tileEntries.end(); ++tile) { const ModelSpawn& spawn = map_iter->second->UniqueEntries[tile->second]; - if (spawn.flags & MOD_WORLDSPAWN) // WDT spawn, saved as tile 65/65 currently... + if (spawn.flags & MOD_WORLDSPAWN) // WDT spawn, saved as tile 65/65 currently... continue; uint32 nSpawns = tileEntries.count(tile->first); std::stringstream tilefilename; @@ -175,7 +175,7 @@ namespace VMAP } fclose(tilefile); } - // break; //test, extract only first map; TODO: remvoe this line + // break; // test, extract only first map; TODO: remvoe this line } // export objects @@ -191,7 +191,7 @@ namespace VMAP } } - //cleanup: + // cleanup: for (MapData::iterator map_iter = mapData.begin(); map_iter != mapData.end(); ++map_iter) { delete map_iter->second; @@ -490,7 +490,7 @@ namespace VMAP success = model.writeFile(iDestDir + "/" + pModelFilename + ".vmo"); } - //std::cout << "readRawFile2: '" << pModelFilename << "' tris: " << nElements << " nodes: " << nNodes << std::endl; + // std::cout << "readRawFile2: '" << pModelFilename << "' tris: " << nElements << " nodes: " << nNodes << std::endl; return success; } } diff --git a/src/game/vmap/VMapFactory.cpp b/src/game/vmap/VMapFactory.cpp index 4c0b75a41..7cfa074c3 100644 --- a/src/game/vmap/VMapFactory.cpp +++ b/src/game/vmap/VMapFactory.cpp @@ -114,7 +114,7 @@ namespace VMAP IVMapManager* VMapFactory::createOrGetVMapManager() { if (gVMapManager == 0) - gVMapManager = new VMapManager2(); // should be taken from config ... Please change if you like :-) + gVMapManager = new VMapManager2(); // should be taken from config ... Please change if you like :-) return gVMapManager; } diff --git a/src/game/vmap/VMapManager2.cpp b/src/game/vmap/VMapManager2.cpp index e74d65a39..66b4275bc 100644 --- a/src/game/vmap/VMapManager2.cpp +++ b/src/game/vmap/VMapManager2.cpp @@ -205,7 +205,7 @@ namespace VMAP float VMapManager2::getHeight(unsigned int pMapId, float x, float y, float z, float maxSearchDist) { - float height = VMAP_INVALID_HEIGHT_VALUE; //no height + float height = VMAP_INVALID_HEIGHT_VALUE; // no height if (isHeightCalcEnabled()) { InstanceTreeMap::iterator instanceTree = iInstanceMapTrees.find(pMapId); @@ -215,7 +215,7 @@ namespace VMAP height = instanceTree->second->getHeight(pos, maxSearchDist); if (!(height < G3D::inf())) { - height = VMAP_INVALID_HEIGHT_VALUE; //no height + height = VMAP_INVALID_HEIGHT_VALUE; // no height } } } diff --git a/src/game/vmap/WorldModel.cpp b/src/game/vmap/WorldModel.cpp index 3e98621f7..83d43724d 100644 --- a/src/game/vmap/WorldModel.cpp +++ b/src/game/vmap/WorldModel.cpp @@ -444,14 +444,14 @@ namespace VMAP void operator()(const Vector3& point, uint32 entry) { float group_Z; - //float pVol = prims[entry].GetBound().volume(); - //if(pVol < minVol) + // float pVol = prims[entry].GetBound().volume(); + // if(pVol < minVol) //{ /* if (prims[entry].iBound.contains(point)) */ if (prims[entry].IsInsideObject(point, zVec, group_Z)) { - //minVol = pVol; - //hit = prims + entry; + // minVol = pVol; + // hit = prims + entry; if (group_Z < zDist) { zDist = group_Z; @@ -465,7 +465,7 @@ namespace VMAP #endif } //} - //std::cout << "trying to intersect '" << prims[entry].name << "'\n"; + // std::cout << "trying to intersect '" << prims[entry].name << "'\n"; } }; @@ -521,8 +521,8 @@ namespace VMAP if (count) { if (result && fwrite("GMOD", 1, 4, wf) != 4) result = false; - //chunkSize = sizeof(uint32)+ sizeof(GroupModel)*count; - //if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1) result = false; + // chunkSize = sizeof(uint32)+ sizeof(GroupModel)*count; + // if (result && fwrite(&chunkSize, sizeof(uint32), 1, wf) != 1) result = false; if (result && fwrite(&count, sizeof(uint32), 1, wf) != 1) result = false; for (uint32 i = 0; i < groupModels.size() && result; ++i) result = groupModels[i].writeToFile(wf); @@ -554,11 +554,11 @@ namespace VMAP // read group models if (result && readChunk(rf, chunk, "GMOD", 4)) { - //if (fread(&chunkSize, sizeof(uint32), 1, rf) != 1) result = false; + // if (fread(&chunkSize, sizeof(uint32), 1, rf) != 1) result = false; if (result && fread(&count, sizeof(uint32), 1, rf) != 1) result = false; if (result) groupModels.resize(count); - //if (result && fread(&groupModels[0], sizeof(GroupModel), count, rf) != count) result = false; + // if (result && fread(&groupModels[0], sizeof(GroupModel), count, rf) != count) result = false; for (uint32 i = 0; i < count && result; ++i) result = groupModels[i].readFromFile(rf); diff --git a/src/mangosd/CliRunnable.cpp b/src/mangosd/CliRunnable.cpp index 7cdaf1657..9b302ab08 100644 --- a/src/mangosd/CliRunnable.cpp +++ b/src/mangosd/CliRunnable.cpp @@ -588,7 +588,7 @@ int kb_hit_return() void CliRunnable::run() { ///- Init new SQL thread for the world database (one connection call enough) - WorldDatabase.ThreadStart(); // let thread do safe mySQL requests + WorldDatabase.ThreadStart(); // let thread do safe mySQL requests char commandbuf[256]; @@ -646,5 +646,5 @@ void CliRunnable::run() } ///- End the database thread - WorldDatabase.ThreadEnd(); // free mySQL thread resources + WorldDatabase.ThreadEnd(); // free mySQL thread resources } diff --git a/src/mangosd/Master.cpp b/src/mangosd/Master.cpp index 3b0a039c3..a89b1ae2c 100644 --- a/src/mangosd/Master.cpp +++ b/src/mangosd/Master.cpp @@ -79,7 +79,7 @@ class FreezeDetectorRunnable : public ACE_Based::Runnable ACE_Based::Thread::Sleep(1000); uint32 curtime = WorldTimer::getMSTime(); - //DEBUG_LOG("anti-freeze: time=%u, counters=[%u; %u]",curtime,Master::m_masterLoopCounter,World::m_worldLoopCounter); + // DEBUG_LOG("anti-freeze: time=%u, counters=[%u; %u]",curtime,Master::m_masterLoopCounter,World::m_worldLoopCounter); // normal work if (w_loops != World::m_worldLoopCounter) @@ -91,7 +91,7 @@ class FreezeDetectorRunnable : public ACE_Based::Runnable else if (WorldTimer::getMSTimeDiff(w_lastchange, curtime) > _delaytime) { sLog.outError("World Thread hangs, kicking out server!"); - *((uint32 volatile*)NULL) = 0; // bang crash + *((uint32 volatile*)NULL) = 0; // bang crash } } sLog.outString("Anti-freeze thread exiting without problems."); @@ -204,8 +204,8 @@ int Master::Run() #ifndef WIN32 detachDaemon(); #endif - //server loaded successfully => enable async DB requests - //this is done to forbid any async transactions during server startup! + // server loaded successfully => enable async DB requests + // this is done to forbid any async transactions during server startup! CharacterDatabase.AllowAsyncTransactions(); WorldDatabase.AllowAsyncTransactions(); LoginDatabase.AllowAsyncTransactions(); diff --git a/src/mangosd/RASocket.cpp b/src/mangosd/RASocket.cpp index a44f6f80b..5ebc6c1e5 100644 --- a/src/mangosd/RASocket.cpp +++ b/src/mangosd/RASocket.cpp @@ -230,7 +230,7 @@ int RASocket::handle_input(ACE_HANDLE) ///
  • If the input is '' (and the user already gave his username) case LG: { - //login+pass ok + // login+pass ok std::string pw = inputBuffer; if (sAccountMgr.CheckPassword(accId, pw)) diff --git a/src/mangosd/RASocket.h b/src/mangosd/RASocket.h index da7a4e780..7beaa328c 100644 --- a/src/mangosd/RASocket.h +++ b/src/mangosd/RASocket.h @@ -78,15 +78,15 @@ class RASocket: protected RAHandler uint32 accId; AccountTypes accAccessLevel; - bool bSecure; //kick on wrong pass, non exist. user OR user with no priv - //will protect from DOS, bruteforce attacks + bool bSecure; // kick on wrong pass, non exist. user OR user with no priv + // will protect from DOS, bruteforce attacks bool bStricted; // not allow execute console only commands (SEC_CONSOLE) remotly AccountTypes iMinLevel; enum { - NONE, //initial value - LG, //only login was entered - OK, //both login and pass were given, they were correct and user has enough priv. + NONE, // initial value + LG, // only login was entered + OK, // both login and pass were given, they were correct and user has enough priv. } stage; static void zprint(void* callbackArg, const char* szText); diff --git a/src/mangosd/WorldRunnable.cpp b/src/mangosd/WorldRunnable.cpp index c2a586004..8c9aef004 100644 --- a/src/mangosd/WorldRunnable.cpp +++ b/src/mangosd/WorldRunnable.cpp @@ -41,7 +41,7 @@ extern int m_ServiceStatus; void WorldRunnable::run() { ///- Init new SQL thread for the world database - WorldDatabase.ThreadStart(); // let thread do safe mySQL requests (one connection call enough) + WorldDatabase.ThreadStart(); // let thread do safe mySQL requests (one connection call enough) sWorld.InitResultQueue(); uint32 realCurrTime = 0; @@ -89,5 +89,5 @@ void WorldRunnable::run() MapManager::Instance().UnloadAll(); // unload all grids (including locked in memory) ///- End the database thread - WorldDatabase.ThreadEnd(); // free mySQL thread resources + WorldDatabase.ThreadEnd(); // free mySQL thread resources } diff --git a/src/realmd/AuthCodes.h b/src/realmd/AuthCodes.h index 4071a7425..85fea8961 100644 --- a/src/realmd/AuthCodes.h +++ b/src/realmd/AuthCodes.h @@ -76,16 +76,16 @@ enum AuthResult WOW_FAIL_LOCKED_ENFORCED = 0x10, ///< You have applied a lock to your account. You can change your locked status by calling your account lock phone number. WOW_FAIL_TRIAL_ENDED = 0x11, ///< Your trial subscription has expired. Please visit to upgrade your account. WOW_FAIL_USE_BATTLENET = 0x12, ///< WOW_FAIL_OTHER This account is now attached to a Battle.net account. Please login with your Battle.net account email address and password. - //WOW_FAIL_OVERMIND_CONVERTED - //WOW_FAIL_ANTI_INDULGENCE - //WOW_FAIL_EXPIRED - //WOW_FAIL_NO_GAME_ACCOUNT - //WOW_FAIL_BILLING_LOCK - //WOW_FAIL_IGR_WITHOUT_BNET - //WOW_FAIL_AA_LOCK - //WOW_FAIL_UNLOCKABLE_LOCK - //WOW_FAIL_MUST_USE_BNET - //WOW_FAIL_OTHER + // WOW_FAIL_OVERMIND_CONVERTED + // WOW_FAIL_ANTI_INDULGENCE + // WOW_FAIL_EXPIRED + // WOW_FAIL_NO_GAME_ACCOUNT + // WOW_FAIL_BILLING_LOCK + // WOW_FAIL_IGR_WITHOUT_BNET + // WOW_FAIL_AA_LOCK + // WOW_FAIL_UNLOCKABLE_LOCK + // WOW_FAIL_MUST_USE_BNET + // WOW_FAIL_OTHER }; #endif diff --git a/src/realmd/AuthSocket.cpp b/src/realmd/AuthSocket.cpp index 7d5b5e18a..66171f17f 100644 --- a/src/realmd/AuthSocket.cpp +++ b/src/realmd/AuthSocket.cpp @@ -77,7 +77,7 @@ typedef struct AUTH_LOGON_CHALLENGE_C uint8 I[1]; } sAuthLogonChallenge_C; -//typedef sAuthLogonChallenge_C sAuthReconnectChallenge_C; +// typedef sAuthLogonChallenge_C sAuthReconnectChallenge_C; /* typedef struct { @@ -127,9 +127,9 @@ typedef struct AUTH_LOGON_PROOF_S_BUILD_6005 uint8 cmd; uint8 error; uint8 M2[20]; - //uint32 unk1; + // uint32 unk1; uint32 unk2; - //uint16 unk3; + // uint16 unk3; } sAuthLogonProof_S_BUILD_6005; typedef struct AUTH_RECONNECT_PROOF_C @@ -335,7 +335,7 @@ bool AuthSocket::_HandleLogonChallenge() if ((remaining < sizeof(sAuthLogonChallenge_C) - buf.size()) || (recv_len() < remaining)) return false; - //No big fear of memory outage (size is int16, i.e. < 65536) + // No big fear of memory outage (size is int16, i.e. < 65536) buf.resize(remaining + buf.size() + 1); buf[buf.size() - 1] = 0; sAuthLogonChallenge_C* ch = (sAuthLogonChallenge_C*)&buf[0]; @@ -361,10 +361,10 @@ bool AuthSocket::_HandleLogonChallenge() _build = ch->build; ///- Normalize account name - //utf8ToUpperOnlyLatin(_login); -- client already send account in expected form + // utf8ToUpperOnlyLatin(_login); -- client already send account in expected form - //Escape the user login to avoid further SQL injection - //Memory will be freed on AuthSocket object destruction + // Escape the user login to avoid further SQL injection + // Memory will be freed on AuthSocket object destruction _safelogin = _login; LoginDatabase.escape_string(_safelogin); @@ -703,7 +703,7 @@ bool AuthSocket::_HandleLogonProof() uint32 MaxWrongPassCount = sConfig.GetIntDefault("WrongPass.MaxCount", 0); if (MaxWrongPassCount > 0) { - //Increment number of failed logins by one and if it reaches the limit temporarily ban that account or IP + // Increment number of failed logins by one and if it reaches the limit temporarily ban that account or IP LoginDatabase.PExecute("UPDATE account SET failed_logins = failed_logins + 1 WHERE username = '%s'", _safelogin.c_str()); if (QueryResult* loginfail = LoginDatabase.PQuery("SELECT id, failed_logins FROM account WHERE username = '%s'", _safelogin.c_str())) @@ -761,7 +761,7 @@ bool AuthSocket::_HandleReconnectChallenge() if ((remaining < sizeof(sAuthLogonChallenge_C) - buf.size()) || (recv_len() < remaining)) return false; - //No big fear of memory outage (size is int16, i.e. < 65536) + // No big fear of memory outage (size is int16, i.e. < 65536) buf.resize(remaining + buf.size() + 1); buf[buf.size() - 1] = 0; sAuthLogonChallenge_C* ch = (sAuthLogonChallenge_C*)&buf[0]; diff --git a/src/realmd/AuthSocket.h b/src/realmd/AuthSocket.h index 9e5ab0641..0e9fa31d7 100644 --- a/src/realmd/AuthSocket.h +++ b/src/realmd/AuthSocket.h @@ -49,7 +49,7 @@ class AuthSocket: public BufferedSocket bool _HandleReconnectChallenge(); bool _HandleReconnectProof(); bool _HandleRealmList(); - //data transfer handle for patch + // data transfer handle for patch bool _HandleXferResume(); bool _HandleXferCancel(); diff --git a/src/realmd/Main.cpp b/src/realmd/Main.cpp index a58635cc7..f1ee12d77 100644 --- a/src/realmd/Main.cpp +++ b/src/realmd/Main.cpp @@ -317,7 +317,7 @@ extern int main(int argc, char** argv) } #endif - //server has started up successfully => enable async DB requests + // server has started up successfully => enable async DB requests LoginDatabase.AllowAsyncTransactions(); // maximum counter for next ping diff --git a/src/realmd/PatchHandler.cpp b/src/realmd/PatchHandler.cpp index 129fc2da1..df7a651d2 100644 --- a/src/realmd/PatchHandler.cpp +++ b/src/realmd/PatchHandler.cpp @@ -91,7 +91,7 @@ int PatchHandler::open(void*) { return -1; } -#endif //TCP_CORK +#endif // TCP_CORK (void) peer().disable(ACE_NONBLOCK); diff --git a/src/shared/Auth/AuthCrypt.cpp b/src/shared/Auth/AuthCrypt.cpp index 15e104882..f7b5ba844 100644 --- a/src/shared/Auth/AuthCrypt.cpp +++ b/src/shared/Auth/AuthCrypt.cpp @@ -43,10 +43,10 @@ void AuthCrypt::Init(BigNumber* K) HMACSHA1 clientDecryptHmac(SEED_KEY_SIZE, (uint8*)ServerDecryptionKey); uint8* decryptHash = clientDecryptHmac.ComputeHash(K); - //SARC4 _serverDecrypt(encryptHash); + // SARC4 _serverDecrypt(encryptHash); _clientDecrypt.Init(decryptHash); _serverEncrypt.Init(encryptHash); - //SARC4 _clientEncrypt(decryptHash); + // SARC4 _clientEncrypt(decryptHash); uint8 syncBuf[1024]; diff --git a/src/shared/ByteBuffer.h b/src/shared/ByteBuffer.h index 5b266d8e2..0a2f048db 100644 --- a/src/shared/ByteBuffer.h +++ b/src/shared/ByteBuffer.h @@ -188,7 +188,7 @@ class ByteBuffer return *this; } - //signed as in 2e complement + // signed as in 2e complement ByteBuffer& operator>>(int8& value) { value = read(); diff --git a/src/shared/Common.cpp b/src/shared/Common.cpp index 608e787d9..531be59c9 100644 --- a/src/shared/Common.cpp +++ b/src/shared/Common.cpp @@ -20,7 +20,7 @@ char const* localeNames[MAX_LOCALE] = { - "enUS", // also enGB + "enUS", // also enGB "koKR", "frFR", "deDE", diff --git a/src/shared/Common.h b/src/shared/Common.h index 1e98a2167..2c15852f5 100644 --- a/src/shared/Common.h +++ b/src/shared/Common.h @@ -23,25 +23,25 @@ #ifdef HAVE_CONFIG_H #ifdef PACKAGE #undef PACKAGE -#endif //PACKAGE +#endif // PACKAGE #ifdef PACKAGE_BUGREPORT #undef PACKAGE_BUGREPORT -#endif //PACKAGE_BUGREPORT +#endif // PACKAGE_BUGREPORT #ifdef PACKAGE_NAME #undef PACKAGE_NAME -#endif //PACKAGE_NAME +#endif // PACKAGE_NAME #ifdef PACKAGE_STRING #undef PACKAGE_STRING -#endif //PACKAGE_STRING +#endif // PACKAGE_STRING #ifdef PACKAGE_TARNAME #undef PACKAGE_TARNAME -#endif //PACKAGE_TARNAME +#endif // PACKAGE_TARNAME #ifdef PACKAGE_VERSION #undef PACKAGE_VERSION -#endif //PACKAGE_VERSION +#endif // PACKAGE_VERSION #ifdef VERSION #undef VERSION -#endif //VERSION +#endif // VERSION # include "config.h" #undef PACKAGE #undef PACKAGE_BUGREPORT @@ -50,7 +50,7 @@ #undef PACKAGE_TARNAME #undef PACKAGE_VERSION #undef VERSION -#endif //HAVE_CONFIG_H +#endif // HAVE_CONFIG_H #include "Platform/Define.h" @@ -225,7 +225,7 @@ struct LocaleNameStr // used for iterate all names including alternative extern LocaleNameStr const fullLocaleNameList[]; -//operator new[] based version of strdup() function! Release memory by using operator delete[] ! +// operator new[] based version of strdup() function! Release memory by using operator delete[] ! inline char* mangos_strdup(const char* source) { char* dest = new char[strlen(source) + 1]; diff --git a/src/shared/Database/DBCFileLoader.cpp b/src/shared/Database/DBCFileLoader.cpp index b572aaa24..8aabdce15 100644 --- a/src/shared/Database/DBCFileLoader.cpp +++ b/src/shared/Database/DBCFileLoader.cpp @@ -165,14 +165,14 @@ char* DBCFileLoader::AutoProduceData(const char* format, uint32& records, char** if (strlen(format) != fieldCount) return NULL; - //get struct size and index pos + // get struct size and index pos int32 i; uint32 recordsize = GetFormatRecordSize(format, &i); if (i >= 0) { uint32 maxi = 0; - //find max index + // find max index for (uint32 y = 0; y < recordCount; ++y) { uint32 ind = getRecord(y).getUInt(i); diff --git a/src/shared/Database/DBCFileLoader.h b/src/shared/Database/DBCFileLoader.h index fd77a9523..b25aba189 100644 --- a/src/shared/Database/DBCFileLoader.h +++ b/src/shared/Database/DBCFileLoader.h @@ -28,13 +28,13 @@ enum FT_NA_BYTE = 'X', // ignore/ default, 1 byte size, see above FT_NA_FLOAT = 'F', // ignore/ default, float size, see above FT_NA_POINTER = 'p', // fill default value into dest, pointer size, Use this only with static data (otherwise mem-leak) - FT_STRING = 's', //char* - FT_FLOAT = 'f', //float - FT_INT = 'i', //uint32 - FT_BYTE = 'b', //uint8 - FT_SORT = 'd', //sorted by this field, field is not included - FT_IND = 'n', //the same,but parsed to data - FT_LOGIC = 'l' //Logical (boolean) + FT_STRING = 's', // char* + FT_FLOAT = 'f', // float + FT_INT = 'i', // uint32 + FT_BYTE = 'b', // uint8 + FT_SORT = 'd', // sorted by this field, field is not included + FT_IND = 'n', // the same,but parsed to data + FT_LOGIC = 'l' // Logical (boolean) }; class DBCFileLoader diff --git a/src/shared/Database/Database.cpp b/src/shared/Database/Database.cpp index 27033340a..3c0df6664 100644 --- a/src/shared/Database/Database.cpp +++ b/src/shared/Database/Database.cpp @@ -50,28 +50,28 @@ SqlPreparedStatement* SqlConnection::GetStmt(int nIndex) if (nIndex < 0) return NULL; - //resize stmt container + // resize stmt container if (m_holder.size() <= nIndex) m_holder.resize(nIndex + 1, NULL); SqlPreparedStatement* pStmt = NULL; - //create stmt if needed + // create stmt if needed if (m_holder[nIndex] == NULL) { - //obtain SQL request string + // obtain SQL request string std::string fmt = m_db.GetStmtString(nIndex); MANGOS_ASSERT(fmt.length()); - //allocate SQlPreparedStatement object + // allocate SQlPreparedStatement object pStmt = CreateStatement(fmt); - //prepare statement + // prepare statement if (!pStmt->prepare()) { MANGOS_ASSERT(false && "Unable to prepare SQL statement"); return NULL; } - //save statement in internal registry + // save statement in internal registry m_holder[nIndex] = pStmt; } else @@ -85,11 +85,11 @@ bool SqlConnection::ExecuteStmt(int nIndex, const SqlStmtParameters& id) if (nIndex == -1) return false; - //get prepared statement object + // get prepared statement object SqlPreparedStatement* pStmt = GetStmt(nIndex); - //bind parameters + // bind parameters pStmt->bind(id); - //execute statement + // execute statement return pStmt->execute(); } @@ -113,9 +113,9 @@ bool Database::Initialize(const char* infoString, int nConns /*= 1*/) m_pingIntervallms = sConfig.GetIntDefault("MaxPingTime", 30) * (MINUTE * 1000); - //create DB connections + // create DB connections - //setup connection pool size + // setup connection pool size if (nConns < MIN_CONNECTION_POOL_SIZE) m_nQueryConnPoolSize = MIN_CONNECTION_POOL_SIZE; else if (nConns > MAX_CONNECTION_POOL_SIZE) @@ -123,7 +123,7 @@ bool Database::Initialize(const char* infoString, int nConns /*= 1*/) else m_nQueryConnPoolSize = nConns; - //create connection pool for sync requests + // create connection pool for sync requests for (int i = 0; i < m_nQueryConnPoolSize; ++i) { SqlConnection* pConn = CreateConnection(); @@ -136,7 +136,7 @@ bool Database::Initialize(const char* infoString, int nConns /*= 1*/) m_pQueryConnections.push_back(pConn); } - //create and initialize connection for async requests + // create and initialize connection for async requests m_pAsyncConn = CreateConnection(); if (!m_pAsyncConn->Initialize(infoString)) return false; @@ -180,7 +180,7 @@ void Database::InitDelayThread() { assert(!m_delayThread); - //New delay thread for delay execute + // New delay thread for delay execute m_threadBody = CreateDelayThread(); // will deleted at m_delayThread delete m_delayThread = new ACE_Based::Thread(m_threadBody); } @@ -189,9 +189,9 @@ void Database::HaltDelayThread() { if (!m_threadBody || !m_delayThread) return; - m_threadBody->Stop(); //Stop event - m_delayThread->wait(); //Wait for flush to DB - delete m_delayThread; //This also deletes m_threadBody + m_threadBody->Stop(); // Stop event + m_delayThread->wait(); // Wait for flush to DB + delete m_delayThread; // This also deletes m_threadBody m_delayThread = NULL; m_threadBody = NULL; } @@ -216,7 +216,7 @@ void Database::escape_string(std::string& str) return; char* buf = new char[str.size() * 2 + 1]; - //we don't care what connection to use - escape string will be the same + // we don't care what connection to use - escape string will be the same m_pQueryConnections[0]->escape_string(buf, str.c_str(), str.size()); str = buf; delete[] buf; @@ -340,12 +340,12 @@ bool Database::Execute(const char* sql) SqlTransaction* pTrans = m_TransStorage->get(); if (pTrans) { - //add SQL request to trans queue + // add SQL request to trans queue pTrans->DelayExecute(new SqlPlainRequest(sql)); } else { - //if async execution is not available + // if async execution is not available if (!m_bAllowAsyncTransactions) return DirectExecute(sql); @@ -401,8 +401,8 @@ bool Database::BeginTransaction() if (!m_pAsyncConn) return false; - //initiate transaction on current thread - //currently we do not support queued transactions + // initiate transaction on current thread + // currently we do not support queued transactions m_TransStorage->init(); return true; } @@ -412,15 +412,15 @@ bool Database::CommitTransaction() if (!m_pAsyncConn) return false; - //check if we have pending transaction + // check if we have pending transaction if (!m_TransStorage->get()) return false; - //if async execution is not available + // if async execution is not available if (!m_bAllowAsyncTransactions) return CommitTransactionDirect(); - //add SqlTransaction to the async queue + // add SqlTransaction to the async queue m_threadBody->Delay(m_TransStorage->detach()); return true; } @@ -430,11 +430,11 @@ bool Database::CommitTransactionDirect() if (!m_pAsyncConn) return false; - //check if we have pending transaction + // check if we have pending transaction if (!m_TransStorage->get()) return false; - //directly execute SqlTransaction + // directly execute SqlTransaction SqlTransaction* pTrans = m_TransStorage->detach(); pTrans->Execute(m_pAsyncConn); delete pTrans; @@ -450,7 +450,7 @@ bool Database::RollbackTransaction() if (!m_TransStorage->get()) return false; - //remove scheduled transaction + // remove scheduled transaction m_TransStorage->reset(); return true; @@ -552,12 +552,12 @@ bool Database::ExecuteStmt(const SqlStatementID& id, SqlStmtParameters* params) SqlTransaction* pTrans = m_TransStorage->get(); if (pTrans) { - //add SQL request to trans queue + // add SQL request to trans queue pTrans->DelayExecute(new SqlPreparedRequest(id.ID(), params)); } else { - //if async execution is not available + // if async execution is not available if (!m_bAllowAsyncTransactions) return DirectExecuteStmt(id, params); @@ -572,7 +572,7 @@ bool Database::DirectExecuteStmt(const SqlStatementID& id, SqlStmtParameters* pa { MANGOS_ASSERT(params); std::auto_ptr p(params); - //execute statement + // execute statement SqlConnection::Lock _guard(getAsyncConnection()); return _guard->ExecuteStmt(id.ID(), *params); } @@ -580,14 +580,14 @@ bool Database::DirectExecuteStmt(const SqlStatementID& id, SqlStmtParameters* pa SqlStatement Database::CreateStatement(SqlStatementID& index, const char* fmt) { int nId = -1; - //check if statement ID is initialized + // check if statement ID is initialized if (!index.initialized()) { - //convert to lower register + // convert to lower register std::string szFmt(fmt); - //count input parameters + // count input parameters int nParams = std::count(szFmt.begin(), szFmt.end(), '?'); - //find existing or add a new record in registry + // find existing or add a new record in registry LOCK_GUARD _guard(m_stmtGuard); PreparedStmtRegistry::const_iterator iter = m_stmtRegistry.find(szFmt); if (iter == m_stmtRegistry.end()) @@ -598,7 +598,7 @@ SqlStatement Database::CreateStatement(SqlStatementID& index, const char* fmt) else nId = iter->second; - //save initialized statement index info + // save initialized statement index info index.init(nId, nParams); } @@ -622,7 +622,7 @@ std::string Database::GetStmtString(const int stmtId) const return std::string(); } -//HELPER CLASSES AND FUNCTIONS +// HELPER CLASSES AND FUNCTIONS Database::TransHelper::~TransHelper() { reset(); @@ -630,7 +630,7 @@ Database::TransHelper::~TransHelper() SqlTransaction* Database::TransHelper::init() { - MANGOS_ASSERT(!m_pTrans); //if we will get a nested transaction request - we MUST fix code!!! + MANGOS_ASSERT(!m_pTrans); // if we will get a nested transaction request - we MUST fix code!!! m_pTrans = new SqlTransaction; return m_pTrans; } diff --git a/src/shared/Database/Database.h b/src/shared/Database/Database.h index da73aaac9..502e0cb08 100644 --- a/src/shared/Database/Database.h +++ b/src/shared/Database/Database.h @@ -43,16 +43,16 @@ class MANGOS_DLL_SPEC SqlConnection public: virtual ~SqlConnection() {} - //method for initializing DB connection + // method for initializing DB connection virtual bool Initialize(const char* infoString) = 0; - //public methods for making queries + // public methods for making queries virtual QueryResult* Query(const char* sql) = 0; virtual QueryNamedResult* QueryNamed(const char* sql) = 0; - //public methods for making requests + // public methods for making requests virtual bool Execute(const char* sql) = 0; - //escape string generation + // escape string generation virtual unsigned long escape_string(char* to, const char* from, unsigned long length) { strncpy(to, from, length); return length; } // nothing do if DB not support transactions @@ -61,10 +61,10 @@ class MANGOS_DLL_SPEC SqlConnection // can't rollback without transaction support virtual bool RollbackTransaction() { return true; } - //methods to work with prepared statements + // methods to work with prepared statements bool ExecuteStmt(int nIndex, const SqlStmtParameters& id); - //SqlConnection object lock + // SqlConnection object lock class Lock { public: @@ -77,19 +77,19 @@ class MANGOS_DLL_SPEC SqlConnection SqlConnection* const m_pConn; }; - //get DB object + // get DB object Database& DB() { return m_db; } protected: SqlConnection(Database& db) : m_db(db) {} virtual SqlPreparedStatement* CreateStatement(const std::string& fmt); - //allocate prepared statement and return statement ID + // allocate prepared statement and return statement ID SqlPreparedStatement* GetStmt(int nIndex); Database& m_db; - //free prepared statements objects + // free prepared statements objects void FreePreparedStatements(); private: @@ -106,9 +106,9 @@ class MANGOS_DLL_SPEC Database virtual ~Database(); virtual bool Initialize(const char* infoString, int nConns = 1); - //start worker thread for async DB request execution + // start worker thread for async DB request execution virtual void InitDelayThread(); - //stop worker thread + // stop worker thread virtual void HaltDelayThread(); /// Synchronous DB queries @@ -187,19 +187,19 @@ class MANGOS_DLL_SPEC Database bool BeginTransaction(); bool CommitTransaction(); bool RollbackTransaction(); - //for sync transaction execution + // for sync transaction execution bool CommitTransactionDirect(); - //PREPARED STATEMENT API + // PREPARED STATEMENT API - //allocate index for prepared statement with SQL request 'fmt' + // allocate index for prepared statement with SQL request 'fmt' SqlStatement CreateStatement(SqlStatementID& index, const char* fmt); - //get prepared statement format string + // get prepared statement format string std::string GetStmtString(const int stmtId) const; operator bool () const { return m_pQueryConnections.size() && m_pAsyncConn != 0; } - //escape string generation + // escape string generation void escape_string(std::string& str); // must be called before first query in thread (one time for thread using one from existing Database objects) @@ -213,12 +213,12 @@ class MANGOS_DLL_SPEC Database bool CheckRequiredField(char const* table_name, char const* required_name); uint32 GetPingIntervall() { return m_pingIntervallms; } - //function to ping database connections + // function to ping database connections void Ping(); - //set this to allow async transactions - //you should call it explicitly after your server successfully started up - //NO ASYNC TRANSACTIONS DURING SERVER STARTUP - ONLY DURING RUNTIME!!! + // set this to allow async transactions + // you should call it explicitly after your server successfully started up + // NO ASYNC TRANSACTIONS DURING SERVER STARTUP - ONLY DURING RUNTIME!!! void AllowAsyncTransactions() { m_bAllowAsyncTransactions = true; } protected: @@ -230,9 +230,9 @@ class MANGOS_DLL_SPEC Database void StopServer(); - //factory method to create SqlConnection objects + // factory method to create SqlConnection objects virtual SqlConnection* CreateConnection() = 0; - //factory method to create SqlDelayThread objects + // factory method to create SqlDelayThread objects virtual SqlDelayThread* CreateDelayThread(); class MANGOS_DLL_SPEC TransHelper @@ -241,63 +241,63 @@ class MANGOS_DLL_SPEC Database TransHelper() : m_pTrans(NULL) {} ~TransHelper(); - //initializes new SqlTransaction object + // initializes new SqlTransaction object SqlTransaction* init(); - //gets pointer on current transaction object. Returns NULL if transaction was not initiated + // gets pointer on current transaction object. Returns NULL if transaction was not initiated SqlTransaction* get() const { return m_pTrans; } - //detaches SqlTransaction object allocated by init() function - //next call to get() function will return NULL! - //do not forget to destroy obtained SqlTransaction object! + // detaches SqlTransaction object allocated by init() function + // next call to get() function will return NULL! + // do not forget to destroy obtained SqlTransaction object! SqlTransaction* detach(); - //destroyes SqlTransaction allocated by init() function + // destroyes SqlTransaction allocated by init() function void reset(); private: SqlTransaction* m_pTrans; }; - //per-thread based storage for SqlTransaction object initialization - no locking is required + // per-thread based storage for SqlTransaction object initialization - no locking is required typedef ACE_TSS DBTransHelperTSS; Database::DBTransHelperTSS m_TransStorage; ///< DB connections - //round-robin connection selection + // round-robin connection selection SqlConnection* getQueryConnection(); - //for now return one single connection for async requests + // for now return one single connection for async requests SqlConnection* getAsyncConnection() const { return m_pAsyncConn; } friend class SqlStatement; - //PREPARED STATEMENT API - //query function for prepared statements + // PREPARED STATEMENT API + // query function for prepared statements bool ExecuteStmt(const SqlStatementID& id, SqlStmtParameters* params); bool DirectExecuteStmt(const SqlStatementID& id, SqlStmtParameters* params); - //connection helper counters - int m_nQueryConnPoolSize; //current size of query connection pool - ACE_Atomic_Op m_nQueryCounter; //counter for connection selection + // connection helper counters + int m_nQueryConnPoolSize; // current size of query connection pool + ACE_Atomic_Op m_nQueryCounter; // counter for connection selection - //lets use pool of connections for sync queries + // lets use pool of connections for sync queries typedef std::vector< SqlConnection* > SqlConnectionContainer; SqlConnectionContainer m_pQueryConnections; - //only one single DB connection for transactions + // only one single DB connection for transactions SqlConnection* m_pAsyncConn; - SqlResultQueue* m_pResultQueue; ///< Transaction queues from diff. threads - SqlDelayThread* m_threadBody; ///< Pointer to delay sql executer (owned by m_delayThread) - ACE_Based::Thread* m_delayThread; ///< Pointer to executer thread + SqlResultQueue* m_pResultQueue; ///< Transaction queues from diff. threads + SqlDelayThread* m_threadBody; ///< Pointer to delay sql executer (owned by m_delayThread) + ACE_Based::Thread* m_delayThread; ///< Pointer to executer thread - bool m_bAllowAsyncTransactions; ///< flag which specifies if async transactions are enabled + bool m_bAllowAsyncTransactions; ///< flag which specifies if async transactions are enabled - //PREPARED STATEMENT REGISTRY + // PREPARED STATEMENT REGISTRY typedef ACE_Thread_Mutex LOCK_TYPE; typedef ACE_Guard LOCK_GUARD; mutable LOCK_TYPE m_stmtGuard; typedef UNORDERED_MAP PreparedStmtRegistry; - PreparedStmtRegistry m_stmtRegistry; ///< + PreparedStmtRegistry m_stmtRegistry; ///< int m_iStmtIndex; diff --git a/src/shared/Database/DatabaseMysql.cpp b/src/shared/Database/DatabaseMysql.cpp index 4e40a13e6..5dd54ba88 100644 --- a/src/shared/Database/DatabaseMysql.cpp +++ b/src/shared/Database/DatabaseMysql.cpp @@ -58,7 +58,7 @@ DatabaseMysql::~DatabaseMysql() { StopServer(); - //Free Mysql library pointers for last ~DB + // Free Mysql library pointers for last ~DB if (--db_count == 0) mysql_library_end(); } @@ -330,10 +330,10 @@ bool MySqlPreparedStatement::prepare() if (isPrepared()) return true; - //remove old binds + // remove old binds RemoveBinds(); - //create statement object + // create statement object m_stmt = mysql_stmt_init(m_pMySQLConn); if (!m_stmt) { @@ -341,7 +341,7 @@ bool MySqlPreparedStatement::prepare() return false; } - //prepare statement + // prepare statement if (mysql_stmt_prepare(m_stmt, m_szFmt.c_str(), m_szFmt.length())) { sLog.outError("SQL: mysql_stmt_prepare() failed for '%s'", m_szFmt.c_str()); @@ -354,7 +354,7 @@ bool MySqlPreparedStatement::prepare() /* Fetch result set meta information */ m_pResultMetadata = mysql_stmt_result_metadata(m_stmt); - //if we do not have result metadata + // if we do not have result metadata if (!m_pResultMetadata && strnicmp(m_szFmt.c_str(), "select", 6) == 0) { sLog.outError("SQL: no meta information for '%s'", m_szFmt.c_str()); @@ -362,22 +362,22 @@ bool MySqlPreparedStatement::prepare() return false; } - //bind input buffers + // bind input buffers if (m_nParams) { m_pInputArgs = new MYSQL_BIND[m_nParams]; memset(m_pInputArgs, 0, sizeof(MYSQL_BIND) * m_nParams); } - //check if we have a statement which returns result sets + // check if we have a statement which returns result sets if (m_pResultMetadata) { - //our statement is query + // our statement is query m_bIsQuery = true; /* Get total columns in the query */ m_nColumns = mysql_num_fields(m_pResultMetadata); - //bind output buffers + // bind output buffers } m_bPrepared = true; @@ -392,11 +392,11 @@ void MySqlPreparedStatement::bind(const SqlStmtParameters& holder) return; } - //finalize adding params + // finalize adding params if (!m_pInputArgs) return; - //verify if we bound all needed input parameters + // verify if we bound all needed input parameters if (m_nParams != holder.boundParams()) { MANGOS_ASSERT(false); @@ -409,11 +409,11 @@ void MySqlPreparedStatement::bind(const SqlStmtParameters& holder) SqlStmtParameters::ParameterContainer::const_iterator iter_last = _args.end(); for (SqlStmtParameters::ParameterContainer::const_iterator iter = _args.begin(); iter != iter_last; ++iter) { - //bind parameter + // bind parameter addParam(nIndex++, (*iter)); } - //bind input arguments + // bind input arguments if (mysql_stmt_bind_param(m_stmt, m_pInputArgs)) { sLog.outError("SQL ERROR: mysql_stmt_bind_param() failed\n"); @@ -431,7 +431,7 @@ void MySqlPreparedStatement::addParam(int nIndex, const SqlStmtFieldData& data) my_bool bUnsigned = 0; enum_field_types dataType = ToMySQLType(data, bUnsigned); - //setup MYSQL_BIND structure + // setup MYSQL_BIND structure pData.buffer_type = dataType; pData.is_unsigned = bUnsigned; pData.buffer = data.buff(); @@ -482,7 +482,7 @@ enum_field_types MySqlPreparedStatement::ToMySQLType(const SqlStmtFieldData& dat { case FIELD_NONE: dataType = MYSQL_TYPE_NULL; break; // MySQL does not support MYSQL_TYPE_BIT as input type - case FIELD_BOOL: //dataType = MYSQL_TYPE_BIT; bUnsigned = 1; break; + case FIELD_BOOL: // dataType = MYSQL_TYPE_BIT; bUnsigned = 1; break; case FIELD_UI8: dataType = MYSQL_TYPE_TINY; bUnsigned = 1; break; case FIELD_I8: dataType = MYSQL_TYPE_TINY; break; case FIELD_I16: dataType = MYSQL_TYPE_SHORT; break; diff --git a/src/shared/Database/DatabaseMysql.h b/src/shared/Database/DatabaseMysql.h index 6bc40acdf..10150fec6 100644 --- a/src/shared/Database/DatabaseMysql.h +++ b/src/shared/Database/DatabaseMysql.h @@ -34,24 +34,24 @@ #include #endif -//MySQL prepared statement class +// MySQL prepared statement class class MANGOS_DLL_SPEC MySqlPreparedStatement : public SqlPreparedStatement { public: MySqlPreparedStatement(const std::string& fmt, SqlConnection& conn, MYSQL* mysql); ~MySqlPreparedStatement(); - //prepare statement + // prepare statement virtual bool prepare(); - //bind input parameters + // bind input parameters virtual void bind(const SqlStmtParameters& holder); - //execute DML statement + // execute DML statement virtual bool execute(); protected: - //bind parameters + // bind parameters void addParam(int nIndex, const SqlStmtFieldData& data); static enum_field_types ToMySQLType(const SqlStmtFieldData& data, my_bool& bUnsigned); diff --git a/src/shared/Database/Field.h b/src/shared/Database/Field.h index 36dcf8d22..26417053b 100644 --- a/src/shared/Database/Field.h +++ b/src/shared/Database/Field.h @@ -64,8 +64,8 @@ class Field } void SetType(enum DataTypes type) { mType = type; } - //no need for memory allocations to store resultset field strings - //all we need is to cache pointers returned by different DBMS APIs + // no need for memory allocations to store resultset field strings + // all we need is to cache pointers returned by different DBMS APIs void SetValue(const char* value) { mValue = value; }; private: diff --git a/src/shared/Database/SQLStorage.h b/src/shared/Database/SQLStorage.h index 3f8fdb4d4..2bc57bb1d 100644 --- a/src/shared/Database/SQLStorage.h +++ b/src/shared/Database/SQLStorage.h @@ -86,7 +86,7 @@ class SQLStorage const char* dst_format; const char* table; const char* entry_field; - //bool HasString; + // bool HasString; }; template diff --git a/src/shared/Database/SqlDelayThread.cpp b/src/shared/Database/SqlDelayThread.cpp index f76d5b7c7..4fcaa7bd8 100644 --- a/src/shared/Database/SqlDelayThread.cpp +++ b/src/shared/Database/SqlDelayThread.cpp @@ -26,7 +26,7 @@ SqlDelayThread::SqlDelayThread(Database* db, SqlConnection* conn) : m_dbEngine(d SqlDelayThread::~SqlDelayThread() { - //process all requests which might have been queued while thread was stopping + // process all requests which might have been queued while thread was stopping ProcessRequests(); } diff --git a/src/shared/Database/SqlDelayThread.h b/src/shared/Database/SqlDelayThread.h index b0b33b8cb..90dd87507 100644 --- a/src/shared/Database/SqlDelayThread.h +++ b/src/shared/Database/SqlDelayThread.h @@ -38,7 +38,7 @@ class SqlDelayThread : public ACE_Based::Runnable SqlConnection* m_dbConnection; ///< Pointer to DB connection volatile bool m_running; - //process all enqueued requests + // process all enqueued requests void ProcessRequests(); public: diff --git a/src/shared/Database/SqlPreparedStatement.cpp b/src/shared/Database/SqlPreparedStatement.cpp index ebd32251c..51de8c60e 100644 --- a/src/shared/Database/SqlPreparedStatement.cpp +++ b/src/shared/Database/SqlPreparedStatement.cpp @@ -20,7 +20,7 @@ SqlStmtParameters::SqlStmtParameters(int nParams) { - //reserve memory if needed + // reserve memory if needed if (nParams > 0) m_params.reserve(nParams); } @@ -28,7 +28,7 @@ SqlStmtParameters::SqlStmtParameters(int nParams) void SqlStmtParameters::reset(const SqlStatement& stmt) { m_params.clear(); - //reserve memory if needed + // reserve memory if needed if (stmt.arguments() > 0) m_params.reserve(stmt.arguments()); } @@ -57,7 +57,7 @@ SqlStatement& SqlStatement::operator=(const SqlStatement& index) bool SqlStatement::Execute() { SqlStmtParameters* args = detach(); - //verify amount of bound parameters + // verify amount of bound parameters if (args->boundParams() != arguments()) { sLog.outError("SQL ERROR: wrong amount of parameters (%i instead of %i)", args->boundParams(), arguments()); @@ -72,7 +72,7 @@ bool SqlStatement::Execute() bool SqlStatement::DirectExecute() { SqlStmtParameters* args = detach(); - //verify amount of bound parameters + // verify amount of bound parameters if (args->boundParams() != arguments()) { sLog.outError("SQL ERROR: wrong amount of parameters (%i instead of %i)", args->boundParams(), arguments()); @@ -94,14 +94,14 @@ SqlPlainPreparedStatement::SqlPlainPreparedStatement(const std::string& fmt, Sql void SqlPlainPreparedStatement::bind(const SqlStmtParameters& holder) { - //verify if we bound all needed input parameters + // verify if we bound all needed input parameters if (m_nParams != holder.boundParams()) { MANGOS_ASSERT(false); return; } - //reset resulting plain SQL request + // reset resulting plain SQL request m_szPlainRequest = m_szFmt; size_t nLastPos = 0; @@ -110,7 +110,7 @@ void SqlPlainPreparedStatement::bind(const SqlStmtParameters& holder) SqlStmtParameters::ParameterContainer::const_iterator iter_last = _args.end(); for (SqlStmtParameters::ParameterContainer::const_iterator iter = _args.begin(); iter != iter_last; ++iter) { - //bind parameter + // bind parameter const SqlStmtFieldData& data = (*iter); std::ostringstream fmt; diff --git a/src/shared/Database/SqlPreparedStatement.h b/src/shared/Database/SqlPreparedStatement.h index 7beb8d799..9e6fbe7af 100644 --- a/src/shared/Database/SqlPreparedStatement.h +++ b/src/shared/Database/SqlPreparedStatement.h @@ -60,8 +60,8 @@ enum SqlStmtFieldType FIELD_NONE }; -//templates might be the best choice here -//but I didn't have time to play with them +// templates might be the best choice here +// but I didn't have time to play with them class MANGOS_DLL_SPEC SqlStmtFieldData { public: @@ -74,7 +74,7 @@ class MANGOS_DLL_SPEC SqlStmtFieldData template void set(T1 param1); - //getters + // getters bool toBool() const { MANGOS_ASSERT(m_type == FIELD_BOOL); return static_cast(m_binaryData.ui8); } uint8 toUint8() const { MANGOS_ASSERT(m_type == FIELD_UI8); return m_binaryData.ui8; } int8 toInt8() const { MANGOS_ASSERT(m_type == FIELD_I8); return m_binaryData.i8; } @@ -88,18 +88,18 @@ class MANGOS_DLL_SPEC SqlStmtFieldData double toDouble() const { MANGOS_ASSERT(m_type == FIELD_DOUBLE); return m_binaryData.d; } const char* toStr() const { MANGOS_ASSERT(m_type == FIELD_STRING); return m_szStringData.c_str(); } - //get type of data + // get type of data SqlStmtFieldType type() const { return m_type; } - //get underlying buffer type + // get underlying buffer type void* buff() const { return m_type == FIELD_STRING ? (void*)m_szStringData.c_str() : (void*)&m_binaryData; } - //get size of data + // get size of data size_t size() const { switch (m_type) { case FIELD_NONE: return 0; - case FIELD_BOOL: //return sizeof(bool); + case FIELD_BOOL: // return sizeof(bool); case FIELD_UI8: return sizeof(uint8); case FIELD_UI16: return sizeof(uint16); case FIELD_UI32: return sizeof(uint32); @@ -123,7 +123,7 @@ class MANGOS_DLL_SPEC SqlStmtFieldData std::string m_szStringData; }; -//template specialization +// template specialization template<> inline void SqlStmtFieldData::set(bool val) { m_type = FIELD_BOOL; m_binaryData.ui8 = val; } template<> inline void SqlStmtFieldData::set(uint8 val) { m_type = FIELD_UI8; m_binaryData.ui8 = val; } template<> inline void SqlStmtFieldData::set(int8 val) { m_type = FIELD_I8; m_binaryData.i8 = val; } @@ -138,37 +138,37 @@ template<> inline void SqlStmtFieldData::set(double val) { m_type = FIELD_DOUBLE template<> inline void SqlStmtFieldData::set(const char* val) { m_type = FIELD_STRING; m_szStringData = val; } class SqlStatement; -//prepared statement executor +// prepared statement executor class MANGOS_DLL_SPEC SqlStmtParameters { public: typedef std::vector ParameterContainer; - //reserve memory to contain all input parameters of stmt + // reserve memory to contain all input parameters of stmt explicit SqlStmtParameters(int nParams); ~SqlStmtParameters() {} - //get amount of bound parameters + // get amount of bound parameters int boundParams() const { return int(m_params.size()); } - //add parameter + // add parameter void addParam(const SqlStmtFieldData& data) { m_params.push_back(data); } - //empty SQL statement parameters. In case nParams > 1 - reserve memory for parameters - //should help to reuse the same object with batched SQL requests + // empty SQL statement parameters. In case nParams > 1 - reserve memory for parameters + // should help to reuse the same object with batched SQL requests void reset(const SqlStatement& stmt); - //swaps contents of intenral param container + // swaps contents of intenral param container void swap(SqlStmtParameters& obj); - //get bound parameters + // get bound parameters const ParameterContainer& params() const { return m_params; } private: SqlStmtParameters& operator=(const SqlStmtParameters& obj); - //statement parameter holder + // statement parameter holder ParameterContainer m_params; }; -//statement ID encapsulation logic +// statement ID encapsulation logic class SqlStatementID { public: @@ -187,7 +187,7 @@ class SqlStatementID bool m_bInitialized; }; -//statement index +// statement index class MANGOS_DLL_SPEC SqlStatement { public: @@ -207,7 +207,7 @@ class MANGOS_DLL_SPEC SqlStatement bool Execute(); bool DirectExecute(); - //templates to simplify 1-4 parameter bindings + // templates to simplify 1-4 parameter bindings template bool PExecute(ParamType1 param1) { @@ -242,7 +242,7 @@ class MANGOS_DLL_SPEC SqlStatement return Execute(); } - //bind parameters with specified type + // bind parameters with specified type void addBool(bool var) { arg(var); } void addUInt8(uint8 var) { arg(var); } void addInt8(int8 var) { arg(var); } @@ -259,7 +259,7 @@ class MANGOS_DLL_SPEC SqlStatement void addString(std::ostringstream& ss) { arg(ss.str().c_str()); ss.str(std::string()); } protected: - //don't allow anyone except Database class to create static SqlStatement objects + // don't allow anyone except Database class to create static SqlStatement objects friend class Database; SqlStatement(const SqlStatementID& index, Database& db) : m_index(index), m_pDB(&db), m_pParams(NULL) {} @@ -280,8 +280,8 @@ class MANGOS_DLL_SPEC SqlStatement return p; } - //helper function - //use appropriate add* functions to bind specific data type + // helper function + // use appropriate add* functions to bind specific data type template void arg(ParamType val) { @@ -294,7 +294,7 @@ class MANGOS_DLL_SPEC SqlStatement SqlStmtParameters* m_pParams; }; -//base prepared statement class +// base prepared statement class class MANGOS_DLL_SPEC SqlPreparedStatement { public: @@ -306,13 +306,13 @@ class MANGOS_DLL_SPEC SqlPreparedStatement uint32 params() const { return m_nParams; } uint32 columns() const { return isQuery() ? m_nColumns : 0; } - //initialize internal structures of prepared statement - //upon success m_bPrepared should be true + // initialize internal structures of prepared statement + // upon success m_bPrepared should be true virtual bool prepare() = 0; - //bind parameters for prepared statement from parameter placeholder + // bind parameters for prepared statement from parameter placeholder virtual void bind(const SqlStmtParameters& holder) = 0; - //execute statement w/o result set + // execute statement w/o result set virtual bool execute() = 0; protected: @@ -326,17 +326,17 @@ class MANGOS_DLL_SPEC SqlPreparedStatement SqlConnection& m_pConn; }; -//prepared statements via plain SQL string requests +// prepared statements via plain SQL string requests class MANGOS_DLL_SPEC SqlPlainPreparedStatement : public SqlPreparedStatement { public: SqlPlainPreparedStatement(const std::string& fmt, SqlConnection& conn); ~SqlPlainPreparedStatement() {} - //this statement is always prepared + // this statement is always prepared virtual bool prepare() { return true; } - //we should replace all '?' symbols with substrings with proper format + // we should replace all '?' symbols with substrings with proper format virtual void bind(const SqlStmtParameters& holder); virtual bool execute(); diff --git a/src/shared/ServiceWin32.cpp b/src/shared/ServiceWin32.cpp index 543177350..401f03a8b 100644 --- a/src/shared/ServiceWin32.cpp +++ b/src/shared/ServiceWin32.cpp @@ -68,19 +68,19 @@ bool WinServiceInstall() std::strcat(path, " -s run"); SC_HANDLE service = CreateService(serviceControlManager, - serviceName, // name of service - serviceLongName, // service name to display - SERVICE_ALL_ACCESS, // desired access + serviceName, // name of service + serviceLongName, // service name to display + SERVICE_ALL_ACCESS, // desired access // service type SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS, - SERVICE_AUTO_START, // start type - SERVICE_ERROR_IGNORE, // error control type - path, // service's binary - 0, // no load ordering group - 0, // no tag identifier - 0, // no dependencies - 0, // LocalSystem account - 0); // no password + SERVICE_AUTO_START, // start type + SERVICE_ERROR_IGNORE, // error control type + path, // service's binary + 0, // no load ordering group + 0, // no tag identifier + 0, // no dependencies + 0, // LocalSystem account + 0); // no password if (!service) { diff --git a/src/shared/Threading.cpp b/src/shared/Threading.cpp index 91a7eb93d..45cd1e456 100644 --- a/src/shared/Threading.cpp +++ b/src/shared/Threading.cpp @@ -59,10 +59,10 @@ ThreadPriority::ThreadPriority() } } - //since we have only 7(seven) values in enum Priority - //and 3 we know already (Idle, Normal, Realtime) so - //we need to split each list [Idle...Normal] and [Normal...Realtime] - //into ¹ piesces + // since we have only 7(seven) values in enum Priority + // and 3 we know already (Idle, Normal, Realtime) so + // we need to split each list [Idle...Normal] and [Normal...Realtime] + // into ¹ piesces const size_t _divider = 4; size_t _div = (norm_pos - min_pos) / _divider; if (_div == 0) @@ -118,14 +118,14 @@ Thread::Thread(Runnable* instance) : m_iThreadId(0), m_hThreadHandle(0), m_task( Thread::~Thread() { - //Wait(); + // Wait(); // deleted runnable object (if no other references) if (m_task) m_task->decReference(); } -//initialize Thread's class static member +// initialize Thread's class static member Thread::ThreadStorage Thread::m_ThreadStorage; ThreadPriority Thread::m_TpEnum; @@ -227,7 +227,7 @@ void Thread::setPriority(Priority type) #ifndef __sun__ int _priority = m_TpEnum.getPriority(type); int _ok = ACE_Thread::setprio(m_hThreadHandle, _priority); - //remove this ASSERT in case you don't want to know is thread priority change was successful or not + // remove this ASSERT in case you don't want to know is thread priority change was successful or not MANGOS_ASSERT(_ok == 0); #endif } diff --git a/src/shared/Threading.h b/src/shared/Threading.h index 84de289a3..682660fb4 100644 --- a/src/shared/Threading.h +++ b/src/shared/Threading.h @@ -97,9 +97,9 @@ namespace ACE_Based Runnable* m_task; typedef ACE_TSS ThreadStorage; - //global object - container for Thread class representation of every thread + // global object - container for Thread class representation of every thread static ThreadStorage m_ThreadStorage; - //use this object to determine current OS thread priority values mapped to enum Priority{} + // use this object to determine current OS thread priority values mapped to enum Priority{} static ThreadPriority m_TpEnum; }; } diff --git a/src/shared/Timer.h b/src/shared/Timer.h index 4709acd08..7106f86fd 100644 --- a/src/shared/Timer.h +++ b/src/shared/Timer.h @@ -26,10 +26,10 @@ class WorldTimer { public: - //get current server time + // get current server time static uint32 getMSTime(); - //get time difference between two timestamps + // get time difference between two timestamps static inline uint32 getMSTimeDiff(const uint32& oldMSTime, const uint32& newMSTime) { if (oldMSTime > newMSTime) @@ -43,18 +43,18 @@ class WorldTimer return newMSTime - oldMSTime; } - //get last world tick time + // get last world tick time static MANGOS_DLL_SPEC uint32 tickTime(); - //get previous world tick time + // get previous world tick time static MANGOS_DLL_SPEC uint32 tickPrevTime(); - //tick world timer + // tick world timer static MANGOS_DLL_SPEC uint32 tick(); private: WorldTimer(); WorldTimer(const WorldTimer&); - //analogue to getMSTime() but it persists m_SystemTickTime + // analogue to getMSTime() but it persists m_SystemTickTime static uint32 getMSTime_internal(bool savetime = false); static MANGOS_DLL_SPEC uint32 m_iTime; diff --git a/src/shared/Util.cpp b/src/shared/Util.cpp index f78274985..571bbc4bd 100644 --- a/src/shared/Util.cpp +++ b/src/shared/Util.cpp @@ -37,13 +37,13 @@ uint32 WorldTimer::tickPrevTime() { return m_iPrevTime; } uint32 WorldTimer::tick() { - //save previous world tick time + // save previous world tick time m_iPrevTime = m_iTime; - //get the new one and don't forget to persist current system time in m_SystemTickTime + // get the new one and don't forget to persist current system time in m_SystemTickTime m_iTime = WorldTimer::getMSTime_internal(true); - //return tick diff + // return tick diff return getMSTimeDiff(m_iPrevTime, m_iTime); } @@ -54,15 +54,15 @@ uint32 WorldTimer::getMSTime() uint32 WorldTimer::getMSTime_internal(bool savetime /*= false*/) { - //get current time + // get current time const ACE_Time_Value currTime = ACE_OS::gettimeofday(); - //calculate time diff between two world ticks - //special case: curr_time < old_time - we suppose that our time has not ticked at all - //this should be constant value otherwise it is possible that our time can start ticking backwards until next world tick!!! + // calculate time diff between two world ticks + // special case: curr_time < old_time - we suppose that our time has not ticked at all + // this should be constant value otherwise it is possible that our time can start ticking backwards until next world tick!!! uint64 diff = 0; (currTime - g_SystemTickTime).msec(diff); - //lets calculate current world time + // lets calculate current world time uint32 iRes = uint32(diff % UI64LIT(0x00000000FFFFFFFF)); return iRes; } @@ -220,7 +220,7 @@ uint32 TimeStringToSecs(const std::string& timestring) case 'h': multiplier = HOUR; break; case 'm': multiplier = MINUTE; break; case 's': multiplier = 1; break; - default : return 0; //bad format + default : return 0; // bad format } buffer *= multiplier; secs += buffer; @@ -384,7 +384,7 @@ bool WStrToUtf8(std::wstring wstr, std::string& utf8str) utf8str2.resize(wstr.size() * 4); // allocate for most long case char* oend = utf8::utf16to8(wstr.c_str(), wstr.c_str() + wstr.size(), &utf8str2[0]); - utf8str2.resize(oend - (&utf8str2[0])); // remove unused tail + utf8str2.resize(oend - (&utf8str2[0])); // remove unused tail utf8str = utf8str2; } catch (std::exception) diff --git a/src/shared/WheatyExceptionReport.cpp b/src/shared/WheatyExceptionReport.cpp index cf6f1529f..0fb7cc4bb 100644 --- a/src/shared/WheatyExceptionReport.cpp +++ b/src/shared/WheatyExceptionReport.cpp @@ -249,7 +249,7 @@ BOOL WheatyExceptionReport::_GetWindowsVersion(TCHAR* szVersion, DWORD cntMax) else _tcsncat(szVersion, _T("Server "), cntMax); } - else // Windows NT 4.0 + else // Windows NT 4.0 { #if WINVER < 0x0500 if (osvi.wReserved[0] & VER_SUITE_ENTERPRISE) @@ -276,7 +276,7 @@ BOOL WheatyExceptionReport::_GetWindowsVersion(TCHAR* szVersion, DWORD cntMax) osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.dwBuildNumber & 0xFFFF); _tcsncat(szVersion, wszTmp, cntMax); } - else // Windows NT 4.0 prior to SP6a + else // Windows NT 4.0 prior to SP6a { _stprintf(wszTmp, _T("%s (Version %d.%d, Build %d)"), osvi.szCSDVersion, osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.dwBuildNumber & 0xFFFF); @@ -284,7 +284,7 @@ BOOL WheatyExceptionReport::_GetWindowsVersion(TCHAR* szVersion, DWORD cntMax) } ::RegCloseKey(hKey); } - else // Windows NT 3.51 and earlier or Windows 2000 and later + else // Windows NT 3.51 and earlier or Windows 2000 and later { if (!_tcslen(osvi.szCSDVersion)) _stprintf(wszTmp, _T("(Version %d.%d, Build %d)"), @@ -464,7 +464,7 @@ void WheatyExceptionReport::GenerateExceptionReport( WriteStackDetails(&trashableContext, false, NULL); printTracesForAllThreads(); -// #ifdef _M_IX86 // X86 Only! +// #ifdef _M_IX86 // X86 Only! _tprintf(_T("========================\r\n")); _tprintf(_T("Local Variables And Parameters\r\n")); @@ -478,7 +478,7 @@ void WheatyExceptionReport::GenerateExceptionReport( SymEnumSymbols(GetCurrentProcess(), (DWORD64)GetModuleHandle(szFaultingModule), 0, EnumerateSymbolsCallback, 0); - // #endif // X86 Only! + // #endif // X86 Only! SymCleanup(GetCurrentProcess()); @@ -559,7 +559,7 @@ BOOL WheatyExceptionReport::GetLogicalAddress( PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION(pNtHdr); - DWORD_PTR rva = (DWORD_PTR)addr - hMod; // RVA is offset from module load address + DWORD_PTR rva = (DWORD_PTR)addr - hMod; // RVA is offset from module load address // Iterate through the section table, looking for the one that encompasses // the linear address. @@ -602,7 +602,7 @@ struct CSymbolInfoPackage : public SYMBOL_INFO_PACKAGE //============================================================ void WheatyExceptionReport::WriteStackDetails( PCONTEXT pContext, - bool bWriteVariables, HANDLE pThreadHandle) // true if local/params should be output + bool bWriteVariables, HANDLE pThreadHandle) // true if local/params should be output { _tprintf(_T("\r\nCall stack:\r\n")); @@ -665,10 +665,10 @@ void WheatyExceptionReport::WriteStackDetails( // Get the name of the function for this stack frame entry CSymbolInfoPackage sip; if (SymFromAddr( - m_hProcess, // Process handle of the current process - sf.AddrPC.Offset, // Symbol address - &symDisplacement, // Address of the variable that will receive the displacement - &sip.si // Address of the SYMBOL_INFO structure (inside "sip" object) + m_hProcess, // Process handle of the current process + sf.AddrPC.Offset, // Symbol address + &symDisplacement, // Address of the variable that will receive the displacement + &sip.si // Address of the SYMBOL_INFO structure (inside "sip" object) )) { _tprintf(_T("%hs+%I64X"), sip.si.Name, symDisplacement); diff --git a/src/shared/WheatyExceptionReport.h b/src/shared/WheatyExceptionReport.h index 8a67eb761..930fcf93c 100644 --- a/src/shared/WheatyExceptionReport.h +++ b/src/shared/WheatyExceptionReport.h @@ -114,4 +114,4 @@ class WheatyExceptionReport }; extern WheatyExceptionReport g_WheatyExceptionReport; // global instance of class -#endif //WheatyExceptionReport +#endif // WheatyExceptionReport diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 3d9ba8270..9e9d1a853 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12068" + #define REVISION_NR "12069" #endif // __REVISION_NR_H__