aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/DungeonFinding/LFGMgr.cpp4
-rw-r--r--src/server/game/Handlers/PetHandler.cpp30
-rw-r--r--src/server/game/Spells/Spell.cpp6
-rw-r--r--src/server/scripts/Commands/cs_account.cpp10
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp8
5 files changed, 33 insertions, 25 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index a21cd01ba37..08a4f88c667 100644
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -962,8 +962,8 @@ void LFGMgr::MakeNewGroup(LfgProposal const& proposal)
if (!dungeons.empty())
{
uint32 rDungeonId = (*dungeons.begin());
- LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(rDungeonId);
- if (dungeon && dungeon->type == LFG_TYPE_RANDOM)
+ LFGDungeonEntry const* dungeonEntry = sLFGDungeonStore.LookupEntry(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 6d767b6a064..080a3acea56 100644
--- a/src/server/game/Handlers/PetHandler.cpp
+++ b/src/server/game/Handlers/PetHandler.cpp
@@ -529,7 +529,7 @@ void WorldSession::HandlePetSetAction(WorldPacket& recvData)
if (controlled->GetEntry() == pet->GetEntry() && controlled->IsAlive())
pets.push_back(controlled);
- for (Unit* pet : pets)
+ for (Unit* petControlled : pets)
{
// check swap (at command->spell swap client remove spell first in another packet, so check only command move correctness)
if (move_command)
@@ -564,28 +564,28 @@ void WorldSession::HandlePetSetAction(WorldPacket& recvData)
_player->GetName().c_str(), position[i], spell_id, uint32(act_state));
//if it's act for spell (en/disable/cast) and there is a spell given (0 = remove spell) which pet doesn't know, don't add
- if (!((act_state == ACT_ENABLED || act_state == ACT_DISABLED || act_state == ACT_PASSIVE) && spell_id && !pet->HasSpell(spell_id)))
+ if (!((act_state == ACT_ENABLED || act_state == ACT_DISABLED || act_state == ACT_PASSIVE) && spell_id && !petControlled->HasSpell(spell_id)))
{
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id))
{
//sign for autocast
if (act_state == ACT_ENABLED)
{
- if (pet->GetTypeId() == TYPEID_UNIT && pet->IsPet())
- ((Pet*)pet)->ToggleAutocast(spellInfo, true);
+ if (petControlled->GetTypeId() == TYPEID_UNIT && petControlled->IsPet())
+ ((Pet*)petControlled)->ToggleAutocast(spellInfo, true);
else
for (Unit::ControlList::iterator itr = GetPlayer()->m_Controlled.begin(); itr != GetPlayer()->m_Controlled.end(); ++itr)
- if ((*itr)->GetEntry() == pet->GetEntry())
+ if ((*itr)->GetEntry() == petControlled->GetEntry())
(*itr)->GetCharmInfo()->ToggleCreatureAutocast(spellInfo, true);
}
//sign for no/turn off autocast
else if (act_state == ACT_DISABLED)
{
- if (pet->GetTypeId() == TYPEID_UNIT && pet->IsPet())
- ((Pet*)pet)->ToggleAutocast(spellInfo, false);
+ if (petControlled->GetTypeId() == TYPEID_UNIT && petControlled->IsPet())
+ ((Pet*)petControlled)->ToggleAutocast(spellInfo, false);
else
for (Unit::ControlList::iterator itr = GetPlayer()->m_Controlled.begin(); itr != GetPlayer()->m_Controlled.end(); ++itr)
- if ((*itr)->GetEntry() == pet->GetEntry())
+ if ((*itr)->GetEntry() == petControlled->GetEntry())
(*itr)->GetCharmInfo()->ToggleCreatureAutocast(spellInfo, false);
}
}
@@ -740,23 +740,23 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
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(spellid) || !spellInfo->IsAutocastable())
+ if (!petControlled->HasSpell(spellid) || !spellInfo->IsAutocastable())
return;
- CharmInfo* charmInfo = pet->GetCharmInfo();
+ CharmInfo* charmInfo = petControlled->GetCharmInfo();
if (!charmInfo)
{
- TC_LOG_ERROR("entities.pet", "WorldSession::HandlePetSpellAutocastOpcod: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUID().GetCounter(), pet->GetTypeId());
+ TC_LOG_ERROR("entities.pet", "WorldSession::HandlePetSpellAutocastOpcod: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", petControlled->GetGUID().GetCounter(), petControlled->GetTypeId());
return;
}
- if (pet->IsPet())
- ((Pet*)pet)->ToggleAutocast(spellInfo, state != 0);
+ if (petControlled->IsPet())
+ ((Pet*)petControlled)->ToggleAutocast(spellInfo, state != 0);
else
- pet->GetCharmInfo()->ToggleCreatureAutocast(spellInfo, state != 0);
+ petControlled->GetCharmInfo()->ToggleCreatureAutocast(spellInfo, state != 0);
charmInfo->SetSpellAutocast(spellInfo, state != 0);
}
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 096359d1f20..3e0a5e0d988 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -7456,12 +7456,12 @@ void Spell::HandleLaunchPhase()
if (usesAmmo && !ammoTaken)
{
- for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
{
- if (!(mask & 1 << i))
+ if (!(mask & 1 << j))
continue;
- switch (m_spellInfo->Effects[i].Effect)
+ switch (m_spellInfo->Effects[j].Effect)
{
case SPELL_EFFECT_SCHOOL_DAMAGE:
case SPELL_EFFECT_WEAPON_DAMAGE:
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index d6692a4b37e..a70a0f376ce 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -526,7 +526,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);
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 046704e2057..f0b443955e1 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -311,11 +311,11 @@ class spell_pal_avenging_wrath : public SpellScriptLoader
void HandleApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
- if (AuraEffect const* aurEff = target->GetAuraEffectOfRankedSpell(SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1, EFFECT_2))
+ if (AuraEffect const* sanctifiedWrathAurEff = target->GetAuraEffectOfRankedSpell(SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1, EFFECT_2))
{
- CastSpellExtraArgs args(aurEff);
- args.AddSpellMod(SPELLVALUE_BASE_POINT0, aurEff->GetAmount())
- .AddSpellMod(SPELLVALUE_BASE_POINT1, aurEff->GetAmount());
+ CastSpellExtraArgs args(sanctifiedWrathAurEff);
+ args.AddSpellMod(SPELLVALUE_BASE_POINT0, sanctifiedWrathAurEff->GetAmount())
+ .AddSpellMod(SPELLVALUE_BASE_POINT1, sanctifiedWrathAurEff->GetAmount());
target->CastSpell(target, SPELL_PALADIN_SANCTIFIED_WRATH, args);
}