aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2018-01-22 23:55:33 -0300
committerariel- <ariel-@users.noreply.github.com>2018-01-22 23:55:33 -0300
commitc099174ff777d1bf5061f5cdc197ff17bd83fbb7 (patch)
treec48689319a23398682db06558e3633759d79614f /src
parent7c9722a4ae08b5f283f6a085a411e37604a7da9f (diff)
Core/Misc: fix some /W4 warnings and some reported by GCC 6.3
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp4
-rw-r--r--src/server/game/AuctionHouse/AuctionHouseMgr.cpp19
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp6
-rw-r--r--src/server/game/Chat/Channels/Channel.cpp6
-rw-r--r--src/server/game/Combat/ThreatManager.cpp2
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp2
-rw-r--r--src/server/game/Guilds/Guild.cpp4
-rw-r--r--src/server/game/Handlers/MiscHandler.cpp2
-rw-r--r--src/server/game/Handlers/PetitionsHandler.cpp44
-rw-r--r--src/server/game/Miscellaneous/SharedDefines.h4
-rw-r--r--src/server/game/Petitions/PetitionMgr.cpp42
-rw-r--r--src/server/game/Petitions/PetitionMgr.h12
-rw-r--r--src/server/game/Server/WorldSocket.cpp2
-rw-r--r--src/server/game/Spells/Spell.cpp8
-rw-r--r--src/server/game/Spells/SpellDefines.h6
-rw-r--r--src/server/game/Spells/SpellMgr.cpp2
-rw-r--r--src/server/game/Tools/PlayerDump.cpp12
-rw-r--r--src/server/scripts/Commands/cs_lookup.cpp104
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp23
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp4
-rw-r--r--src/server/scripts/Spells/spell_warlock.cpp7
21 files changed, 151 insertions, 164 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index d517b909816..6434b772a3f 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -794,8 +794,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
// Special handling for vehicles
if (Vehicle* vehicle = unit->GetVehicleKit())
for (SeatMap::iterator it = vehicle->Seats.begin(); it != vehicle->Seats.end(); ++it)
- if (Player* player = ObjectAccessor::GetPlayer(*unit, it->second.Passenger.Guid))
- player->GroupEventHappens(e.action.quest.quest, GetBaseObject());
+ if (Player* passenger = ObjectAccessor::GetPlayer(*unit, it->second.Passenger.Guid))
+ passenger->GroupEventHappens(e.action.quest.quest, GetBaseObject());
break;
}
case SMART_ACTION_COMBAT_STOP:
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
index cf92ba1e58e..6dead9624cd 100644
--- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
+++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
@@ -487,17 +487,17 @@ void AuctionHouseMgr::PendingAuctionProcess(Player* player)
}
uint32 totaldeposit = 0;
- auto itr = (*thisAH->begin());
- if (Item* item = GetAItem(itr->itemGUIDLow))
- totaldeposit = GetAuctionDeposit(itr->auctionHouseEntry, itr->etime, item, totalItems);
+ AuctionEntry const* entry = thisAH->front();
+ if (Item* item = GetAItem(entry->itemGUIDLow))
+ totaldeposit = GetAuctionDeposit(entry->auctionHouseEntry, entry->etime, item, totalItems);
uint32 depositremain = totaldeposit;
for (auto itr = thisAH->begin(); itr != thisAH->end(); ++itr)
{
AuctionEntry* AH = (*itr);
- if (next(itr) == thisAH->end())
+ if (std::next(itr) == thisAH->end())
AH->deposit = depositremain;
else
{
@@ -506,7 +506,6 @@ void AuctionHouseMgr::PendingAuctionProcess(Player* player)
}
AH->DeleteFromDB(trans);
-
AH->SaveToDB(trans);
}
@@ -710,14 +709,14 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
time_t curTime = GameTime::GetGameTime();
- PlayerGetAllThrottleMap::const_iterator itr = GetAllThrottleMap.find(player->GetGUID());
+ auto itr = GetAllThrottleMap.find(player->GetGUID());
time_t throttleTime = itr != GetAllThrottleMap.end() ? itr->second : curTime;
if (getall && throttleTime <= curTime)
{
- for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr)
+ for (AuctionEntryMap::const_iterator it = AuctionsMap.begin(); it != AuctionsMap.end(); ++it)
{
- AuctionEntry* Aentry = itr->second;
+ AuctionEntry* Aentry = it->second;
// Skip expired auctions
if (Aentry->expire_time < curTime)
continue;
@@ -737,9 +736,9 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
return;
}
- for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr)
+ for (AuctionEntryMap::const_iterator it = AuctionsMap.begin(); it != AuctionsMap.end(); ++it)
{
- AuctionEntry* Aentry = itr->second;
+ AuctionEntry* Aentry = it->second;
// Skip expired auctions
if (Aentry->expire_time < curTime)
continue;
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
index b68dc070ae4..50536fad021 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
@@ -308,11 +308,9 @@ Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type)
if (creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_A_CAPTAIN] || creature->GetEntry() == BG_AV_CreatureInfo[AV_NPC_H_CAPTAIN])
creature->SetRespawnDelay(RESPAWN_ONE_DAY); /// @todo look if this can be done by database + also add this for the wingcommanders
- if ((isStatic && cinfoid >= 10 && cinfoid <= 14) || (!isStatic && ((cinfoid >= AV_NPC_A_GRAVEDEFENSE0 && cinfoid <= AV_NPC_A_GRAVEDEFENSE3) ||
- (cinfoid >= AV_NPC_H_GRAVEDEFENSE0 && cinfoid <= AV_NPC_H_GRAVEDEFENSE3))))
+ if ((isStatic && cinfoid >= 10 && cinfoid <= 14) || (!isStatic && (cinfoid <= AV_NPC_A_GRAVEDEFENSE3 || (cinfoid >= AV_NPC_H_GRAVEDEFENSE0 && cinfoid <= AV_NPC_H_GRAVEDEFENSE3))))
{
- if (!isStatic && ((cinfoid >= AV_NPC_A_GRAVEDEFENSE0 && cinfoid <= AV_NPC_A_GRAVEDEFENSE3)
- || (cinfoid >= AV_NPC_H_GRAVEDEFENSE0 && cinfoid <= AV_NPC_H_GRAVEDEFENSE3)))
+ if (!isStatic && (cinfoid <= AV_NPC_A_GRAVEDEFENSE3 || (cinfoid >= AV_NPC_H_GRAVEDEFENSE0 && cinfoid <= AV_NPC_H_GRAVEDEFENSE3)))
{
CreatureData &data = sObjectMgr->NewOrExistCreatureData(creature->GetSpawnId());
data.spawnGroupData = sObjectMgr->GetDefaultSpawnGroup();
diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp
index e0df57b28ce..e2adcb82ff1 100644
--- a/src/server/game/Chat/Channels/Channel.cpp
+++ b/src/server/game/Chat/Channels/Channel.cpp
@@ -838,9 +838,9 @@ void Channel::SetOwner(ObjectGuid guid, bool exclaim)
if (exclaim)
{
- OwnerChangedAppend appender(_ownerGuid);
- ChannelNameBuilder<OwnerChangedAppend> builder(this, appender);
- SendToAll(builder);
+ OwnerChangedAppend ownerAppender(_ownerGuid);
+ ChannelNameBuilder<OwnerChangedAppend> ownerBuilder(this, ownerAppender);
+ SendToAll(ownerBuilder);
}
UpdateChannelInDB();
diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp
index 522fb917895..0438ef85a66 100644
--- a/src/server/game/Combat/ThreatManager.cpp
+++ b/src/server/game/Combat/ThreatManager.cpp
@@ -412,7 +412,7 @@ void ThreatManager::MatchUnitThreatToHighestThreat(Unit* target)
if ((++it) != end)
{
- ThreatReference const* a = *it;
+ a = *it;
if (a->IsOnline() && a->GetThreat() > highest->GetThreat())
highest = a;
}
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index e9ece723cb9..eb6f0b77a08 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -4220,7 +4220,7 @@ void ObjectMgr::LoadQuests()
for (QuestLoaderHelper const& loader : QuestLoaderHelpers)
{
- QueryResult result = WorldDatabase.PQuery("SELECT %s FROM %s", loader.QueryFields, loader.TableName);
+ result = WorldDatabase.PQuery("SELECT %s FROM %s", loader.QueryFields, loader.TableName);
if (!result)
TC_LOG_INFO("server.loading", ">> Loaded 0 quest %s. DB table `%s` is empty.", loader.TableDesc, loader.TableName);
else
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp
index db4cbc5ea00..ee6cb090d61 100644
--- a/src/server/game/Guilds/Guild.cpp
+++ b/src/server/game/Guilds/Guild.cpp
@@ -2187,8 +2187,8 @@ bool Guild::Validate()
Member* pLeader = GetMember(m_leaderGuid);
if (!pLeader)
{
- SQLTransaction trans(nullptr);
- DeleteMember(trans, m_leaderGuid);
+ SQLTransaction dummy(nullptr);
+ DeleteMember(dummy, m_leaderGuid);
// If no more members left, disband guild
if (m_members.empty())
{
diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp
index b44e917a189..763dc7e03f0 100644
--- a/src/server/game/Handlers/MiscHandler.cpp
+++ b/src/server/game/Handlers/MiscHandler.cpp
@@ -397,7 +397,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket& /*recvData*/)
if (GetPlayer()->GetStandState() == UNIT_STAND_STATE_STAND)
GetPlayer()->SetStandState(UNIT_STAND_STATE_SIT);
- WorldPacket data(SMSG_FORCE_MOVE_ROOT, (8+4)); // guess size
+ data.Initialize(SMSG_FORCE_MOVE_ROOT, (8+4)); // guess size
data << GetPlayer()->GetPackGUID();
data << (uint32)2;
SendPacket(&data);
diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp
index 52b15508835..b73e581ad04 100644
--- a/src/server/game/Handlers/PetitionsHandler.cpp
+++ b/src/server/game/Handlers/PetitionsHandler.cpp
@@ -210,8 +210,8 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
if (Petition const* petition = sPetitionMgr->GetPetitionByOwnerWithType(_player->GetGUID(), type))
{
// clear from petition store
- sPetitionMgr->RemovePetition(petition->petitionGuid);
- TC_LOG_DEBUG("network", "Invalid petition GUID: %u", petition->petitionGuid.GetCounter());
+ sPetitionMgr->RemovePetition(petition->PetitionGuid);
+ TC_LOG_DEBUG("network", "Invalid petition GUID: %u", petition->PetitionGuid.GetCounter());
}
// fill petition store
@@ -233,7 +233,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData)
}
// if guild petition and has guild => error, return;
- if (petition->petitionType == GUILD_CHARTER_TYPE && _player->GetGuildId())
+ if (petition->PetitionType == GUILD_CHARTER_TYPE && _player->GetGuildId())
return;
TC_LOG_DEBUG("network", "CMSG_PETITION_SHOW_SIGNATURES petition entry: '%u'", petitionGuid.GetCounter());
@@ -243,11 +243,11 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData)
void WorldSession::SendPetitionSigns(Petition const* petition, Player* sendTo)
{
- SignaturesVector const& signatures = petition->signatures;
+ SignaturesVector const& signatures = petition->Signatures;
WorldPacket data(SMSG_PETITION_SHOW_SIGNATURES, (8 + 8 + 4 + 1 + signatures.size() * 12));
- data << uint64(petition->petitionGuid); // petition guid
- data << uint64(petition->ownerGuid); // owner guid
- data << uint32(petition->petitionGuid.GetCounter()); // guild guid
+ data << uint64(petition->PetitionGuid); // petition guid
+ data << uint64(petition->OwnerGuid); // owner guid
+ data << uint32(petition->PetitionGuid.GetCounter()); // guild guid
data << uint8(signatures.size()); // sign's count
for (Signature const& signature : signatures)
@@ -281,13 +281,13 @@ void WorldSession::SendPetitionQueryOpcode(ObjectGuid petitionguid)
return;
}
- WorldPacket data(SMSG_PETITION_QUERY_RESPONSE, (4+8+petition->petitionName.size()+1+1+4*12+2+10));
+ WorldPacket data(SMSG_PETITION_QUERY_RESPONSE, (4+8+petition->PetitionName.size()+1+1+4*12+2+10));
data << uint32(petitionguid.GetCounter()); // guild/team guid (in Trinity always same as GUID_LOPART(petition guid)
- data << uint64(petition->ownerGuid); // charter owner guid
- data << petition->petitionName; // name (guild/arena team)
+ data << uint64(petition->OwnerGuid); // charter owner guid
+ data << petition->PetitionName; // name (guild/arena team)
data << uint8(0); // some string
- CharterTypes type = petition->petitionType;
+ CharterTypes type = petition->PetitionType;
if (type == GUILD_CHARTER_TYPE)
{
uint32 needed = sWorld->getIntConfig(CONFIG_MIN_PETITION_SIGNS);
@@ -341,7 +341,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket& recvData)
return;
}
- CharterTypes type = petition->petitionType;
+ CharterTypes type = petition->PetitionType;
if (type == GUILD_CHARTER_TYPE)
{
if (sGuildMgr->GetGuildByName(newName))
@@ -397,9 +397,9 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData)
return;
}
- ObjectGuid ownerGuid = petition->ownerGuid;
- CharterTypes type = petition->petitionType;
- uint8 signs = petition->signatures.size();
+ ObjectGuid ownerGuid = petition->OwnerGuid;
+ CharterTypes type = petition->PetitionType;
+ uint8 signs = petition->Signatures.size();
ObjectGuid playerGuid = _player->GetGUID();
if (ownerGuid == playerGuid)
@@ -476,7 +476,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData)
}
// fill petition store
- petition->AddSignature(petitionGuid, GetAccountId(), playerGuid, false);
+ petition->AddSignature(GetAccountId(), playerGuid, false);
TC_LOG_DEBUG("network", "PETITION SIGN: %s by player: %s (GUID: %u Account: %u)", petitionGuid.ToString().c_str(), _player->GetName().c_str(), playerGuid.GetCounter(), GetAccountId());
@@ -504,7 +504,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket& recvData)
return;
// petition owner online
- if (Player* owner = ObjectAccessor::FindConnectedPlayer(petition->ownerGuid))
+ if (Player* owner = ObjectAccessor::FindConnectedPlayer(petition->OwnerGuid))
{
WorldPacket data(MSG_PETITION_DECLINE, 8);
data << uint64(_player->GetGUID());
@@ -530,7 +530,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recvData)
if (!petition)
return;
- CharterTypes type = petition->petitionType;
+ CharterTypes type = petition->PetitionType;
TC_LOG_DEBUG("network", "OFFER PETITION: type %u, %s, to %s", static_cast<uint32>(type), petitionGuid.ToString().c_str(), offererGuid.ToString().c_str());
@@ -611,11 +611,11 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
return;
}
- CharterTypes type = petition->petitionType;
- std::string const name = petition->petitionName; // we need a copy, it will be removed on guild/arena remove
+ CharterTypes type = petition->PetitionType;
+ std::string const name = petition->PetitionName; // we need a copy, it will be removed on guild/arena remove
// Only the petition owner can turn in the petition
- if (_player->GetGUID() != petition->ownerGuid)
+ if (_player->GetGUID() != petition->OwnerGuid)
return;
// Petition type (guild/arena) specific checks
@@ -659,7 +659,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
}
}
- SignaturesVector const signatures = petition->signatures; // we need a copy, it will be removed on guild/arena remove
+ SignaturesVector const signatures = petition->Signatures; // we need a copy, it will be removed on guild/arena remove
uint32 requiredSignatures = static_cast<uint32>(type) - 1;
if (type == GUILD_CHARTER_TYPE)
requiredSignatures = sWorld->getIntConfig(CONFIG_MIN_PETITION_SIGNS);
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index 258e6a930e8..f2d82b9c9b2 100644
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -250,7 +250,7 @@ enum SpellSchools
MAX_SPELL_SCHOOL = 7
};
-enum SpellSchoolMask
+enum SpellSchoolMask : uint32
{
SPELL_SCHOOL_MASK_NONE = 0x00, // not exist
SPELL_SCHOOL_MASK_NORMAL = (1 << SPELL_SCHOOL_NORMAL), // PHYSICAL (Armor)
@@ -1254,7 +1254,7 @@ enum AuraStateType
(1<<(AURA_STATE_CONFLAGRATE-1))|(1<<(AURA_STATE_DEADLY_POISON-1)))
// Spell mechanics
-enum Mechanics
+enum Mechanics : uint32
{
MECHANIC_NONE = 0,
MECHANIC_CHARM = 1,
diff --git a/src/server/game/Petitions/PetitionMgr.cpp b/src/server/game/Petitions/PetitionMgr.cpp
index 0a709764bef..df845745e9d 100644
--- a/src/server/game/Petitions/PetitionMgr.cpp
+++ b/src/server/game/Petitions/PetitionMgr.cpp
@@ -79,7 +79,7 @@ void PetitionMgr::LoadSignatures()
if (!petition)
continue;
- petition->AddSignature(petition->petitionGuid, fields[1].GetUInt32(), ObjectGuid::Create<HighGuid::Player>(fields[2].GetUInt32()), true);
+ petition->AddSignature(fields[1].GetUInt32(), ObjectGuid::Create<HighGuid::Player>(fields[2].GetUInt32()), true);
++count;
} while (result->NextRow());
@@ -89,11 +89,11 @@ void PetitionMgr::LoadSignatures()
void PetitionMgr::AddPetition(ObjectGuid petitionGuid, ObjectGuid ownerGuid, std::string const& name, CharterTypes type, bool isLoading)
{
Petition& p = _petitionStore[petitionGuid];
- p.petitionGuid = petitionGuid;
- p.ownerGuid = ownerGuid;
- p.petitionName = name;
- p.petitionType = type;
- p.signatures.clear();
+ p.PetitionGuid = petitionGuid;
+ p.OwnerGuid = ownerGuid;
+ p.PetitionName = name;
+ p.PetitionType = type;
+ p.Signatures.clear();
if (isLoading)
return;
@@ -136,7 +136,7 @@ Petition* PetitionMgr::GetPetition(ObjectGuid petitionGuid)
Petition* PetitionMgr::GetPetitionByOwnerWithType(ObjectGuid ownerGuid, CharterTypes type)
{
for (auto& petitionPair : _petitionStore)
- if (petitionPair.second.ownerGuid == ownerGuid && petitionPair.second.petitionType == type)
+ if (petitionPair.second.OwnerGuid == ownerGuid && petitionPair.second.PetitionType == type)
return &petitionPair.second;
return nullptr;
@@ -146,11 +146,11 @@ void PetitionMgr::RemovePetitionsByOwnerAndType(ObjectGuid ownerGuid, CharterTyp
{
for (auto itr = _petitionStore.begin(); itr != _petitionStore.end();)
{
- if (itr->second.ownerGuid == ownerGuid)
+ if (itr->second.OwnerGuid == ownerGuid)
{
if (type == CHARTER_TYPE_ANY)
itr = _petitionStore.erase(itr);
- else if (type == itr->second.petitionType)
+ else if (type == itr->second.PetitionType)
{
itr = _petitionStore.erase(itr);
break;
@@ -193,7 +193,7 @@ void PetitionMgr::RemoveSignaturesBySignerAndType(ObjectGuid signerGuid, Charter
{
for (auto& petitionPair : _petitionStore)
{
- if (petitionPair.second.petitionType == CHARTER_TYPE_ANY || petitionPair.second.petitionType == type)
+ if (petitionPair.second.PetitionType == CHARTER_TYPE_ANY || petitionPair.second.PetitionType == type)
petitionPair.second.RemoveSignatureBySigner(signerGuid);
}
@@ -214,24 +214,24 @@ void PetitionMgr::RemoveSignaturesBySignerAndType(ObjectGuid signerGuid, Charter
bool Petition::IsPetitionSignedByAccount(uint32 accountId) const
{
- for (Signature const& signature : signatures)
+ for (Signature const& signature : Signatures)
if (signature.first == accountId)
return true;
return false;
}
-void Petition::AddSignature(ObjectGuid petitionGuid, uint32 accountId, ObjectGuid playerGuid, bool isLoading)
+void Petition::AddSignature(uint32 accountId, ObjectGuid playerGuid, bool isLoading)
{
- signatures.emplace_back(accountId, playerGuid);
+ Signatures.emplace_back(accountId, playerGuid);
if (isLoading)
return;
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PETITION_SIGNATURE);
- stmt->setUInt32(0, ownerGuid.GetCounter());
- stmt->setUInt32(1, petitionGuid.GetCounter());
+ stmt->setUInt32(0, OwnerGuid.GetCounter());
+ stmt->setUInt32(1, PetitionGuid.GetCounter());
stmt->setUInt32(2, playerGuid);
stmt->setUInt32(3, accountId);
@@ -240,25 +240,25 @@ void Petition::AddSignature(ObjectGuid petitionGuid, uint32 accountId, ObjectGui
void Petition::UpdateName(std::string const& newName)
{
- petitionName = newName;
+ PetitionName = newName;
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PETITION_NAME);
stmt->setString(0, newName);
- stmt->setUInt32(1, petitionGuid.GetCounter());
+ stmt->setUInt32(1, PetitionGuid.GetCounter());
CharacterDatabase.Execute(stmt);
}
void Petition::RemoveSignatureBySigner(ObjectGuid playerGuid)
{
- for (auto itr = signatures.begin(); itr != signatures.end(); ++itr)
+ for (auto itr = Signatures.begin(); itr != Signatures.end(); ++itr)
{
if (itr->second == playerGuid)
{
- signatures.erase(itr);
+ Signatures.erase(itr);
// notify owner
- if (Player* owner = ObjectAccessor::FindConnectedPlayer(ownerGuid))
- owner->GetSession()->SendPetitionQueryOpcode(petitionGuid);
+ if (Player* owner = ObjectAccessor::FindConnectedPlayer(OwnerGuid))
+ owner->GetSession()->SendPetitionQueryOpcode(PetitionGuid);
break;
}
diff --git a/src/server/game/Petitions/PetitionMgr.h b/src/server/game/Petitions/PetitionMgr.h
index ba7590ff7cb..446c121bdac 100644
--- a/src/server/game/Petitions/PetitionMgr.h
+++ b/src/server/game/Petitions/PetitionMgr.h
@@ -46,14 +46,14 @@ typedef std::vector<Signature> SignaturesVector;
struct Petition
{
- ObjectGuid petitionGuid;
- ObjectGuid ownerGuid;
- CharterTypes petitionType;
- std::string petitionName;
- SignaturesVector signatures;
+ ObjectGuid PetitionGuid;
+ ObjectGuid OwnerGuid;
+ CharterTypes PetitionType;
+ std::string PetitionName;
+ SignaturesVector Signatures;
bool IsPetitionSignedByAccount(uint32 accountId) const;
- void AddSignature(ObjectGuid petitionGuid, uint32 accountId, ObjectGuid playerGuid, bool isLoading);
+ void AddSignature(uint32 accountId, ObjectGuid playerGuid, bool isLoading);
void UpdateName(std::string const& newName);
void RemoveSignatureBySigner(ObjectGuid playerGuid);
};
diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp
index b0370d72560..5cb8e056b01 100644
--- a/src/server/game/Server/WorldSocket.cpp
+++ b/src/server/game/Server/WorldSocket.cpp
@@ -555,7 +555,7 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptr<AuthSession> authSes
{
mutetime = GameTime::GetGameTime() + llabs(mutetime);
- PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME_LOGIN);
+ stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME_LOGIN);
stmt->setInt64(0, mutetime);
stmt->setUInt32(1, account.Id);
LoginDatabase.Execute(stmt);
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 2173d681f51..8e295028d34 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -3151,11 +3151,11 @@ void Spell::_cast(bool skipCheck)
// Let any pets know we've attacked something. Check DmgClass for harmful spells only
// This prevents spells such as Hunter's Mark from triggering pet attack
if (GetSpellInfo()->DmgClass != SPELL_DAMAGE_CLASS_NONE)
- if (Unit* unitTarget = m_targets.GetUnitTarget())
+ if (Unit* target = m_targets.GetUnitTarget())
for (Unit* controlled : playerCaster->m_Controlled)
if (Creature* cControlled = controlled->ToCreature())
if (cControlled->IsAIEnabled)
- cControlled->AI()->OwnerAttacked(unitTarget);
+ cControlled->AI()->OwnerAttacked(target);
}
SetExecutedCurrently(true);
@@ -3228,7 +3228,7 @@ void Spell::_cast(bool skipCheck)
if (aura_effmask)
{
bool const triggered = m_triggeredByAuraSpell != nullptr;
- if (DiminishingGroup diminishGroup = m_spellInfo->GetDiminishingReturnsGroupForSpell(triggered))
+ if (m_spellInfo->GetDiminishingReturnsGroupForSpell(triggered))
{
DiminishingReturnsType type = m_spellInfo->GetDiminishingReturnsGroupType(triggered);
if (type == DRTYPE_ALL || (type == DRTYPE_PLAYER && target->IsAffectedByDiminishingReturns()))
@@ -5576,7 +5576,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
if (!m_targets.GetUnitTarget() || m_targets.GetUnitTarget() == m_caster)
return SPELL_FAILED_BAD_TARGETS;
- uint32 dispelMask = SpellInfo::GetDispelMask(DispelType(m_spellInfo->Effects[i].MiscValue));
+ dispelMask = SpellInfo::GetDispelMask(DispelType(m_spellInfo->Effects[i].MiscValue));
bool hasStealableAura = false;
Unit::VisibleAuraMap const* visibleAuras = m_targets.GetUnitTarget()->GetVisibleAuras();
for (Unit::VisibleAuraMap::const_iterator itr = visibleAuras->begin(); itr != visibleAuras->end(); ++itr)
diff --git a/src/server/game/Spells/SpellDefines.h b/src/server/game/Spells/SpellDefines.h
index 2a38f1627e7..6261fc0594b 100644
--- a/src/server/game/Spells/SpellDefines.h
+++ b/src/server/game/Spells/SpellDefines.h
@@ -24,7 +24,7 @@
class Item;
class AuraEffect;
-enum SpellInterruptFlags
+enum SpellInterruptFlags : uint32
{
SPELL_INTERRUPT_FLAG_MOVEMENT = 0x01, // why need this for instant?
SPELL_INTERRUPT_FLAG_PUSH_BACK = 0x02, // push back
@@ -35,13 +35,13 @@ enum SpellInterruptFlags
};
// See SpellAuraInterruptFlags for other values definitions
-enum SpellChannelInterruptFlags
+enum SpellChannelInterruptFlags : uint32
{
CHANNEL_INTERRUPT_FLAG_INTERRUPT = 0x0008, // interrupt
CHANNEL_FLAG_DELAY = 0x4000
};
-enum SpellAuraInterruptFlags
+enum SpellAuraInterruptFlags : uint32
{
AURA_INTERRUPT_FLAG_HITBYSPELL = 0x00000001, // 0 removed when getting hit by a negative spell?
AURA_INTERRUPT_FLAG_TAKE_DAMAGE = 0x00000002, // 1 removed by any damage
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 54d0ded9049..88af62ac0cb 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -1446,7 +1446,7 @@ void SpellMgr::LoadSpellGroupStackRules()
if (!spellInfo->Effects[i].IsAura())
continue;
- int32 auraName = static_cast<int32>(spellInfo->Effects[i].ApplyAuraName);
+ uint32 auraName = spellInfo->Effects[i].ApplyAuraName;
for (std::vector<uint32> const& subGroup : SubGroups)
{
if (std::find(subGroup.begin(), subGroup.end(), auraName) != subGroup.end())
diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp
index d86e2989ef1..1c11121b94a 100644
--- a/src/server/game/Tools/PlayerDump.cpp
+++ b/src/server/game/Tools/PlayerDump.cpp
@@ -610,16 +610,16 @@ void PlayerDumpWriter::PopulateGuids(ObjectGuid::LowType guid)
switch (baseTable.StoredType)
{
case GUID_TYPE_ITEM:
- if (ObjectGuid::LowType guid = (*result)[0].GetUInt32())
- _items.insert(guid);
+ if (ObjectGuid::LowType itemLowGuid = (*result)[0].GetUInt32())
+ _items.insert(itemLowGuid);
break;
case GUID_TYPE_MAIL:
- if (ObjectGuid::LowType guid = (*result)[0].GetUInt32())
- _mails.insert(guid);
+ if (ObjectGuid::LowType mailLowGuid = (*result)[0].GetUInt32())
+ _mails.insert(mailLowGuid);
break;
case GUID_TYPE_PET:
- if (ObjectGuid::LowType guid = (*result)[0].GetUInt32())
- _pets.insert(guid);
+ if (ObjectGuid::LowType petLowGuid = (*result)[0].GetUInt32())
+ _pets.insert(petLowGuid);
break;
case GUID_TYPE_EQUIPMENT_SET:
if (uint64 eqSetId = (*result)[0].GetUInt64())
diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp
index 2accfc462d2..8fade3ec857 100644
--- a/src/server/scripts/Commands/cs_lookup.cpp
+++ b/src/server/scripts/Commands/cs_lookup.cpp
@@ -416,33 +416,29 @@ public:
for (auto const& itemTemplatePair : its)
{
uint8 localeIndex = handler->GetSessionDbLocaleIndex();
- if (localeIndex >= 0)
+ if (ItemLocale const* il = sObjectMgr->GetItemLocale(itemTemplatePair.first))
{
- uint8 ulocaleIndex = uint8(localeIndex);
- if (ItemLocale const* il = sObjectMgr->GetItemLocale(itemTemplatePair.first))
+ if (il->Name.size() > localeIndex && !il->Name[localeIndex].empty())
{
- if (il->Name.size() > ulocaleIndex && !il->Name[ulocaleIndex].empty())
- {
- std::string const& name = il->Name[ulocaleIndex];
+ std::string const& name = il->Name[localeIndex];
- if (Utf8FitTo(name, wNamePart))
+ if (Utf8FitTo(name, wNamePart))
+ {
+ if (maxResults && count++ == maxResults)
{
- if (maxResults && count++ == maxResults)
- {
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- if (handler->GetSession())
- handler->PSendSysMessage(LANG_ITEM_LIST_CHAT, itemTemplatePair.first, itemTemplatePair.first, name.c_str());
- else
- handler->PSendSysMessage(LANG_ITEM_LIST_CONSOLE, itemTemplatePair.first, name.c_str());
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_ITEM_LIST_CHAT, itemTemplatePair.first, itemTemplatePair.first, name.c_str());
+ else
+ handler->PSendSysMessage(LANG_ITEM_LIST_CONSOLE, itemTemplatePair.first, name.c_str());
- if (!found)
- found = true;
+ if (!found)
+ found = true;
- continue;
- }
+ continue;
}
}
}
@@ -647,53 +643,49 @@ public:
for (auto const& questTemplatePair : questTemplates)
{
uint8 localeIndex = handler->GetSessionDbLocaleIndex();
- if (localeIndex >= 0)
+ if (QuestLocale const* questLocale = sObjectMgr->GetQuestLocale(questTemplatePair.first))
{
- uint8 ulocaleIndex = uint8(localeIndex);
- if (QuestLocale const* questLocale = sObjectMgr->GetQuestLocale(questTemplatePair.first))
+ if (questLocale->Title.size() > localeIndex && !questLocale->Title[localeIndex].empty())
{
- if (questLocale->Title.size() > ulocaleIndex && !questLocale->Title[ulocaleIndex].empty())
- {
- std::string const& title = questLocale->Title[ulocaleIndex];
+ std::string const& title = questLocale->Title[localeIndex];
- if (Utf8FitTo(title, wNamePart))
+ if (Utf8FitTo(title, wNamePart))
+ {
+ if (maxResults && count++ == maxResults)
{
- if (maxResults && count++ == maxResults)
- {
- handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
- return true;
- }
+ handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
+ return true;
+ }
- char const* statusStr = "";
+ char const* statusStr = "";
- if (target)
+ if (target)
+ {
+ switch (target->GetQuestStatus(questTemplatePair.first))
{
- switch (target->GetQuestStatus(questTemplatePair.first))
- {
- case QUEST_STATUS_COMPLETE:
- statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_COMPLETE);
- break;
- case QUEST_STATUS_INCOMPLETE:
- statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_ACTIVE);
- break;
- case QUEST_STATUS_REWARDED:
- statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_REWARDED);
- break;
- default:
- break;
- }
+ case QUEST_STATUS_COMPLETE:
+ statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_COMPLETE);
+ break;
+ case QUEST_STATUS_INCOMPLETE:
+ statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_ACTIVE);
+ break;
+ case QUEST_STATUS_REWARDED:
+ statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_REWARDED);
+ break;
+ default:
+ break;
}
+ }
- if (handler->GetSession())
- handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, questTemplatePair.first, questTemplatePair.first, questTemplatePair.second.GetQuestLevel(), title.c_str(), statusStr);
- else
- handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, questTemplatePair.first, title.c_str(), statusStr);
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, questTemplatePair.first, questTemplatePair.first, questTemplatePair.second.GetQuestLevel(), title.c_str(), statusStr);
+ else
+ handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, questTemplatePair.first, title.c_str(), statusStr);
- if (!found)
- found = true;
+ if (!found)
+ found = true;
- continue;
- }
+ continue;
}
}
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp
index d4cad450d83..79a8f44b475 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp
@@ -567,7 +567,7 @@ class spell_auriaya_agro_creator : public SpellScript
}
};
-// 61906 - Random Aggro Periodic (5 sec)
+// 61906 - Random Aggro Periodic (5 sec)
class spell_auriaya_random_agro_periodic : public AuraScript
{
PrepareAuraScript(spell_auriaya_random_agro_periodic);
@@ -583,17 +583,16 @@ class spell_auriaya_random_agro_periodic : public AuraScript
if (!owner || !owner->IsAIEnabled || owner->HasReactState(REACT_PASSIVE))
return;
- if (Unit* target = owner->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, CatsTargetSelector(owner, 15.0f, 25.0f)))
- {
- owner->GetThreatManager().AddThreat(target, 3000000.0f, nullptr, true);
- owner->CastSpell(target, SPELL_FERAL_POUNCE, true);
- owner->AI()->AttackStart(target);
- }
- else if (Unit* target = owner->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0))
- {
- owner->GetThreatManager().AddThreat(target, 3000000.0f);
- owner->AI()->AttackStart(target);
- }
+ Unit* target = owner->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, CatsTargetSelector(owner, 15.0f, 25.0f));
+ if (!target)
+ target = owner->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0);
+
+ if (!target)
+ return;
+
+ owner->GetThreatManager().AddThreat(target, 3000000.0f, nullptr, true);
+ owner->CastSpell(target, SPELL_FERAL_POUNCE, true);
+ owner->AI()->AttackStart(target);
}
void Register() override
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index 8729fb4c889..238637a13f2 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -1736,7 +1736,7 @@ class spell_dk_pestilence : public SpellScriptLoader
float donePct = aurOld->GetDonePct();
float critChance = aurOld->GetCritChance();
- if (AuraEffect* aurEffOld = aurOld->GetEffect(EFFECT_0))
+ if (aurOld->GetEffect(EFFECT_0))
{
caster->CastSpell(hitUnit, SPELL_DK_BLOOD_PLAGUE, true); // Spread the disease to hitUnit.
@@ -1754,7 +1754,7 @@ class spell_dk_pestilence : public SpellScriptLoader
{
float donePct = aurOld->GetDonePct();
- if (AuraEffect* aurEffOld = aurOld->GetEffect(EFFECT_0))
+ if (aurOld->GetEffect(EFFECT_0))
{
caster->CastSpell(hitUnit, SPELL_DK_FROST_FEVER, true); // Spread the disease to hitUnit.
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index 4f5aa72c759..279553f87e9 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -830,7 +830,6 @@ class spell_warl_life_tap : public SpellScriptLoader
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, WARLOCK_ICON_ID_IMPROVED_LIFE_TAP, 0))
AddPct(mana, aurEff->GetAmount());
- // @todo castspell refactor note: this is not triggered - intended?
CastSpellExtraArgs args;
args.AddSpellBP0(mana);
caster->CastSpell(target, SPELL_WARLOCK_LIFE_TAP_ENERGIZE, args);
@@ -843,9 +842,9 @@ class spell_warl_life_tap : public SpellScriptLoader
if (manaFeedVal > 0)
{
ApplyPct(manaFeedVal, mana);
- CastSpellExtraArgs args(TRIGGERED_FULL_MASK);
- args.AddSpellBP0(manaFeedVal);
- caster->CastSpell(caster, SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2, args);
+ CastSpellExtraArgs manaFeedArgs(TRIGGERED_FULL_MASK);
+ manaFeedArgs.AddSpellBP0(manaFeedVal);
+ caster->CastSpell(caster, SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2, manaFeedArgs);
}
}
}