diff options
author | Gustavo <sirikfoll@hotmail.com> | 2019-04-03 23:36:26 -0300 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-11-26 11:18:15 +0100 |
commit | 6aaf9aaf3b72276078396d39e83cd3b605d49fb8 (patch) | |
tree | d351bac363ac24688455a8cc2932a61d342c1e52 /src | |
parent | 5aa0539d4b9e0ea83e0daf693b428d0687291777 (diff) |
Core/Misc: Warning fixes (/W4) (#23149)
* Core/Misc: Warning fixes (/W4)
(cherry picked from commit 50f122de778bca324d0f4c81f1e8eb30b90a7314)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/DungeonFinding/LFGMgr.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Handlers/PetHandler.cpp | 12 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_account.cpp | 10 |
3 files changed, 17 insertions, 9 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 696d12d0f17..9d18eadc1bc 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -984,8 +984,8 @@ void LFGMgr::MakeNewGroup(LfgProposal const& proposal) if (!dungeons.empty()) { uint32 rDungeonId = (*dungeons.begin()); - LFGDungeonData const* dungeon = GetLFGDungeon(rDungeonId); - if (dungeon && dungeon->type == LFG_TYPE_RANDOM) + LFGDungeonData const* dungeonEntry = GetLFGDungeon(rDungeonId); + if (dungeonEntry && dungeonEntry->type == LFG_TYPE_RANDOM) player->CastSpell(player, LFG_SPELL_DUNGEON_COOLDOWN, false); } } diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 9c2490f6d6e..667d81bdca9 100644 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -643,21 +643,21 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPackets::Pet::PetSpellAutoc if (controlled->GetEntry() == pet->GetEntry() && controlled->IsAlive()) pets.push_back(controlled); - for (Unit* pet : pets) + for (Unit* petControlled : pets) { // do not add not learned spells/ passive spells - if (!pet->HasSpell(packet.SpellID) || !spellInfo->IsAutocastable()) + if (!petControlled->HasSpell(packet.SpellID) || !spellInfo->IsAutocastable()) return; - CharmInfo* charmInfo = pet->GetCharmInfo(); + CharmInfo* charmInfo = petControlled->GetCharmInfo(); if (!charmInfo) { - TC_LOG_ERROR("entities.pet", "WorldSession::HandlePetSpellAutocastOpcode: object (%s) is considered pet-like but doesn't have a charminfo!", pet->GetGUID().ToString().c_str()); + TC_LOG_ERROR("entities.pet", "WorldSession::HandlePetSpellAutocastOpcode: object (%s) is considered pet-like but doesn't have a charminfo!", petControlled->GetGUID().ToString().c_str()); return; } - if (pet->IsPet()) - pet->ToPet()->ToggleAutocast(spellInfo, packet.AutocastEnabled); + if (petControlled->IsPet()) + petControlled->ToPet()->ToggleAutocast(spellInfo, packet.AutocastEnabled); else charmInfo->ToggleCreatureAutocast(spellInfo, packet.AutocastEnabled); diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 56d93f71096..9c4503560c2 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -524,7 +524,15 @@ public: uint32 accountId; if (accountName) { - if (!Utf8ToUpperOnlyLatin(*accountName) || !(accountId = AccountMgr::GetId(*accountName))) + if (!Utf8ToUpperOnlyLatin(*accountName)) + { + handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName->c_str()); + handler->SetSentErrorMessage(true); + return false; + } + + accountId = AccountMgr::GetId(*accountName); + if (!accountId) { handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName->c_str()); handler->SetSentErrorMessage(true); |