diff options
-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); |