diff --git a/src/server/game/Server/WorldPacket.h b/src/server/game/Server/WorldPacket.h index b8d55271c5..c8bbced95d 100644 --- a/src/server/game/Server/WorldPacket.h +++ b/src/server/game/Server/WorldPacket.h @@ -30,22 +30,22 @@ class WorldPacket : public ByteBuffer { public: // just container for later use - WorldPacket() : ByteBuffer(0), m_opcode(UNKNOWN_OPCODE), _connection(CONNECTION_TYPE_DEFAULT) + WorldPacket() : ByteBuffer(0), m_opcode(UNKNOWN_OPCODE), _connection(CONNECTION_TYPE_DEFAULT), _compressionStream(nullptr) { } WorldPacket(uint16 opcode, size_t res = 200, ConnectionType connection = CONNECTION_TYPE_DEFAULT) : ByteBuffer(res), - m_opcode(opcode), _connection(connection) { } + m_opcode(opcode), _connection(connection), _compressionStream(nullptr) { } - WorldPacket(WorldPacket&& packet) : ByteBuffer(std::move(packet)), m_opcode(packet.m_opcode), _connection(packet._connection) + WorldPacket(WorldPacket&& packet) : ByteBuffer(std::move(packet)), m_opcode(packet.m_opcode), _connection(packet._connection), _compressionStream(nullptr) { } - WorldPacket(WorldPacket&& packet, std::chrono::steady_clock::time_point receivedTime) : ByteBuffer(std::move(packet)), m_opcode(packet.m_opcode), m_receivedTime(receivedTime), _connection(packet._connection) + WorldPacket(WorldPacket&& packet, std::chrono::steady_clock::time_point receivedTime) : ByteBuffer(std::move(packet)), m_opcode(packet.m_opcode), m_receivedTime(receivedTime), _connection(packet._connection), _compressionStream(nullptr) { } - WorldPacket(WorldPacket const& right) : ByteBuffer(right), m_opcode(right.m_opcode), _connection(right._connection) + WorldPacket(WorldPacket const& right) : ByteBuffer(right), m_opcode(right.m_opcode), _connection(right._connection), _compressionStream(nullptr) { } @@ -73,7 +73,9 @@ class WorldPacket : public ByteBuffer return *this; } - WorldPacket(uint16 opcode, MessageBuffer&& buffer, ConnectionType connection) : ByteBuffer(std::move(buffer)), m_opcode(opcode), _connection(connection) { } + WorldPacket(uint16 opcode, MessageBuffer&& buffer, ConnectionType connection) : ByteBuffer(std::move(buffer)), m_opcode(opcode), _connection(connection), _compressionStream(nullptr) + { + } void Initialize(uint16 opcode, size_t newres = 200, ConnectionType connection = CONNECTION_TYPE_DEFAULT) { diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 279aafe5e4..b75c1213ba 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -54,6 +54,7 @@ #include "World.h" #include "WorldPacket.h" #include "WorldSocket.h" +#include #include namespace { diff --git a/src/server/scripts/Pet/pet_mage.cpp b/src/server/scripts/Pet/pet_mage.cpp index 15fc5fb3ca..286a26c5b6 100644 --- a/src/server/scripts/Pet/pet_mage.cpp +++ b/src/server/scripts/Pet/pet_mage.cpp @@ -105,7 +105,7 @@ struct npc_pet_mage_mirror_image : ScriptedAI } } - void SpellHit(Unit* caster, SpellInfo const* spell) override + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override { if (spell->Id == SPELL_INITIALIZE_IMAGES) { diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 886bd587c5..c43dbfc0a8 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -1200,7 +1200,7 @@ class spell_dk_runic_empowerment : public AuraScript return false; } - void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) { PreventDefaultAction(); @@ -1238,6 +1238,8 @@ class spell_dk_runic_empowerment : public AuraScript case RUNE_UNHOLY: player->CastSpell(player, SPELL_DK_ENERGIZE_UNHOLY_RUNE, true, nullptr, aurEff); break; + default: + break; } } } diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 57e89fd559..155bc69643 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -557,8 +557,6 @@ class spell_dru_innervate : public AuraScript if (!mana) return; - uint8 ticks = aurEff->GetTotalTicks(); - // Regenerate 5% of maximum mana uint8 percentage = 5; @@ -576,7 +574,7 @@ class spell_dru_innervate : public AuraScript else { // Glyph of Innervate - if (AuraEffect* glyph = caster->GetDummyAuraEffect(SPELLFAMILY_DRUID, SPELL_ICON_ID_GLYPH_OF_INNERVATE, EFFECT_0)) + if (caster->GetDummyAuraEffect(SPELLFAMILY_DRUID, SPELL_ICON_ID_GLYPH_OF_INNERVATE, EFFECT_0)) caster->CastSpell(caster, SPELL_DRUID_INNERVATE_TRIGGERED, true); } } @@ -1276,7 +1274,7 @@ class spell_dru_rejuvenation : public AuraScript } - void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* caster = GetCaster()) { @@ -1322,7 +1320,7 @@ class spell_dru_tree_of_life : public AuraScript } } - void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* target = GetTarget()) { diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index a939757618..9151cb32ac 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -4758,7 +4758,7 @@ class spell_gen_vengeance : public AuraScript && eventInfo.GetDamageInfo()->GetAttacker()->GetTypeId() != TYPEID_PLAYER; } - void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + void HandleEffectProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) { PreventDefaultAction(); Unit* caster = GetTarget(); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 757847e21d..e3d6cc7ca2 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -919,7 +919,7 @@ class spell_mage_mage_ward : public SpellScriptLoader void HandleAbsorb(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount) { - if (AuraEffect* aurEff = GetTarget()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, ICON_MAGE_INCANTER_S_ABSORPTION, EFFECT_0)) + if (AuraEffect const* aurEff = GetTarget()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, ICON_MAGE_INCANTER_S_ABSORPTION, EFFECT_0)) { int32 bp = CalculatePct(absorbAmount, aurEff->GetAmount()); GetTarget()->CastCustomSpell(GetTarget(), SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED, &bp, nullptr, nullptr, true); @@ -972,7 +972,7 @@ class spell_mage_mana_shield : public SpellScriptLoader void HandleAbsorb(AuraEffect* /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount) { - if (AuraEffect* aurEff = GetTarget()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, ICON_MAGE_INCANTER_S_ABSORPTION, EFFECT_0)) + if (AuraEffect const* aurEff = GetTarget()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, ICON_MAGE_INCANTER_S_ABSORPTION, EFFECT_0)) { int32 bp = CalculatePct(absorbAmount, aurEff->GetAmount()); GetTarget()->CastCustomSpell(GetTarget(), SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED, &bp, nullptr, nullptr, true); @@ -2032,7 +2032,7 @@ class spell_mage_deep_freeze : public SpellScript return ValidateSpellInfo({ SPELL_MAGE_DEEP_FREEZE_DAMAGE }); } - void HandleDamage(SpellEffIndex effIndex) + void HandleDamage(SpellEffIndex /*effIndex*/) { Unit* caster = GetCaster(); Unit* target = GetExplTargetUnit(); @@ -2054,7 +2054,7 @@ class spell_mage_fingers_of_frost_charges : public AuraScript { PrepareAuraScript(spell_mage_fingers_of_frost_charges); - void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) { PreventDefaultAction(); GetAura()->ModStackAmount(-1); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index ab12657979..d58a55fcea 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -134,7 +134,7 @@ class spell_pal_ardent_defender : public AuraScript amount = -1; } - void Absorb(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount) + void Absorb(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& /*absorbAmount*/) { Unit* target = GetTarget(); if (dmgInfo.GetDamage() >= target->GetHealth()) @@ -431,7 +431,6 @@ class spell_pal_divine_storm : public SpellScript void TriggerHeal() { - Unit* caster = GetCaster(); if (Unit* caster = GetCaster()) { int32 heal = CalculatePct(GetHitDamage(), GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster())); @@ -1431,7 +1430,7 @@ class spell_pal_long_arm_of_the_law : public AuraScript return false; } - void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) { PreventDefaultAction(); GetTarget()->CastSpell(GetTarget(), SPELL_PALADIN_LONG_ARM_OF_THE_LAW, true, nullptr, aurEff); @@ -1700,7 +1699,7 @@ class spell_pal_guardian_of_ancient_kings : public SpellScript { PrepareSpellScript(spell_pal_guardian_of_ancient_kings); - bool Validate(SpellInfo const* spell) override + bool Validate(SpellInfo const* /*spell*/) override { return ValidateSpellInfo( { @@ -1810,7 +1809,7 @@ class spell_pal_ancient_crusader : public AuraScript }); } - void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) { PreventDefaultAction(); if (m_scriptSpellId == SPELL_PALADIN_ANCIENT_CRUSADER_GUARDIAN) diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index ce0afdc691..59b65433e5 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -589,11 +589,9 @@ class spell_hun_pet_scaling_03 : public AuraScript { // Formular: owner resistance of targeted school * 0.4 canBeRecalculated = true; - int32 resistanceSchool = GetSpellInfo()->Effects[aurEff->GetEffIndex()].MiscValue; - if (Pet* pet = GetUnitOwner()->ToPet()) if (Player* owner = pet->GetOwner()) - amount = uint32(owner->GetResistance(SpellSchoolMask(resistanceSchool)) * 0.4); + amount = uint32(owner->GetResistance(SpellSchoolMask(GetSpellInfo()->Effects[aurEff->GetEffIndex()].MiscValue)) * 0.4); } void CalculateArmorAmount(AuraEffect const* aurEff, int32& amount, bool& canBeRecalculated) diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index a3826cd3c1..812b8ce9e3 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -414,7 +414,7 @@ class spell_pri_guardian_spirit : public AuraScript return true; } - void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated) + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { amount = -1; } @@ -1124,7 +1124,7 @@ class spell_pri_chakra : public AuraScript { PrepareAuraScript(spell_pri_chakra); - bool Validate(SpellInfo const* spellInfo) override + bool Validate(SpellInfo const* /*spellInfo*/) override { return ValidateSpellInfo( { @@ -1152,7 +1152,6 @@ class spell_pri_chakra : public AuraScript PreventDefaultAction(); Unit* caster = eventInfo.GetActor(); - uint32 spellId = 0; if (SpellInfo const* spell = eventInfo.GetSpellInfo()) { // Chakra: Serenity @@ -1193,12 +1192,12 @@ class spell_pri_chakra_sanctuary : public AuraScript { PrepareAuraScript(spell_pri_chakra_sanctuary); - bool Validate(SpellInfo const* spellInfo) override + bool Validate(SpellInfo const* /*spellInfo*/) override { return ValidateSpellInfo({ SPELL_PRIEST_CHAKRA_SANCTUARY_LINKED }); } - void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { GetTarget()->RemoveAurasDueToSpell(SPELL_PRIEST_CHAKRA_SANCTUARY_LINKED); } @@ -1597,7 +1596,7 @@ class spell_pri_spirit_of_redemption : public AuraScript return ValidateSpellInfo({ SPELL_PRIEST_SPIRIT_OF_REDEMPTION_TRIGGERED }); } - void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated) + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { amount = -1; } diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 28c6633e9b..31352c248c 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -1009,7 +1009,7 @@ class spell_sha_mana_tide_totem : public SpellScriptLoader { PrepareAuraScript(spell_sha_mana_tide_totem_AuraScript); - void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) { // @TODO: Exclude the "short term" buffs from the stat value if (Unit* caster = GetUnitOwner()) @@ -1111,7 +1111,7 @@ class spell_sha_rolling_thunder : public AuraScript aura->RefreshDuration(); // Fulmination visual - if (AuraEffect const* fulAurEff = target->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, SHAMAN_ICON_ID_FULMINATION, EFFECT_0)) + if (target->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, SHAMAN_ICON_ID_FULMINATION, EFFECT_0)) if (charges == aurEff->GetAmount()) target->CastSpell(GetTarget(), SPELL_SHAMAN_FULMINATION_PROC, true, nullptr, aurEff); } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 7afec21447..a7d80946fc 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -1050,7 +1050,7 @@ class spell_warl_seed_of_corruption : public AuraScript }); } - void HandleSoulburnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + void HandleSoulburnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Unit* unit = GetCaster(); Player* caster = unit->ToPlayer(); @@ -1622,7 +1622,7 @@ class spell_warl_drain_soul : public SpellScriptLoader return ValidateSpellInfo({ SPELL_WARLOCK_SOUL_SHARD_ENERGIZE }); } - void OnAuraRemoveHandler(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + void OnAuraRemoveHandler(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH) if (Unit* caster = GetCaster()) @@ -1753,13 +1753,14 @@ class spell_warl_soulburn : public AuraScript } } - void HandleSeedOfCorruptionDummyApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + void HandleSeedOfCorruptionDummyApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (AuraEffect* dummy = GetTarget()->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, WARLOCK_ICON_ID_SOULBURN_SEED_OF_CORRUPTION, EFFECT_0)) - GetTarget()->CastSpell(GetTarget(), SPELL_WARLOCK_SOULBURN_DUMMY_SEED_OF_CORRUPTION); + Unit* target = GetTarget(); + if (target->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, WARLOCK_ICON_ID_SOULBURN_SEED_OF_CORRUPTION, EFFECT_0)) + target->CastSpell(target, SPELL_WARLOCK_SOULBURN_DUMMY_SEED_OF_CORRUPTION); } - void HandleSeedOfCorruptionDummyRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + void HandleSeedOfCorruptionDummyRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { GetTarget()->RemoveAurasDueToSpell(SPELL_WARLOCK_SOULBURN_DUMMY_SEED_OF_CORRUPTION); } diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index dd0d669989..d2b794f87c 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -242,7 +242,7 @@ class spell_warr_concussion_blow : public SpellScript { PrepareSpellScript(spell_warr_concussion_blow); - void HandleDummy(SpellEffIndex effIndex) + void HandleDummy(SpellEffIndex /*effIndex*/) { SetEffectValue(CalculatePct(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetSpellInfo()->Effects[EFFECT_2].CalcValue())); } @@ -1066,7 +1066,7 @@ class spell_warr_strikes_of_opportunity : public AuraScript return ValidateSpellInfo({ SPELL_WARRIOR_OPPORTUNITY_STRIKE }); } - bool CheckProc(ProcEventInfo& eventInfo) + bool CheckProc(ProcEventInfo& /*eventInfo*/) { return roll_chance_i(GetEffect(EFFECT_0)->GetAmount()); }