mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Misc: Warning fixes (/W4) (#23149)
* Core/Misc: Warning fixes (/W4)
(cherry picked from commit 50f122de77)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user