diff options
Diffstat (limited to 'src/server/game')
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 1 | ||||
| -rw-r--r-- | src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/Chat/Channels/Channel.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/Combat/ThreatManager.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Guilds/Guild.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Handlers/PetitionsHandler.cpp | 32 | ||||
| -rw-r--r-- | src/server/game/Miscellaneous/SharedDefines.h | 4 | ||||
| -rw-r--r-- | src/server/game/Petitions/PetitionMgr.cpp | 36 | ||||
| -rw-r--r-- | src/server/game/Petitions/PetitionMgr.h | 10 | ||||
| -rw-r--r-- | src/server/game/Spells/Spell.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Tools/PlayerDump.cpp | 12 |
14 files changed, 62 insertions, 65 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index bd624166a5c..169e69edd91 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -805,8 +805,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 015f124cfae..b0eb0437e49 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -732,7 +732,6 @@ void AuctionHouseMgr::PendingAuctionProcess(Player* player) trans->Append(stmt); ++itrAH; } while (itrAH != iterMap->second.Auctions.end()); - CharacterDatabase.CommitTransaction(trans); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index 35c5feefc7c..07fa4bbcc98 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -299,11 +299,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 318c7b76108..0c2494305c4 100644 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -886,9 +886,9 @@ void Channel::SetOwner(ObjectGuid const& guid, bool exclaim) if (exclaim) { - OwnerChangedAppend ownerChangedAppender(_ownerGuid); - ChannelNameBuilder<OwnerChangedAppend> ownerChangedBuilder(this, ownerChangedAppender); - SendToAll(ownerChangedBuilder); + 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 355cb225105..3cbd1c39bf3 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -420,7 +420,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 22be28806e7..ec58f379b9e 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4208,7 +4208,7 @@ void ObjectMgr::LoadQuests() for (QuestLoaderHelper const& loader : QuestLoaderHelpers) { - QueryResult result = WorldDatabase.PQuery("SELECT %s FROM %s %s", loader.QueryFields, loader.TableName, loader.QueryExtra); + result = WorldDatabase.PQuery("SELECT %s FROM %s %s", loader.QueryFields, loader.TableName, loader.QueryExtra); if (!result) TC_LOG_INFO("server.loading", ">> Loaded 0 quest %s. DB table `%s` is empty.", loader.TableDesc, loader.TableName); diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index ce259bc4715..6b41a72969c 100644 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -2569,8 +2569,8 @@ bool Guild::Validate() Member* leader = GetMember(m_leaderGuid); if (!leader) { - CharacterDatabaseTransaction trans(nullptr); - DeleteMember(trans, m_leaderGuid); + CharacterDatabaseTransaction dummy(nullptr); + DeleteMember(dummy, m_leaderGuid); // If no more members left, disband guild if (m_members.empty()) { diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp index 294f12c36df..2c446e0a27b 100644 --- a/src/server/game/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Handlers/PetitionsHandler.cpp @@ -107,8 +107,8 @@ void WorldSession::HandlePetitionBuy(WorldPackets::Petition::PetitionBuy& packet if (Petition const* petition = sPetitionMgr->GetPetitionByOwner(_player->GetGUID())) { // clear from petition store - sPetitionMgr->RemovePetition(petition->petitionGuid); - TC_LOG_DEBUG("network", "Invalid petition GUID: %s", petition->petitionGuid.ToString().c_str()); + sPetitionMgr->RemovePetition(petition->PetitionGuid); + TC_LOG_DEBUG("network", "Invalid petition GUID: %s", petition->PetitionGuid.ToString().c_str()); } // fill petition store @@ -136,12 +136,12 @@ void WorldSession::HandlePetitionShowSignatures(WorldPackets::Petition::Petition void WorldSession::SendPetitionSigns(Petition const* petition, Player* sendTo) { WorldPackets::Petition::ServerPetitionShowSignatures signaturesPacket; - signaturesPacket.Item = petition->petitionGuid; - signaturesPacket.Owner = petition->ownerGuid; - signaturesPacket.OwnerAccountID = ObjectGuid::Create<HighGuid::WowAccount>(sCharacterCache->GetCharacterAccountIdByGuid(petition->ownerGuid)); - signaturesPacket.PetitionID = petition->petitionGuid.GetCounter(); + signaturesPacket.Item = petition->PetitionGuid; + signaturesPacket.Owner = petition->OwnerGuid; + signaturesPacket.OwnerAccountID = ObjectGuid::Create<HighGuid::WowAccount>(sCharacterCache->GetCharacterAccountIdByGuid(petition->OwnerGuid)); + signaturesPacket.PetitionID = petition->PetitionGuid.GetCounter(); - for (Signature const& signature : petition->signatures) + for (Signature const& signature : petition->Signatures) { WorldPackets::Petition::ServerPetitionShowSignatures::PetitionSignature signaturePkt; signaturePkt.Signer = signature.second; @@ -177,10 +177,10 @@ void WorldSession::SendPetitionQueryOpcode(ObjectGuid petitionguid) WorldPackets::Petition::PetitionInfo& petitionInfo = responsePacket.Info; petitionInfo.PetitionID = int32(petitionguid.GetCounter()); - petitionInfo.Petitioner = petition->ownerGuid; + petitionInfo.Petitioner = petition->OwnerGuid; petitionInfo.MinSignatures = reqSignatures; petitionInfo.MaxSignatures = reqSignatures; - petitionInfo.Title = petition->petitionName; + petitionInfo.Title = petition->PetitionName; responsePacket.Allow = true; @@ -232,8 +232,8 @@ void WorldSession::HandleSignPetition(WorldPackets::Petition::SignPetition& pack return; } - ObjectGuid ownerGuid = petition->ownerGuid; - uint64 signs = petition->signatures.size(); + ObjectGuid ownerGuid = petition->OwnerGuid; + uint64 signs = petition->Signatures.size(); if (ownerGuid == _player->GetGUID()) return; @@ -281,7 +281,7 @@ void WorldSession::HandleSignPetition(WorldPackets::Petition::SignPetition& pack } // fill petition store - petition->AddSignature(packet.PetitionGUID, GetAccountId(), _player->GetGUID(), false); + petition->AddSignature(GetAccountId(), _player->GetGUID(), false); TC_LOG_DEBUG("network", "PETITION SIGN: %s by player: %s (%s Account: %u)", packet.PetitionGUID.ToString().c_str(), _player->GetName().c_str(), _player->GetGUID().ToString().c_str(), GetAccountId()); @@ -312,7 +312,7 @@ void WorldSession::HandleDeclinePetition(WorldPackets::Petition::DeclinePetition return; // petition owner online - if (Player* owner = ObjectAccessor::FindConnectedPlayer(petition->ownerGuid)) + if (Player* owner = ObjectAccessor::FindConnectedPlayer(petition->OwnerGuid)) { WorldPackets::Petition::PetitionDeclined packet; packet.Decliner = _player->GetGUID(); @@ -370,10 +370,10 @@ void WorldSession::HandleTurnInPetition(WorldPackets::Petition::TurnInPetition& return; } - std::string const name = petition->petitionName; // we need a copy, Guild::AddMember invalidates petition + std::string const name = petition->PetitionName; // we need a copy, Guild::AddMember invalidates petition // Only the petition owner can turn in the petition - if (_player->GetGUID() != petition->ownerGuid) + if (_player->GetGUID() != petition->OwnerGuid) return; // Check if player is already in a guild @@ -392,7 +392,7 @@ void WorldSession::HandleTurnInPetition(WorldPackets::Petition::TurnInPetition& return; } - SignaturesVector const signatures = petition->signatures; // we need a copy, Guild::AddMember invalidates petition + SignaturesVector const signatures = petition->Signatures; // we need a copy, Guild::AddMember invalidates petition uint32 requiredSignatures = sWorld->getIntConfig(CONFIG_MIN_PETITION_SIGNS); // Notify player if signatures are missing diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 7603bef304d..a1e6f6356c8 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -300,7 +300,7 @@ enum SpellSchools : uint16 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) @@ -2327,7 +2327,7 @@ enum AuraStateType (1<<(AURA_STATE_RAID_ENCOUNTER_2-1))|(1<<(AURA_STATE_ROGUE_POISONED-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 87199224c4f..162407e5f09 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].GetUInt64()), true); + petition->AddSignature(fields[1].GetUInt32(), ObjectGuid::Create<HighGuid::Player>(fields[2].GetUInt64()), true); ++count; } while (result->NextRow()); @@ -89,10 +89,10 @@ void PetitionMgr::LoadSignatures() void PetitionMgr::AddPetition(ObjectGuid petitionGuid, ObjectGuid ownerGuid, std::string const& name, bool isLoading) { Petition& p = _petitionStore[petitionGuid]; - p.petitionGuid = petitionGuid; - p.ownerGuid = ownerGuid; - p.petitionName = name; - p.signatures.clear(); + p.PetitionGuid = petitionGuid; + p.OwnerGuid = ownerGuid; + p.PetitionName = name; + p.Signatures.clear(); if (isLoading) return; @@ -134,7 +134,7 @@ Petition* PetitionMgr::GetPetition(ObjectGuid petitionGuid) Petition* PetitionMgr::GetPetitionByOwner(ObjectGuid ownerGuid) { for (auto& petitionPair : _petitionStore) - if (petitionPair.second.ownerGuid == ownerGuid) + if (petitionPair.second.OwnerGuid == ownerGuid) return &petitionPair.second; return nullptr; @@ -144,7 +144,7 @@ void PetitionMgr::RemovePetitionsByOwner(ObjectGuid ownerGuid) { for (auto itr = _petitionStore.begin(); itr != _petitionStore.end();) { - if (itr->second.ownerGuid == ownerGuid) + if (itr->second.OwnerGuid == ownerGuid) { _petitionStore.erase(itr); break; @@ -177,24 +177,24 @@ void PetitionMgr::RemoveSignaturesBySigner(ObjectGuid signerGuid) 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; CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PETITION_SIGNATURE); - stmt->setUInt64(0, ownerGuid.GetCounter()); - stmt->setUInt64(1, petitionGuid.GetCounter()); + stmt->setUInt64(0, OwnerGuid.GetCounter()); + stmt->setUInt64(1, PetitionGuid.GetCounter()); stmt->setUInt64(2, playerGuid.GetCounter()); stmt->setUInt32(3, accountId); @@ -203,25 +203,25 @@ void Petition::AddSignature(ObjectGuid petitionGuid, uint32 accountId, ObjectGui void Petition::UpdateName(std::string const& newName) { - petitionName = newName; + PetitionName = newName; CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PETITION_NAME); stmt->setString(0, newName); - stmt->setUInt64(1, petitionGuid.GetCounter()); + stmt->setUInt64(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 913ed796105..9c83b1c24df 100644 --- a/src/server/game/Petitions/PetitionMgr.h +++ b/src/server/game/Petitions/PetitionMgr.h @@ -53,13 +53,13 @@ typedef std::vector<Signature> SignaturesVector; struct Petition { - ObjectGuid petitionGuid; - ObjectGuid ownerGuid; - std::string petitionName; - SignaturesVector signatures; + ObjectGuid PetitionGuid; + ObjectGuid OwnerGuid; + 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/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 58a81a6795e..cfde52ec4d6 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3202,11 +3202,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); @@ -3278,7 +3278,7 @@ void Spell::_cast(bool skipCheck) if (aura_effmask) { - if (DiminishingGroup diminishGroup = m_spellInfo->GetDiminishingReturnsGroupForSpell()) + if (m_spellInfo->GetDiminishingReturnsGroupForSpell()) { DiminishingReturnsType type = m_spellInfo->GetDiminishingReturnsGroupType(); if (type == DRTYPE_ALL || (type == DRTYPE_PLAYER && target->IsAffectedByDiminishingReturns())) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index be77f4af514..f3477dae2fd 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1428,7 +1428,7 @@ void SpellMgr::LoadSpellGroupStackRules() if (!effectInfo->IsAura()) continue; - int32 auraName = static_cast<int32>(effectInfo->ApplyAuraName); + uint32 auraName = effectInfo->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 571571da749..c4139c435df 100644 --- a/src/server/game/Tools/PlayerDump.cpp +++ b/src/server/game/Tools/PlayerDump.cpp @@ -703,16 +703,16 @@ void PlayerDumpWriter::PopulateGuids(ObjectGuid::LowType guid) switch (baseTable.StoredType) { case GUID_TYPE_ITEM: - if (ObjectGuid::LowType guid = (*result)[0].GetUInt64()) - _items.insert(guid); + if (ObjectGuid::LowType itemLowGuid = (*result)[0].GetUInt32()) + _items.insert(itemLowGuid); break; case GUID_TYPE_MAIL: - if (uint32 guid = (*result)[0].GetUInt32()) - _mails.insert(guid); + if (uint32 mailLowGuid = (*result)[0].GetUInt32()) + _mails.insert(mailLowGuid); break; case GUID_TYPE_PET: - if (uint32 guid = (*result)[0].GetUInt32()) - _pets.insert(guid); + if (uint32 petLowGuid = (*result)[0].GetUInt32()) + _pets.insert(petLowGuid); break; case GUID_TYPE_EQUIPMENT_SET: if (uint64 eqSetId = (*result)[0].GetUInt64()) |
