From 50f122de778bca324d0f4c81f1e8eb30b90a7314 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Wed, 3 Apr 2019 23:36:26 -0300 Subject: Core/Misc: Warning fixes (/W4) (#23149) * Core/Misc: Warning fixes (/W4) --- src/server/scripts/Commands/cs_account.cpp | 10 +++++++++- src/server/scripts/Spells/spell_paladin.cpp | 8 ++++---- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src/server/scripts') 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); } -- cgit v1.2.3