From 86d846e62767df637631ff20764a65dcdfbcd72d Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 13 May 2013 18:10:20 +0200 Subject: Core: Fixed windows compile --- src/server/shared/Logging/Log.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/server/shared') diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h index d7612c76738..e35e4f3ab7f 100644 --- a/src/server/shared/Logging/Log.h +++ b/src/server/shared/Logging/Log.h @@ -96,14 +96,14 @@ inline bool Log::ShouldLog(LogFilterType type, LogLevel level) const #define sLog ACE_Singleton::instance() -#if PLATFORM != PLATFORM_WINDOWS -# define TC_LOG_MESSAGE_BODY(level__, call__, filterType__, ...) \ +#if COMPILER != COMPILER_MICROSOFT +#define TC_LOG_MESSAGE_BODY(level__, call__, filterType__, ...) \ do { \ if (sLog->ShouldLog(filterType__, level__)) \ sLog->call__(filterType__, __VA_ARGS__); \ } while (0) #else -# define TC_LOG_MESSAGE_BODY(level__, call__, filterType__, ...) \ +#define TC_LOG_MESSAGE_BODY(level__, call__, filterType__, ...) \ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ do { \ -- cgit v1.2.3 From 8e1601e202708ccd483456f5bfa06957470e2d3c Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 13 May 2013 18:12:01 +0200 Subject: Core/Debugging: Marked assert functions as non returning --- src/server/shared/Debugging/Errors.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/server/shared') diff --git a/src/server/shared/Debugging/Errors.h b/src/server/shared/Debugging/Errors.h index 554b20c3648..fa526a4d094 100644 --- a/src/server/shared/Debugging/Errors.h +++ b/src/server/shared/Debugging/Errors.h @@ -19,15 +19,18 @@ #ifndef TRINITYCORE_ERRORS_H #define TRINITYCORE_ERRORS_H -namespace Trinity { +#include "Define.h" -void Assert(char const *file, int line, char const *function, char const *message); +namespace Trinity +{ -void Fatal(char const *file, int line, char const *function, char const *message); + DECLSPEC_NORETURN void Assert(char const *file, int line, char const *function, char const *message) ATTR_NORETURN; -void Error(char const *file, int line, char const *function, char const *message); + DECLSPEC_NORETURN void Fatal(char const *file, int line, char const *function, char const *message) ATTR_NORETURN; -void Warning(char const *file, int line, char const *function, char const *message); + DECLSPEC_NORETURN void Error(char const *file, int line, char const *function, char const *message) ATTR_NORETURN; + + void Warning(char const *file, int line, char const *function, char const *message); } // namespace Trinity -- cgit v1.2.3 From 60dae46462205ff41a284faf6ac9cfd33d12b941 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 16 May 2013 01:10:53 +0100 Subject: Core: Fix compiler warnings --- src/server/game/DataStores/DBCStores.cpp | 2 +- src/server/scripts/Commands/cs_deserter.cpp | 6 +++--- src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp | 2 ++ src/server/scripts/Northrend/zone_icecrown.cpp | 2 +- src/server/shared/Debugging/Errors.cpp | 4 ++++ 5 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src/server/shared') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 25419632a29..ebe3792420b 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -902,7 +902,7 @@ LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty) if (!dungeon) continue; - if (dungeon->map == mapId && Difficulty(dungeon->difficulty) == difficulty) + if (dungeon->map == (int)mapId && Difficulty(dungeon->difficulty) == difficulty) return dungeon; } diff --git a/src/server/scripts/Commands/cs_deserter.cpp b/src/server/scripts/Commands/cs_deserter.cpp index 3850456fcb3..ef2cd7b45b9 100644 --- a/src/server/scripts/Commands/cs_deserter.cpp +++ b/src/server/scripts/Commands/cs_deserter.cpp @@ -45,20 +45,20 @@ public: ChatCommand* GetCommands() const { - static ChatCommand deserterInstanceCommandTable[] = + static ChatCommand deserterInstanceCommandTable[] = { { "add", SEC_ADMINISTRATOR, false, &HandleDeserterInstanceAdd, "", NULL }, { "remove", SEC_ADMINISTRATOR, false, &HandleDeserterInstanceRemove, "", NULL }, { NULL, SEC_PLAYER, false, NULL, "", NULL } }; - static ChatCommand deserterBGCommandTable[] = + static ChatCommand deserterBGCommandTable[] = { { "add", SEC_ADMINISTRATOR, false, &HandleDeserterBGAdd, "", NULL }, { "remove", SEC_ADMINISTRATOR, false, &HandleDeserterBGRemove, "", NULL }, { NULL, SEC_PLAYER, false, NULL, "", NULL } }; - static ChatCommand deserterCommandTable[] = + static ChatCommand deserterCommandTable[] = { { "instance", SEC_ADMINISTRATOR, false, NULL, "", deserterInstanceCommandTable }, { "bg", SEC_ADMINISTRATOR, false, NULL, "", deserterBGCommandTable }, diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp index 0d39fbf5505..64a315eb465 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp @@ -3078,10 +3078,12 @@ class spell_yogg_saron_in_the_maws_of_the_old_god : public SpellScriptLoader if (InstanceScript* instance = GetCaster()->GetInstanceScript()) if (Creature* yogg = ObjectAccessor::GetCreature(*GetCaster(), instance->GetData64(BOSS_YOGG_SARON))) if (yogg->FindCurrentSpellBySpellId(SPELL_DEAFENING_ROAR)) + { if (GetCaster()->GetDistance(yogg) > 20.0f) return SPELL_FAILED_OUT_OF_RANGE; else return SPELL_CAST_OK; + } return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; } diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index 70b500166c9..0447d70b502 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -921,7 +921,7 @@ class npc_frostbrood_skytalon : public CreatureScript if (id == POINT_GRAB_DECOY) if (TempSummon* summon = me->ToTempSummon()) if (Unit* summoner = summon->GetSummoner()) - DoCast(summoner, SPELL_GRAB); + DoCast(summoner, SPELL_GRAB); } void UpdateAI(uint32 diff) diff --git a/src/server/shared/Debugging/Errors.cpp b/src/server/shared/Debugging/Errors.cpp index 10ede3ae402..877d7554c43 100644 --- a/src/server/shared/Debugging/Errors.cpp +++ b/src/server/shared/Debugging/Errors.cpp @@ -20,6 +20,7 @@ #include #include +#include namespace Trinity { @@ -29,6 +30,7 @@ void Assert(char const *file, int line, char const *function, char const *messag fprintf(stderr, "\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n", file, line, function, message, st.c_str()); *((volatile int*)NULL) = 0; + exit(1); } void Fatal(char const *file, int line, char const *function, char const *message) @@ -37,6 +39,7 @@ void Fatal(char const *file, int line, char const *function, char const *message file, line, function, message); ACE_OS::sleep(10); *((volatile int*)NULL) = 0; + exit(1); } void Error(char const *file, int line, char const *function, char const *message) @@ -44,6 +47,7 @@ void Error(char const *file, int line, char const *function, char const *message fprintf(stderr, "\n%s:%i in %s ERROR:\n %s\n", file, line, function, message); *((volatile int*)NULL) = 0; + exit(1); } void Warning(char const *file, int line, char const *function, char const *message) -- cgit v1.2.3 From 8be181c7e60daf9833044da61b379c2136892c37 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 17 May 2013 20:39:53 +0200 Subject: Core/Misc: Fixed a bunch of issues found by static analysis --- src/server/game/DataStores/DBCStores.cpp | 2 +- src/server/game/Handlers/AuctionHouseHandler.cpp | 225 ++++++++++----------- .../scripts/Northrend/Nexus/Oculus/oculus.cpp | 170 ++++++++-------- src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp | 2 + src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp | 3 +- src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp | 11 + src/server/shared/Cryptography/SHA1.cpp | 1 + src/server/shared/Database/Field.cpp | 1 + src/server/shared/Database/MySQLConnection.cpp | 2 + src/server/shared/Database/PreparedStatement.cpp | 1 + src/server/shared/Threading/Callback.h | 2 +- src/server/worldserver/TCSoap/TCSoap.h | 2 +- 12 files changed, 221 insertions(+), 201 deletions(-) (limited to 'src/server/shared') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index ebe3792420b..a00698bc527 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -902,7 +902,7 @@ LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty) if (!dungeon) continue; - if (dungeon->map == (int)mapId && Difficulty(dungeon->difficulty) == difficulty) + if (dungeon->map == int32(mapId) && Difficulty(dungeon->difficulty) == difficulty) return dungeon; } diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index cd914951ae8..6f44b867c4b 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -230,140 +230,137 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData) } } - for (uint32 i = 0; i < itemsCount; ++i) + Item* item = items[0]; + + uint32 auctionTime = uint32(etime * sWorld->getRate(RATE_AUCTION_TIME)); + AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + + uint32 deposit = sAuctionMgr->GetAuctionDeposit(auctionHouseEntry, etime, item, finalCount); + if (!_player->HasEnoughMoney(deposit)) { - Item* item = items[i]; + SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_NOT_ENOUGHT_MONEY); + return; + } - uint32 auctionTime = uint32(etime * sWorld->getRate(RATE_AUCTION_TIME)); - AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->getFaction()); + AuctionEntry* AH = new AuctionEntry(); + + if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) + AH->auctioneer = 23442; ///@TODO - HARDCODED DB GUID, BAD BAD BAD + else + AH->auctioneer = GUID_LOPART(auctioneer); - uint32 deposit = sAuctionMgr->GetAuctionDeposit(auctionHouseEntry, etime, item, finalCount); - if (!_player->HasEnoughMoney(deposit)) + // Required stack size of auction matches to current item stack size, just move item to auctionhouse + if (itemsCount == 1 && item->GetCount() == count[0]) + { + if (HasPermission(RBAC_PERM_LOG_GM_TRADE)) { - SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_NOT_ENOUGHT_MONEY); - return; + sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", + GetPlayerName().c_str(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount()); } - _player->ModifyMoney(-int32(deposit)); - - AuctionEntry* AH = new AuctionEntry; AH->Id = sObjectMgr->GenerateAuctionID(); - - if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION)) - AH->auctioneer = 23442; - else - AH->auctioneer = GUID_LOPART(auctioneer); - - // Required stack size of auction matches to current item stack size, just move item to auctionhouse - if (itemsCount == 1 && item->GetCount() == count[i]) + AH->itemGUIDLow = item->GetGUIDLow(); + AH->itemEntry = item->GetEntry(); + AH->itemCount = item->GetCount(); + AH->owner = _player->GetGUIDLow(); + AH->startbid = bid; + AH->bidder = 0; + AH->bid = 0; + AH->buyout = buyout; + AH->expire_time = time(NULL) + auctionTime; + AH->deposit = deposit; + AH->auctionHouseEntry = auctionHouseEntry; + + TC_LOG_INFO(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUIDLow(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); + sAuctionMgr->AddAItem(item); + auctionHouse->AddAuction(AH); + + _player->MoveItemFromInventory(item->GetBagSlot(), item->GetSlot(), true); + + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + item->DeleteFromInventoryDB(trans); + item->SaveToDB(trans); + AH->SaveToDB(trans); + _player->SaveInventoryAndGoldToDB(trans); + CharacterDatabase.CommitTransaction(trans); + + SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, ERR_AUCTION_OK); + + GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1); + } + else // Required stack size of auction does not match to current item stack size, clone item and set correct stack size + { + Item* newItem = item->CloneItem(finalCount, _player); + if (!newItem) { - if (HasPermission(RBAC_PERM_LOG_GM_TRADE)) - { - sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", - GetPlayerName().c_str(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount()); - } - - AH->itemGUIDLow = item->GetGUIDLow(); - AH->itemEntry = item->GetEntry(); - AH->itemCount = item->GetCount(); - AH->owner = _player->GetGUIDLow(); - AH->startbid = bid; - AH->bidder = 0; - AH->bid = 0; - AH->buyout = buyout; - AH->expire_time = time(NULL) + auctionTime; - AH->deposit = deposit; - AH->auctionHouseEntry = auctionHouseEntry; - - TC_LOG_INFO(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUIDLow(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); - sAuctionMgr->AddAItem(item); - auctionHouse->AddAuction(AH); - - _player->MoveItemFromInventory(item->GetBagSlot(), item->GetSlot(), true); - - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - item->DeleteFromInventoryDB(trans); - item->SaveToDB(trans); - AH->SaveToDB(trans); - _player->SaveInventoryAndGoldToDB(trans); - CharacterDatabase.CommitTransaction(trans); - - SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, ERR_AUCTION_OK); - - GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1); + TC_LOG_ERROR(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Could not create clone of item %u", item->GetEntry()); + SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR); + delete AH; return; } - else // Required stack size of auction does not match to current item stack size, clone item and set correct stack size + + if (HasPermission(RBAC_PERM_LOG_GM_TRADE)) { - Item* newItem = item->CloneItem(finalCount, _player); - if (!newItem) - { - TC_LOG_ERROR(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Could not create clone of item %u", item->GetEntry()); - SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR); - return; - } + sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", + GetPlayerName().c_str(), GetAccountId(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetCount()); + } - if (HasPermission(RBAC_PERM_LOG_GM_TRADE)) + AH->Id = sObjectMgr->GenerateAuctionID(); + AH->itemGUIDLow = newItem->GetGUIDLow(); + AH->itemEntry = newItem->GetEntry(); + AH->itemCount = newItem->GetCount(); + AH->owner = _player->GetGUIDLow(); + AH->startbid = bid; + AH->bidder = 0; + AH->bid = 0; + AH->buyout = buyout; + AH->expire_time = time(NULL) + auctionTime; + AH->deposit = deposit; + AH->auctionHouseEntry = auctionHouseEntry; + + TC_LOG_INFO(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUIDLow(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); + sAuctionMgr->AddAItem(newItem); + auctionHouse->AddAuction(AH); + + for (uint32 j = 0; j < itemsCount; ++j) + { + Item* item2 = items[j]; + + // Item stack count equals required count, ready to delete item - cloned item will be used for auction + if (item2->GetCount() == count[j]) { - sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", - GetPlayerName().c_str(), GetAccountId(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetCount()); - } + _player->MoveItemFromInventory(item2->GetBagSlot(), item2->GetSlot(), true); - AH->itemGUIDLow = newItem->GetGUIDLow(); - AH->itemEntry = newItem->GetEntry(); - AH->itemCount = newItem->GetCount(); - AH->owner = _player->GetGUIDLow(); - AH->startbid = bid; - AH->bidder = 0; - AH->bid = 0; - AH->buyout = buyout; - AH->expire_time = time(NULL) + auctionTime; - AH->deposit = deposit; - AH->auctionHouseEntry = auctionHouseEntry; - - TC_LOG_INFO(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUIDLow(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); - sAuctionMgr->AddAItem(newItem); - auctionHouse->AddAuction(AH); - - for (uint32 j = 0; j < itemsCount; ++j) + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + item2->DeleteFromInventoryDB(trans); + item2->DeleteFromDB(trans); + CharacterDatabase.CommitTransaction(trans); + } + else // Item stack count is bigger than required count, update item stack count and save to database - cloned item will be used for auction { - Item* item2 = items[j]; - - // Item stack count equals required count, ready to delete item - cloned item will be used for auction - if (item2->GetCount() == count[j]) - { - _player->MoveItemFromInventory(item2->GetBagSlot(), item2->GetSlot(), true); - - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - item2->DeleteFromInventoryDB(trans); - item2->DeleteFromDB(trans); - CharacterDatabase.CommitTransaction(trans); - } - else // Item stack count is bigger than required count, update item stack count and save to database - cloned item will be used for auction - { - item2->SetCount(item2->GetCount() - count[j]); - item2->SetState(ITEM_CHANGED, _player); - _player->ItemRemovedQuestCheck(item2->GetEntry(), count[j]); - item2->SendUpdateToPlayer(_player); - - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - item2->SaveToDB(trans); - CharacterDatabase.CommitTransaction(trans); - } + item2->SetCount(item2->GetCount() - count[j]); + item2->SetState(ITEM_CHANGED, _player); + _player->ItemRemovedQuestCheck(item2->GetEntry(), count[j]); + item2->SendUpdateToPlayer(_player); + + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + item2->SaveToDB(trans); + CharacterDatabase.CommitTransaction(trans); } + } - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - newItem->SaveToDB(trans); - AH->SaveToDB(trans); - _player->SaveInventoryAndGoldToDB(trans); - CharacterDatabase.CommitTransaction(trans); + SQLTransaction trans = CharacterDatabase.BeginTransaction(); + newItem->SaveToDB(trans); + AH->SaveToDB(trans); + _player->SaveInventoryAndGoldToDB(trans); + CharacterDatabase.CommitTransaction(trans); - SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, ERR_AUCTION_OK); + SendAuctionCommandResult(AH->Id, AUCTION_SELL_ITEM, ERR_AUCTION_OK); - GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1); - return; - } + GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, 1); } + + _player->ModifyMoney(-int32(deposit)); } //this function is called when client bids or buys out auction diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index 1f8ba3edade..71ef0cbe3ce 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -110,103 +110,107 @@ class npc_verdisa_beglaristrasz_eternos : public CreatureScript public: npc_verdisa_beglaristrasz_eternos() : CreatureScript("npc_verdisa_beglaristrasz_eternos") { } - InstanceScript* instance; - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) { player->PlayerTalkClass->ClearMenus(); switch (creature->GetEntry()) { - case NPC_VERDISA: //Verdisa - switch (action) + case NPC_VERDISA: //Verdisa { - case GOSSIP_ACTION_INFO_DEF + 1: - if (!HAS_ESSENCE(player)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA1, creature->GetGUID()); - } - else + switch (action) { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA2, creature->GetGUID()); + case GOSSIP_ACTION_INFO_DEF + 1: + if (!HAS_ESSENCE(player)) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA1, creature->GetGUID()); + } + else + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERDISA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA2, creature->GetGUID()); + } + break; + case GOSSIP_ACTION_INFO_DEF + 2: + { + ItemPosCountVec dest; + uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_EMERALD_ESSENCE, 1); + if (msg == EQUIP_ERR_OK) + player->StoreNewItem(dest, ITEM_EMERALD_ESSENCE, true); + player->CLOSE_GOSSIP_MENU(); + break; + } + case GOSSIP_ACTION_INFO_DEF + 3: + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA3, creature->GetGUID()); + break; } break; - case GOSSIP_ACTION_INFO_DEF + 2: - { - ItemPosCountVec dest; - uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_EMERALD_ESSENCE, 1); - if (msg == EQUIP_ERR_OK) - player->StoreNewItem(dest, ITEM_EMERALD_ESSENCE, true); - player->CLOSE_GOSSIP_MENU(); - break; } - case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VERDISA3, creature->GetGUID()); - break; - } - break; - case NPC_BELGARISTRASZ: //Belgaristrasz - switch (action) + case NPC_BELGARISTRASZ: //Belgaristrasz { - case GOSSIP_ACTION_INFO_DEF + 1: - if (!HAS_ESSENCE(player)) + switch (action) { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ1, creature->GetGUID()); - } - else - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ2, creature->GetGUID()); + case GOSSIP_ACTION_INFO_DEF + 1: + if (!HAS_ESSENCE(player)) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ1, creature->GetGUID()); + } + else + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BELGARISTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ2, creature->GetGUID()); + } + break; + case GOSSIP_ACTION_INFO_DEF + 2: + { + ItemPosCountVec dest; + uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_RUBY_ESSENCE, 1); + if (msg == EQUIP_ERR_OK) + player->StoreNewItem(dest, ITEM_RUBY_ESSENCE, true); + player->CLOSE_GOSSIP_MENU(); + break; + } + case GOSSIP_ACTION_INFO_DEF + 3: + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ3, creature->GetGUID()); + break; } break; - case GOSSIP_ACTION_INFO_DEF + 2: - { - ItemPosCountVec dest; - uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_RUBY_ESSENCE, 1); - if (msg == EQUIP_ERR_OK) - player->StoreNewItem(dest, ITEM_RUBY_ESSENCE, true); - player->CLOSE_GOSSIP_MENU(); - break; - } - case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_BELGARISTRASZ3, creature->GetGUID()); - break; } - break; - case NPC_ETERNOS: //Eternos - switch (action) + case NPC_ETERNOS: //Eternos { - case GOSSIP_ACTION_INFO_DEF + 1: - if (!HAS_ESSENCE(player)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS1, creature->GetGUID()); - } - else + switch (action) { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS2, creature->GetGUID()); + case GOSSIP_ACTION_INFO_DEF + 1: + if (!HAS_ESSENCE(player)) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS1, creature->GetGUID()); + } + else + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ETERNOS2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS2, creature->GetGUID()); + } + break; + case GOSSIP_ACTION_INFO_DEF + 2: + { + ItemPosCountVec dest; + uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_AMBER_ESSENCE, 1); + if (msg == EQUIP_ERR_OK) + player->StoreNewItem(dest, ITEM_AMBER_ESSENCE, true); + player->CLOSE_GOSSIP_MENU(); + break; + } + case GOSSIP_ACTION_INFO_DEF + 3: + player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS3, creature->GetGUID()); + break; } break; - case GOSSIP_ACTION_INFO_DEF + 2: - { - ItemPosCountVec dest; - uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_AMBER_ESSENCE, 1); - if (msg == EQUIP_ERR_OK) - player->StoreNewItem(dest, ITEM_AMBER_ESSENCE, true); - player->CLOSE_GOSSIP_MENU(); - break; - } - case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ETERNOS3, creature->GetGUID()); - break; } - break; } return true; @@ -235,15 +239,15 @@ public: void MovementInform(uint32 /*type*/, uint32 id) { + if (id) + return; + // When Belgaristraz finish his moving say grateful text if (me->GetEntry() == NPC_BELGARISTRASZ) - if (id == 0) - { - Talk(SAY_BELGARISTRASZ); - } + Talk(SAY_BELGARISTRASZ); + // The gossip flag should activate when Drakos die and not from DB - if (id == 0) - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); } }; diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp index 55bb61b8c42..0ffab435a9c 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp @@ -62,6 +62,8 @@ OPvPCapturePointHP::OPvPCapturePointHP(OutdoorPvP* pvp, OutdoorPvPHPTowerType ty OutdoorPvPHP::OutdoorPvPHP() { m_TypeId = OUTDOOR_PVP_HP; + m_AllianceTowersControlled = 0; + m_HordeTowersControlled = 0; } bool OutdoorPvPHP::SetupOutdoorPvP() diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp index bd6fd96451f..fe3489b4a7e 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp @@ -27,6 +27,7 @@ OutdoorPvPNA::OutdoorPvPNA() { m_TypeId = OUTDOOR_PVP_NA; + m_obj = NULL; } void OutdoorPvPNA::HandleKillImpl(Player* player, Unit* killed) @@ -216,8 +217,8 @@ bool OutdoorPvPNA::SetupOutdoorPvP() m_obj = new OPvPCapturePointNA(this); if (!m_obj) return false; - AddCapturePoint(m_obj); + AddCapturePoint(m_obj); return true; } diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp index bd8b6cfd982..98b0ee5c5f4 100644 --- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp +++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp @@ -28,6 +28,17 @@ OutdoorPvPTF::OutdoorPvPTF() { m_TypeId = OUTDOOR_PVP_TF; + + m_IsLocked = false; + m_LockTimer = TF_LOCK_TIME; + m_LockTimerUpdate = 0; + + m_AllianceTowersControlled = 0; + m_HordeTowersControlled = 0; + + hours_left = 6; + second_digit = 0; + first_digit = 0; } OPvPCapturePointTF::OPvPCapturePointTF(OutdoorPvP* pvp, OutdoorPvPTF_TowerType type) diff --git a/src/server/shared/Cryptography/SHA1.cpp b/src/server/shared/Cryptography/SHA1.cpp index d02e9711014..00d7e520d51 100644 --- a/src/server/shared/Cryptography/SHA1.cpp +++ b/src/server/shared/Cryptography/SHA1.cpp @@ -23,6 +23,7 @@ SHA1Hash::SHA1Hash() { SHA1_Init(&mC); + memset(mDigest, 0, SHA_DIGEST_LENGTH * sizeof(uint8)); } SHA1Hash::~SHA1Hash() diff --git a/src/server/shared/Database/Field.cpp b/src/server/shared/Database/Field.cpp index 9bd37641813..51d918e716e 100644 --- a/src/server/shared/Database/Field.cpp +++ b/src/server/shared/Database/Field.cpp @@ -22,6 +22,7 @@ Field::Field() data.value = NULL; data.type = MYSQL_TYPE_NULL; data.length = 0; + data.raw = false; } Field::~Field() diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp index 846c8ce72fe..19d0a7af4c8 100644 --- a/src/server/shared/Database/MySQLConnection.cpp +++ b/src/server/shared/Database/MySQLConnection.cpp @@ -84,8 +84,10 @@ bool MySQLConnection::Open() int port; char const* unix_socket; + unsigned int timeout = 10; mysql_options(mysqlInit, MYSQL_SET_CHARSET_NAME, "utf8"); + mysql_options(mysqlInit, MYSQL_OPT_READ_TIMEOUT, (char const*)&timeout); #ifdef _WIN32 if (m_connectionInfo.host == ".") // named pipe use option (Windows) { diff --git a/src/server/shared/Database/PreparedStatement.cpp b/src/server/shared/Database/PreparedStatement.cpp index 06f9ff51132..24097ca41c5 100644 --- a/src/server/shared/Database/PreparedStatement.cpp +++ b/src/server/shared/Database/PreparedStatement.cpp @@ -203,6 +203,7 @@ void PreparedStatement::setNull(const uint8 index) } MySQLPreparedStatement::MySQLPreparedStatement(MYSQL_STMT* stmt) : +m_stmt(NULL), m_Mstmt(stmt), m_bind(NULL) { diff --git a/src/server/shared/Threading/Callback.h b/src/server/shared/Threading/Callback.h index f6bc1581857..e0215f5b3d3 100644 --- a/src/server/shared/Threading/Callback.h +++ b/src/server/shared/Threading/Callback.h @@ -35,7 +35,7 @@ template class QueryCallback { public: - QueryCallback() : _stage(chain ? 0 : CALLBACK_STAGE_INVALID) {} + QueryCallback() : _param(), _stage(chain ? 0 : CALLBACK_STAGE_INVALID) {} //! The parameter of this function should be a resultset returned from either .AsyncQuery or .AsyncPQuery void SetFutureResult(ACE_Future value) diff --git a/src/server/worldserver/TCSoap/TCSoap.h b/src/server/worldserver/TCSoap/TCSoap.h index b786ee94e81..63ccb6b304e 100644 --- a/src/server/worldserver/TCSoap/TCSoap.h +++ b/src/server/worldserver/TCSoap/TCSoap.h @@ -27,7 +27,7 @@ class TCSoapRunnable: public ACE_Based::Runnable { public: - TCSoapRunnable() { } + TCSoapRunnable() : m_host(""), m_port(0) { } void run(); void setListenArguments(std::string host, uint16 port) { -- cgit v1.2.3 From d6709ed610a815997f918c68298ecf3ab0af0d59 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 18 May 2013 11:49:46 +0200 Subject: Reverted part of 8be181c7e60daf9833044da61b379c2136892c37 that was not supposed to be pushed --- src/server/shared/Database/MySQLConnection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/shared') diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp index 19d0a7af4c8..4307cab98f2 100644 --- a/src/server/shared/Database/MySQLConnection.cpp +++ b/src/server/shared/Database/MySQLConnection.cpp @@ -84,10 +84,10 @@ bool MySQLConnection::Open() int port; char const* unix_socket; - unsigned int timeout = 10; + //unsigned int timeout = 10; mysql_options(mysqlInit, MYSQL_SET_CHARSET_NAME, "utf8"); - mysql_options(mysqlInit, MYSQL_OPT_READ_TIMEOUT, (char const*)&timeout); + //mysql_options(mysqlInit, MYSQL_OPT_READ_TIMEOUT, (char const*)&timeout); #ifdef _WIN32 if (m_connectionInfo.host == ".") // named pipe use option (Windows) { -- cgit v1.2.3 From 00c11688974fc00342a62387b6e2d682884e0721 Mon Sep 17 00:00:00 2001 From: Spp Date: Tue, 21 May 2013 08:37:28 +0200 Subject: Core/Misc: Remove trailing whitespace, compile warnings and minor cosmetic changes --- src/server/collision/Management/MMapFactory.cpp | 2 +- src/server/collision/Management/MMapManager.cpp | 8 ++-- .../game/Battlegrounds/Zones/BattlegroundAV.h | 2 +- src/server/game/Entities/Vehicle/Vehicle.cpp | 8 ++-- src/server/game/Handlers/ChatHandler.cpp | 2 +- .../TargetedMovementGenerator.cpp | 22 ++++----- src/server/game/Movement/PathGenerator.cpp | 2 +- src/server/game/Movement/Spline/MoveSplineInit.cpp | 2 +- src/server/game/Movement/Spline/Spline.h | 10 ++-- src/server/game/Movement/Waypoints/Path.h | 4 +- src/server/scripts/Commands/cs_character.cpp | 4 +- src/server/scripts/Commands/cs_list.cpp | 4 +- src/server/scripts/Commands/cs_mmaps.cpp | 12 ++--- .../EasternKingdoms/ZulGurub/boss_arlokk.cpp | 2 +- .../EasternKingdoms/ZulGurub/boss_mandokir.cpp | 2 +- src/server/scripts/Kalimdor/zone_winterspring.cpp | 10 ++-- .../TrialOfTheCrusader/trial_of_the_crusader.cpp | 4 +- .../Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp | 54 +++++++++++----------- .../scripts/Northrend/Ulduar/Ulduar/ulduar.h | 4 +- .../UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp | 4 +- src/server/scripts/Spells/spell_generic.cpp | 2 +- src/server/shared/Debugging/Errors.cpp | 8 ++-- src/server/shared/Debugging/Errors.h | 16 +++---- src/server/shared/Packets/ByteBuffer.h | 2 +- 24 files changed, 95 insertions(+), 95 deletions(-) (limited to 'src/server/shared') diff --git a/src/server/collision/Management/MMapFactory.cpp b/src/server/collision/Management/MMapFactory.cpp index 7adf7fbfa66..6aa71d77ed8 100644 --- a/src/server/collision/Management/MMapFactory.cpp +++ b/src/server/collision/Management/MMapFactory.cpp @@ -25,7 +25,7 @@ namespace MMAP { // ######################## MMapFactory ######################## // our global singleton copy - MMapManager *g_MMapManager = NULL; + MMapManager* g_MMapManager = NULL; MMapManager* MMapFactory::createOrGetMMapManager() { diff --git a/src/server/collision/Management/MMapManager.cpp b/src/server/collision/Management/MMapManager.cpp index ac0a935dd39..a3f89f42443 100644 --- a/src/server/collision/Management/MMapManager.cpp +++ b/src/server/collision/Management/MMapManager.cpp @@ -109,7 +109,7 @@ namespace MMAP snprintf(fileName, pathLen, (sWorld->GetDataPath()+"mmaps/%03i%02i%02i.mmtile").c_str(), mapId, x, y); - FILE *file = fopen(fileName, "rb"); + FILE* file = fopen(fileName, "rb"); if (!file) { TC_LOG_DEBUG(LOG_FILTER_MAPS, "MMAP:loadMap: Could not open mmtile file '%s'", fileName); @@ -156,7 +156,7 @@ namespace MMAP { mmap->mmapLoadedTiles.insert(std::pair(packedGridPos, tileRef)); ++loadedTiles; - TC_LOG_INFO(LOG_FILTER_MAPS, "MMAP:loadMap: Loaded mmtile %03i[%02i,%02i] into %03i[%02i,%02i]", mapId, x, y, mapId, header->x, header->y); + TC_LOG_INFO(LOG_FILTER_MAPS, "MMAP:loadMap: Loaded mmtile %03i[%02i, %02i] into %03i[%02i, %02i]", mapId, x, y, mapId, header->x, header->y); return true; } else @@ -205,7 +205,7 @@ namespace MMAP { mmap->mmapLoadedTiles.erase(packedGridPos); --loadedTiles; - TC_LOG_INFO(LOG_FILTER_MAPS, "MMAP:unloadMap: Unloaded mmtile %03i[%02i,%02i] from %03i", mapId, x, y, mapId); + TC_LOG_INFO(LOG_FILTER_MAPS, "MMAP:unloadMap: Unloaded mmtile %03i[%02i, %02i] from %03i", mapId, x, y, mapId); return true; } @@ -232,7 +232,7 @@ namespace MMAP else { --loadedTiles; - TC_LOG_INFO(LOG_FILTER_MAPS, "MMAP:unloadMap: Unloaded mmtile %03i[%02i,%02i] from %03i", mapId, x, y, mapId); + TC_LOG_INFO(LOG_FILTER_MAPS, "MMAP:unloadMap: Unloaded mmtile %03i[%02i, %02i] from %03i", mapId, x, y, mapId); } } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h index 7a0af0b06d7..bbe3b064c35 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h @@ -1046,7 +1046,7 @@ const uint32 BG_AV_CreatureInfo[AV_NPC_INFO_MAX][4] = { 13326, 1216, 59, 59 }, //Seasoned Defender { 13331, 1216, 60, 60 }, //Veteran Defender { 13422, 1216, 61, 61 }, //Champion Defender - { 13358, 1216, 59, 60 }, //Stormpike Bowman /// @todo: Confirm if this is correct. Author assumpted 60,61 & 69,70, but wouldn't work here + { 13358, 1216, 59, 60 }, //Stormpike Bowman /// @todo: Confirm if this is correct. Author assumpted 60, 61 & 69, 70, but wouldn't work here { 11949, 469, 0, 0}, //not spawned with this data, but used for handlekillunit { 11948, 469, 0, 0}, //not spawned with this data, but used for handlekillunit { 12053, 1214, 58, 58 }, //Frostwolf Guardian diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index fd5183753e1..d3c2a16c592 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -418,7 +418,7 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 typ * @author Machiavelli * @date 17-2-2013 * - * @param [in,out] The prospective passenger. + * @param [in, out] The prospective passenger. * @param seatId Identifier for the seat. Value of -1 indicates the next available seat. * * @return true if it succeeds, false if it fails. @@ -493,7 +493,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) * @author Machiavelli * @date 17-2-2013 * - * @param [in,out] unit The passenger to remove. + * @param [in, out] unit The passenger to remove. */ void Vehicle::RemovePassenger(Unit* unit) @@ -616,7 +616,7 @@ void Vehicle::InitMovementInfoForBase() * @author Machiavelli * @date 17-2-2013 * - * @param [in,out] The passenger for which we check the seat info. + * @param [in, out] The passenger for which we check the seat info. * * @return null if passenger not found on vehicle, else the DBC record for the seat. */ @@ -638,7 +638,7 @@ VehicleSeatEntry const* Vehicle::GetSeatForPassenger(Unit const* passenger) cons * @author Machiavelli * @date 17-2-2013 * - * @param [in,out] passenger Passenger to look up. + * @param [in, out] passenger Passenger to look up. * * @return The seat iterator for specified passenger if it's found on the vehicle. Otherwise Seats.end() (invalid iterator). */ diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 68f00a28cf1..9d4eae0f1b0 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -289,7 +289,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) // If player is a Gamemaster and doesn't accept whisper, we auto-whitelist every player that the Gamemaster is talking to // We also do that if a player is under the required level for whispers. - if (receiver->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) || + if (receiver->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) || (HasPermission(RBAC_PERM_CAN_FILTER_WHISPERS) && !sender->isAcceptWhispers() && !sender->IsInWhisperWhiteList(receiver->GetGUID()))) sender->AddWhisperWhiteList(receiver->GetGUID()); diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index abb4ac9964b..8086e60c912 100644 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -27,7 +27,7 @@ #include "Player.h" template -void TargetedMovementGeneratorMedium::_setTargetLocation(T* owner, bool updateDestination) +void TargetedMovementGeneratorMedium::_setTargetLocation(T* owner, bool updateDestination) { if (!i_target.isValid() || !i_target->IsInWorld()) return; @@ -117,7 +117,7 @@ void TargetedMovementGeneratorMedium::_setTargetLocation(T* owner, bool upd } template -bool TargetedMovementGeneratorMedium::DoUpdate(T* owner, uint32 time_diff) +bool TargetedMovementGeneratorMedium::DoUpdate(T* owner, uint32 time_diff) { if (!i_target.isValid() || !i_target->IsInWorld()) return false; @@ -185,7 +185,7 @@ template void ChaseMovementGenerator::_reachTarget(T* owner) { if (owner->IsWithinMeleeRange(this->i_target.getTarget())) - owner->Attack(this->i_target.getTarget(),true); + owner->Attack(this->i_target.getTarget(), true); } template<> @@ -303,14 +303,14 @@ void FollowMovementGenerator::MovementInform(Creature* unit) } //-----------------------------------------------// -template void TargetedMovementGeneratorMedium >::_setTargetLocation(Player*, bool); -template void TargetedMovementGeneratorMedium >::_setTargetLocation(Player*, bool); -template void TargetedMovementGeneratorMedium >::_setTargetLocation(Creature*, bool); -template void TargetedMovementGeneratorMedium >::_setTargetLocation(Creature*, bool); -template bool TargetedMovementGeneratorMedium >::DoUpdate(Player*, uint32); -template bool TargetedMovementGeneratorMedium >::DoUpdate(Player*, uint32); -template bool TargetedMovementGeneratorMedium >::DoUpdate(Creature*, uint32); -template bool TargetedMovementGeneratorMedium >::DoUpdate(Creature*, uint32); +template void TargetedMovementGeneratorMedium >::_setTargetLocation(Player*, bool); +template void TargetedMovementGeneratorMedium >::_setTargetLocation(Player*, bool); +template void TargetedMovementGeneratorMedium >::_setTargetLocation(Creature*, bool); +template void TargetedMovementGeneratorMedium >::_setTargetLocation(Creature*, bool); +template bool TargetedMovementGeneratorMedium >::DoUpdate(Player*, uint32); +template bool TargetedMovementGeneratorMedium >::DoUpdate(Player*, uint32); +template bool TargetedMovementGeneratorMedium >::DoUpdate(Creature*, uint32); +template bool TargetedMovementGeneratorMedium >::DoUpdate(Creature*, uint32); template void ChaseMovementGenerator::_reachTarget(Player*); template void ChaseMovementGenerator::_reachTarget(Creature*); diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index 80e8f1e1f44..3fd7e7ee393 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -701,7 +701,7 @@ dtStatus PathGenerator::FindSmoothPath(float const* startPos, float const* endPo // Find movement delta. float delta[VERTEX_SIZE]; dtVsub(delta, steerPos, iterPos); - float len = dtSqrt(dtVdot(delta,delta)); + float len = dtSqrt(dtVdot(delta, delta)); // If the steer target is end of path or off-mesh link, do not move past the location. if ((endOfPath || offMeshConnection) && len < SMOOTH_PATH_STEP_SIZE) len = 1.0f; diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index 4b1af78a799..49a33a4f79e 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -118,7 +118,7 @@ namespace Movement } PacketBuilder::WriteMonsterMove(move_spline, data); - unit->SendMessageToSet(&data,true); + unit->SendMessageToSet(&data, true); return move_spline.Duration(); } diff --git a/src/server/game/Movement/Spline/Spline.h b/src/server/game/Movement/Spline/Spline.h index 2a2f3fa8f43..42090cae71b 100644 --- a/src/server/game/Movement/Spline/Spline.h +++ b/src/server/game/Movement/Spline/Spline.h @@ -91,13 +91,13 @@ public: @param t - percent of segment length, assumes that t in range [0, 1] @param Idx - spline segment index, should be in range [first, last) */ - void evaluate_percent(index_type Idx, float u, Vector3& c) const {(this->*evaluators[m_mode])(Idx, u,c);} + void evaluate_percent(index_type Idx, float u, Vector3& c) const {(this->*evaluators[m_mode])(Idx, u, c);} /** Caclulates derivation in index Idx, and percent of segment length t @param Idx - spline segment index, should be in range [first, last) @param t - percent of spline segment length, assumes that t in range [0, 1] */ - void evaluate_derivative(index_type Idx, float u, Vector3& hermite) const {(this->*derivative_evaluators[m_mode])(Idx, u,hermite);} + void evaluate_derivative(index_type Idx, float u, Vector3& hermite) const {(this->*derivative_evaluators[m_mode])(Idx, u, hermite);} /** Bounds for spline indexes. All indexes should be in range [first, last). */ index_type first() const { return index_lo;} @@ -156,12 +156,12 @@ public: /** Calculates the position for given segment Idx, and percent of segment length t @param t = partial_segment_length / whole_segment_length @param Idx - spline segment index, should be in range [first, last). */ - void evaluate_percent(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_percent(Idx, u,c);} + void evaluate_percent(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_percent(Idx, u, c);} /** Caclulates derivation for index Idx, and percent of segment length t @param Idx - spline segment index, should be in range [first, last) @param t - percent of spline segment length, assumes that t in range [0, 1]. */ - void evaluate_derivative(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_derivative(Idx, u,c);} + void evaluate_derivative(index_type Idx, float u, Vector3& c) const { SplineBase::evaluate_derivative(Idx, u, c);} // Assumes that t in range [0, 1] index_type computeIndexInBounds(float t) const; @@ -169,7 +169,7 @@ public: /** Initializes spline. Don't call other methods while spline not initialized. */ void init_spline(const Vector3 * controls, index_type count, EvaluationMode m) { SplineBase::init_spline(controls, count, m);} - void init_cyclic_spline(const Vector3 * controls, index_type count, EvaluationMode m, index_type cyclic_point) { SplineBase::init_cyclic_spline(controls, count, m,cyclic_point);} + void init_cyclic_spline(const Vector3 * controls, index_type count, EvaluationMode m, index_type cyclic_point) { SplineBase::init_cyclic_spline(controls, count, m, cyclic_point);} /** Initializes lengths with SplineBase::SegLength method. */ void initLengths(); diff --git a/src/server/game/Movement/Waypoints/Path.h b/src/server/game/Movement/Waypoints/Path.h index 39f05184cf6..9814d1c65e1 100644 --- a/src/server/game/Movement/Waypoints/Path.h +++ b/src/server/game/Movement/Waypoints/Path.h @@ -40,13 +40,13 @@ class Path void erase(uint32 idx) { i_nodes.erase(i_nodes.begin()+idx); } void crop(unsigned int start, unsigned int end) { - while(start && !i_nodes.empty()) + while (start && !i_nodes.empty()) { i_nodes.pop_front(); --start; } - while(end && !i_nodes.empty()) + while (end && !i_nodes.empty()) { i_nodes.pop_back(); --end; diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index fdcf88177a9..e51052bc18f 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -320,7 +320,7 @@ public: // check online security if (handler->HasLowerSecurity(target, 0)) return false; - + playerOldName = target->GetName(); } else @@ -345,7 +345,7 @@ public: handler->SetSentErrorMessage(true); return false; } - + if (WorldSession* session = handler->GetSession()) { if (!session->HasPermission(RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RESERVEDNAME) && sObjectMgr->IsReservedName(newName)) diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index 81608ebd458..6b8ce7732c5 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -518,7 +518,7 @@ public: uint32 copp = (money % GOLD) % SILVER; std::string receiverStr = handler->playerLink(receiver); std::string senderStr = handler->playerLink(sender); - handler->PSendSysMessage(LANG_LIST_MAIL_INFO_1 , messageId, subject.c_str(),gold, silv, copp); + handler->PSendSysMessage(LANG_LIST_MAIL_INFO_1, messageId, subject.c_str(), gold, silv, copp); handler->PSendSysMessage(LANG_LIST_MAIL_INFO_2, senderStr.c_str(), senderId, receiverStr.c_str(), receiverId); handler->PSendSysMessage(LANG_LIST_MAIL_INFO_3, TimeToTimestampStr(deliverTime).c_str(), TimeToTimestampStr(expireTime).c_str()); if (hasItem == 1) @@ -541,7 +541,7 @@ public: uint32 item_entry = fields[0].GetUInt32(); uint32 item_count = fields[1].GetUInt32(); QueryResult result4; - result4 = WorldDatabase.PQuery("SELECT name,quality FROM item_template WHERE entry = '%u'", item_entry); + result4 = WorldDatabase.PQuery("SELECT name, quality FROM item_template WHERE entry = '%u'", item_entry); Field* fields1 = result4->Fetch(); std::string item_name = fields1[0].GetString(); int item_quality = fields1[1].GetUInt8(); diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp index 55b6edbadbe..300b39fc389 100644 --- a/src/server/scripts/Commands/cs_mmaps.cpp +++ b/src/server/scripts/Commands/cs_mmaps.cpp @@ -128,7 +128,7 @@ public: int32 gy = 32 - player->GetPositionY() / SIZE_OF_GRIDS; handler->PSendSysMessage("%03u%02i%02i.mmtile", player->GetMapId(), gy, gx); - handler->PSendSysMessage("gridloc [%i,%i]", gx, gy); + handler->PSendSysMessage("gridloc [%i, %i]", gx, gy); // calculate navmesh tile location dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId()); @@ -148,7 +148,7 @@ public: int32 tilex = int32((y - min[0]) / SIZE_OF_GRIDS); int32 tiley = int32((x - min[2]) / SIZE_OF_GRIDS); - handler->PSendSysMessage("Calc [%02i,%02i]", tilex, tiley); + handler->PSendSysMessage("Calc [%02i, %02i]", tilex, tiley); // navmesh poly -> navmesh tile location dtQueryFilter filter = dtQueryFilter(); @@ -156,16 +156,16 @@ public: navmeshquery->findNearestPoly(location, extents, &filter, &polyRef, NULL); if (polyRef == INVALID_POLYREF) - handler->PSendSysMessage("Dt [??,??] (invalid poly, probably no tile loaded)"); + handler->PSendSysMessage("Dt [??, ??] (invalid poly, probably no tile loaded)"); else { dtMeshTile const* tile; dtPoly const* poly; navmesh->getTileAndPolyByRef(polyRef, &tile, &poly); if (tile) - handler->PSendSysMessage("Dt [%02i,%02i]", tile->header->x, tile->header->y); + handler->PSendSysMessage("Dt [%02i, %02i]", tile->header->x, tile->header->y); else - handler->PSendSysMessage("Dt [??,??] (no tile loaded)"); + handler->PSendSysMessage("Dt [??, ??] (no tile loaded)"); } return true; @@ -190,7 +190,7 @@ public: if (!tile || !tile->header) continue; - handler->PSendSysMessage("[%02i,%02i]", tile->header->x, tile->header->y); + handler->PSendSysMessage("[%02i, %02i]", tile->header->x, tile->header->y); } return true; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp index 97eeb385e15..6fe0934191e 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -222,7 +222,7 @@ class boss_arlokk : public CreatureScript break; case EVENT_MARK_OF_ARLOKK: { - Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, urand(1,3), 0.0f, false, -SPELL_MARK_OF_ARLOKK); + Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, urand(1, 3), 0.0f, false, -SPELL_MARK_OF_ARLOKK); if (!target) target = me->getVictim(); if (target) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index bd7b7a8798c..9a94ab02348 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -409,7 +409,7 @@ class spell_threatening_gaze : public SpellScriptLoader void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* caster = GetCaster()) - if(Unit* target = GetTarget()) + if (Unit* target = GetTarget()) if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH) caster->CastSpell(target, SPELL_WATCH_CHARGE); } diff --git a/src/server/scripts/Kalimdor/zone_winterspring.cpp b/src/server/scripts/Kalimdor/zone_winterspring.cpp index c523cfba952..6458047bb60 100644 --- a/src/server/scripts/Kalimdor/zone_winterspring.cpp +++ b/src/server/scripts/Kalimdor/zone_winterspring.cpp @@ -154,14 +154,14 @@ struct DialogueEntry class DialogueHelper { public: - // The array MUST be terminated by {0,0,0} + // The array MUST be terminated by {0, 0, 0} DialogueHelper(DialogueEntry const* dialogueArray) : _dialogueArray(dialogueArray), _currentEntry(NULL), _actionTimer(0), _isFirstSide(true) {} - // The array MUST be terminated by {0,0,0,0,0} + // The array MUST be terminated by {0, 0, 0, 0, 0} /// Function to initialize the dialogue helper for instances. If not used with instances, GetSpeakerByEntry MUST be overwritten to obtain the speakers /// Set if take first entries or second entries @@ -183,7 +183,7 @@ public: if (!found) return; - + DoNextDialogueStep(); } @@ -398,7 +398,7 @@ public: void WaypointReached(uint32 pointId) { - switch(pointId) + switch (pointId) { case 3: Talk(SAY_ENTER_OWL_THICKET); @@ -437,7 +437,7 @@ public: SetEscortPaused(true); DoSummonPriestess(); Talk(SAY_RANSHALLA_ALTAR_2); - events.ScheduleEvent(EVENT_RESUME,2000); + events.ScheduleEvent(EVENT_RESUME, 2000); break; case 44: // Stop the escort and turn towards the altar diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index bd8afded346..090ebbca69d 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -148,10 +148,10 @@ class npc_announcer_toc10 : public CreatureScript break; } } - + if (i >= NUM_MESSAGES) return false; - + player->SEND_GOSSIP_MENU(_GossipMessage[i].msgnum, creature->GetGUID()); return true; } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp index 4b2961d2616..105b4757066 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp @@ -95,7 +95,7 @@ enum Yells SAY_STORMWIND_ROLEPLAY_2 = 1, SAY_STORMWIND_ROLEPLAY_3 = 2, SAY_STORMWIND_ROLEPLAY_6 = 3, - + // King Llane SAY_STORMWIND_ROLEPLAY_5 = 0, }; @@ -440,7 +440,7 @@ class boss_voice_of_yogg_saron : public CreatureScript void EnterEvadeMode() { BossAI::EnterEvadeMode(); - + for (uint8 i = DATA_SARA; i <= DATA_MIMIRON_YS; ++i) if (Creature* creature = ObjectAccessor::GetCreature(*me, instance->GetData64(i))) creature->AI()->EnterEvadeMode(); @@ -448,7 +448,7 @@ class boss_voice_of_yogg_saron : public CreatureScript // not sure, spoken by Sara (sound), regarding to wowwiki Voice whispers it Map::PlayerList const& players = me->GetMap()->GetPlayers(); for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - if (Player *player = itr->getSource()) + if (Player* player = itr->getSource()) { if (events.IsInPhase(PHASE_ONE)) Talk(WHISPER_VOICE_PHASE_1_WIPE, player->GetGUID()); @@ -670,16 +670,16 @@ class boss_sara : public CreatureScript std::map::const_iterator itr = _linkData.find(guid); if (itr != _linkData.end()) return itr->second; - + return 0; } - + void SetLinkBetween(uint64 player1, uint64 player2) { _linkData[player1] = player2; _linkData[player2] = player1; } - + // called once for each target on aura remove void RemoveLinkFrom(uint64 player1) { @@ -932,7 +932,7 @@ class boss_yogg_saron : public CreatureScript Map::PlayerList const& players = me->GetMap()->GetPlayers(); for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - if (Player *player = itr->getSource()) + if (Player* player = itr->getSource()) { player->RemoveAurasDueToSpell(SPELL_SANITY); player->RemoveAurasDueToSpell(SPELL_INSANE); @@ -1069,7 +1069,7 @@ class boss_brain_of_yogg_saron : public CreatureScript uint8 illusion = _instance->GetData(DATA_ILLUSION); if (++_tentaclesKilled >= (illusion == ICECROWN_ILLUSION ? 9 : 8)) { - sCreatureTextMgr->SendChat(me, EMOTE_BRAIN_ILLUSION_SHATTERED, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_AREA); + sCreatureTextMgr->SendChat(me, EMOTE_BRAIN_ILLUSION_SHATTERED, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_AREA); _summons.DespawnAll(); DoCastAOE(SPELL_SHATTERED_ILLUSION, true); _instance->HandleGameObject(_instance->GetData64(GO_BRAIN_ROOM_DOOR_1 + illusion), true); @@ -1522,7 +1522,7 @@ class npc_observation_ring_keeper : public CreatureScript DoCast(SPELL_TELEPORT); Talk(SAY_KEEPER_CHOSEN_1, player->GetGUID()); Talk(SAY_KEEPER_CHOSEN_2, player->GetGUID()); - + switch (me->GetEntry()) { case NPC_FREYA_OBSERVATION_RING: @@ -2085,16 +2085,16 @@ class spell_yogg_saron_malady_of_the_mind : public SpellScriptLoader // 63830 return new spell_yogg_saron_malady_of_the_mind_AuraScript(); } }; - + class spell_yogg_saron_brain_link : public SpellScriptLoader // 63802 { public: spell_yogg_saron_brain_link() : SpellScriptLoader("spell_yogg_saron_brain_link") { } - + class spell_yogg_saron_brain_link_SpellScript : public SpellScript { PrepareSpellScript(spell_yogg_saron_brain_link_SpellScript); - + void FilterTargets(std::list& targets) { targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_ILLUSION_ROOM)); @@ -2104,17 +2104,17 @@ class spell_yogg_saron_brain_link : public SpellScriptLoader // 63802 targets.clear(); return; } - + if (SaraAI* ai = CAST_AI(SaraAI, GetCaster()->GetAI())) ai->SetLinkBetween(targets.front()->GetGUID(), targets.back()->GetGUID()); } - + void Register() { OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_yogg_saron_brain_link_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } }; - + class spell_yogg_saron_brain_link_AuraScript : public AuraScript { PrepareAuraScript(spell_yogg_saron_brain_link_AuraScript); @@ -2127,13 +2127,13 @@ class spell_yogg_saron_brain_link : public SpellScriptLoader // 63802 return false; return true; } - + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Unit* caster = GetCaster(); if (!caster) return; - + if (SaraAI* ai = CAST_AI(SaraAI, caster->GetAI())) { if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE) @@ -2148,36 +2148,36 @@ class spell_yogg_saron_brain_link : public SpellScriptLoader // 63802 } } } - + void DummyTick(AuraEffect const* aurEff) { Unit* caster = GetCaster(); if (!caster) return; - + SaraAI* ai = CAST_AI(SaraAI, caster->GetAI()); if (!ai) return; - + Player* linked = ObjectAccessor::GetPlayer(*GetTarget(), ai->GetLinkedPlayerGUID(GetTarget()->GetGUID())); if (!linked) return; - + GetTarget()->CastSpell(linked, (GetTarget()->GetDistance(linked) > (float)aurEff->GetAmount()) ? SPELL_BRAIN_LINK_DAMAGE : SPELL_BRAIN_LINK_NO_DAMAGE, true); } - + void Register() { OnEffectPeriodic += AuraEffectPeriodicFn(spell_yogg_saron_brain_link_AuraScript::DummyTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); OnEffectRemove += AuraEffectRemoveFn(spell_yogg_saron_brain_link_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); } }; - + SpellScript* GetSpellScript() const { return new spell_yogg_saron_brain_link_SpellScript(); } - + AuraScript* GetAuraScript() const { return new spell_yogg_saron_brain_link_AuraScript(); @@ -2212,7 +2212,7 @@ class spell_yogg_saron_boil_ominously : public SpellScriptLoader // 63030 { public: spell_yogg_saron_boil_ominously() : SpellScriptLoader("spell_yogg_saron_boil_ominously") { } - + class spell_yogg_saron_boil_ominously_SpellScript : public SpellScript { PrepareSpellScript(spell_yogg_saron_boil_ominously_SpellScript); @@ -2223,7 +2223,7 @@ class spell_yogg_saron_boil_ominously : public SpellScriptLoader // 63030 return false; return true; } - + void HandleDummy(SpellEffIndex /*effIndex*/) { if (Unit* target = GetHitUnit()) @@ -2235,7 +2235,7 @@ class spell_yogg_saron_boil_ominously : public SpellScriptLoader // 63030 GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_GUARDIAN_1, true); } } - + void Register() { OnEffectHitTarget += SpellEffectFn(spell_yogg_saron_boil_ominously_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h index 86c0c4888ed..612be3b71e8 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h @@ -21,7 +21,7 @@ #include "ObjectMgr.h" #define UlduarScriptName "instance_ulduar" -extern Position const ObservationRingKeepersPos[4]; +extern Position const ObservationRingKeepersPos[4]; extern Position const YSKeepersPos[4]; extern Position const AlgalonLandPos; @@ -149,7 +149,7 @@ enum UlduarNPCs NPC_SANITY_WELL = 33991, NPC_DESCEND_INTO_MADNESS = 34072, NPC_MARKED_IMMORTAL_GUARDIAN = 36064, - + // Algalon the Observer NPC_BRANN_BRONZBEARD_ALG = 34064, NPC_AZEROTH = 34246, diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp index 84829cdae12..8e726c10fca 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp @@ -115,10 +115,10 @@ public: /// There is a good reason to store them like this, we are going to shuffle the order. for (uint32 i = PHASE_FRENZIED_WORGEN; i < PHASE_GORTOK_PALEHOOF; ++i) Sequence[i] = Phase(i); - + /// This ensures a random order and only executes each phase once. std::random_shuffle(Sequence, Sequence + PHASE_GORTOK_PALEHOOF); - + uiArcingSmashTimer = 15000; uiImpaleTimer = 12000; uiWhiteringRoarTimer = 10000; diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 60f641d9054..c60f4f07821 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -3531,7 +3531,7 @@ class spell_gen_orc_disguise : public SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_TRIGGER) || !sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_MALE) || + if (!sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_TRIGGER) || !sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_MALE) || !sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_FEMALE)) return false; return true; diff --git a/src/server/shared/Debugging/Errors.cpp b/src/server/shared/Debugging/Errors.cpp index 877d7554c43..1bfe8c8e949 100644 --- a/src/server/shared/Debugging/Errors.cpp +++ b/src/server/shared/Debugging/Errors.cpp @@ -24,7 +24,7 @@ namespace Trinity { -void Assert(char const *file, int line, char const *function, char const *message) +void Assert(char const* file, int line, char const* function, char const* message) { ACE_Stack_Trace st; fprintf(stderr, "\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n", @@ -33,7 +33,7 @@ void Assert(char const *file, int line, char const *function, char const *messag exit(1); } -void Fatal(char const *file, int line, char const *function, char const *message) +void Fatal(char const* file, int line, char const* function, char const* message) { fprintf(stderr, "\n%s:%i in %s FATAL ERROR:\n %s\n", file, line, function, message); @@ -42,7 +42,7 @@ void Fatal(char const *file, int line, char const *function, char const *message exit(1); } -void Error(char const *file, int line, char const *function, char const *message) +void Error(char const* file, int line, char const* function, char const* message) { fprintf(stderr, "\n%s:%i in %s ERROR:\n %s\n", file, line, function, message); @@ -50,7 +50,7 @@ void Error(char const *file, int line, char const *function, char const *message exit(1); } -void Warning(char const *file, int line, char const *function, char const *message) +void Warning(char const* file, int line, char const* function, char const* message) { fprintf(stderr, "\n%s:%i in %s WARNING:\n %s\n", file, line, function, message); diff --git a/src/server/shared/Debugging/Errors.h b/src/server/shared/Debugging/Errors.h index fa526a4d094..2821ca504e7 100644 --- a/src/server/shared/Debugging/Errors.h +++ b/src/server/shared/Debugging/Errors.h @@ -24,20 +24,20 @@ namespace Trinity { - DECLSPEC_NORETURN void Assert(char const *file, int line, char const *function, char const *message) ATTR_NORETURN; + DECLSPEC_NORETURN void Assert(char const* file, int line, char const* function, char const* message) ATTR_NORETURN; - DECLSPEC_NORETURN void Fatal(char const *file, int line, char const *function, char const *message) ATTR_NORETURN; + DECLSPEC_NORETURN void Fatal(char const* file, int line, char const* function, char const* message) ATTR_NORETURN; - DECLSPEC_NORETURN void Error(char const *file, int line, char const *function, char const *message) ATTR_NORETURN; + DECLSPEC_NORETURN void Error(char const* file, int line, char const* function, char const* message) ATTR_NORETURN; - void Warning(char const *file, int line, char const *function, char const *message); + void Warning(char const* file, int line, char const* function, char const* message); } // namespace Trinity -#define WPAssert(cond) do { if (!(cond)) Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, #cond); } while(0) -#define WPFatal(cond, msg) do { if (!(cond)) Trinity::Fatal(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) -#define WPError(cond, msg) do { if (!(cond)) Trinity::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) -#define WPWarning(cond, msg) do { if (!(cond)) Trinity::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) +#define WPAssert(cond) do { if (!(cond)) Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, #cond); } while (0) +#define WPFatal(cond, msg) do { if (!(cond)) Trinity::Fatal(__FILE__, __LINE__, __FUNCTION__, (msg)); } while (0) +#define WPError(cond, msg) do { if (!(cond)) Trinity::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while (0) +#define WPWarning(cond, msg) do { if (!(cond)) Trinity::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while (0) #define ASSERT WPAssert diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 302a03dee47..7777842af17 100644 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -37,7 +37,7 @@ class ByteBufferException : public std::exception public: ~ByteBufferException() throw() { } - char const * what() const throw() { return msg_.c_str(); } + char const* what() const throw() { return msg_.c_str(); } protected: std::string & message() throw() { return msg_; } -- cgit v1.2.3