Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore (core): Workflow warning fixes #174

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/server/game/Globals/ObjectMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3246,7 +3246,7 @@ void ObjectMgr::LoadMailServerTemplates()

if (servMail.moneyA > MAX_MONEY_AMOUNT || servMail.moneyH > MAX_MONEY_AMOUNT)
{
LOG_ERROR("sql.sql", "Table `mail_server_template` has moneyA %u or moneyH %u larger than MAX_MONEY_AMOUNT %u for id %u, skipped.", servMail.moneyA, servMail.moneyH, MAX_MONEY_AMOUNT,
LOG_ERROR("sql.sql", "Table `mail_server_template` has moneyA %u or moneyH %u larger than MAX_MONEY_AMOUNT %lu for id %u, skipped.", servMail.moneyA, servMail.moneyH, MAX_MONEY_AMOUNT,
servMail.id);
return;
}
Expand Down
56 changes: 28 additions & 28 deletions src/server/game/Spells/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7767,43 +7767,43 @@ void Spell::DoEffectOnLaunchTarget(TargetInfo& targetInfo, float multiplier, uin
}();

if (triggerCombat)
m_originalCaster->SetInCombatWith(unit);

m_damage = 0;
m_healing = 0;
{m_originalCaster->SetInCombatWith(unit);
acidmanifesto marked this conversation as resolved.
Show resolved Hide resolved
}
m_damage = 0;
m_healing = 0;

HandleEffects(unit, nullptr, nullptr, nullptr, effIndex, SPELL_EFFECT_HANDLE_LAUNCH_TARGET);
if (m_damage > 0)
HandleEffects(unit, nullptr, nullptr, nullptr, effIndex, SPELL_EFFECT_HANDLE_LAUNCH_TARGET);
if (m_damage > 0)
{
if (m_spellInfo->Effects[effIndex].IsTargetingArea() || m_spellInfo->Effects[effIndex].IsAreaAuraEffect() || m_spellInfo->Effects[effIndex].IsEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA))
{
if (m_spellInfo->Effects[effIndex].IsTargetingArea() || m_spellInfo->Effects[effIndex].IsAreaAuraEffect() || m_spellInfo->Effects[effIndex].IsEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA))
{
m_damage = unit->CalculateAOEAvoidance(m_damage, m_spellInfo->SchoolMask, m_caster->GetGUID());
m_damage = unit->CalculateAOEAvoidance(m_damage, m_spellInfo->SchoolMask, m_caster->GetGUID());

if (m_caster->GetTypeId() == TYPEID_PLAYER)
{
// cap damage of player AOE
uint32 targetAmount = m_UniqueTargetInfo.size();
if (targetAmount > 10)
m_damage = m_damage * 10 / targetAmount;
}
if (m_caster->GetTypeId() == TYPEID_PLAYER)
{
// cap damage of player AOE
uint32 targetAmount = m_UniqueTargetInfo.size();
if (targetAmount > 10)
m_damage = m_damage * 10 / targetAmount;
}
}
}

if (m_applyMultiplierMask & (1 << effIndex))
{
m_damage = int32(m_damage * m_damageMultipliers[effIndex]);
m_healing = int32(m_healing * m_damageMultipliers[effIndex]);
if (m_applyMultiplierMask & (1 << effIndex))
{
m_damage = int32(m_damage * m_damageMultipliers[effIndex]);
m_healing = int32(m_healing * m_damageMultipliers[effIndex]);

m_damageMultipliers[effIndex] *= multiplier;
}
m_damageMultipliers[effIndex] *= multiplier;
}

targetInfo.Damage += m_damage;
targetInfo.Healing += m_healing;
targetInfo.Damage += m_damage;
targetInfo.Healing += m_healing;

float critChance = m_spellValue->CriticalChance;
if (!critChance)
critChance = m_caster->SpellCritChanceDone(m_spellInfo, m_spellSchoolMask, m_attackType);
targetInfo.IsCrit = roll_chance_f(unit->SpellCritChanceTaken(m_caster, m_spellInfo, m_spellSchoolMask, critChance, m_attackType));
float critChance = m_spellValue->CriticalChance;
if (!critChance)
critChance = m_caster->SpellCritChanceDone(m_spellInfo, m_spellSchoolMask, m_attackType);
targetInfo.IsCrit = roll_chance_f(unit->SpellCritChanceTaken(m_caster, m_spellInfo, m_spellSchoolMask, critChance, m_attackType));
}

SpellCastResult Spell::CanOpenLock(uint32 effIndex, uint32 lockId, SkillType& skillId, int32& reqSkillValue, int32& skillValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ struct boss_dw_spine : public BossAI
std::list<Creature*> creatureList;
GetCreatureListWithEntryInGrid(creatureList, me, NPC_HIDEOUS_AMALGAMATION, 200.0f);
for (Creature* crea : creatureList)
crea->GetMotionMaster()->MoveJump(-13875.01f, -13769.59f, 285.1783f, 15.0f, 20.0f);
crea->GetMotionMaster()->MoveJump(-13875.01f, -13769.59f, 285.1783f, 15.0f, 20.0f, 30.0f);
}

void Reset() override
Expand Down Expand Up @@ -206,7 +206,7 @@ struct boss_dw_spine : public BossAI
RemoveEncounterFrame();
}

void MoveInLineOfSight(Unit* victim)
void MoveInLineOfSight(Unit* victim) override
{
if (victim->GetTypeId() != TYPEID_PLAYER)
return;
Expand Down Expand Up @@ -306,7 +306,7 @@ struct boss_dw_spine : public BossAI
BossAI::JustEnteredCombat(victim);
}

void UpdateAI(uint32 const diff)
void UpdateAI(uint32 const diff) override
{
events.Update(diff);

Expand Down Expand Up @@ -391,7 +391,7 @@ struct npc_corruption : public ScriptedAI
isUnactive = false;
}

void JustDied(Unit* killer) override
void JustDied(Unit* /* killer*/) override
{
Creature* spawner = me->FindNearestCreature(NPC_DW_SPINE_SPAWNER, 5.0f);
if (!spawner)
Expand Down Expand Up @@ -420,7 +420,7 @@ struct npc_corruption : public ScriptedAI
}
}

void DamageTaken(Unit* attacker, uint32& damage)
void DamageTaken(Unit* /*attacker*/, uint32& damage) override
{
if (me->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
if ((damageTaken += damage) > CalculatePct(me->GetMaxHealth(), 20))
Expand All @@ -443,7 +443,7 @@ struct npc_corruption : public ScriptedAI
}
}

void UpdateAI(uint32 const diff) override
void UpdateAI(uint32 const /*diff*/) override
{
if (!me->IsVisible() || !UpdateVictim() || isUnactive)
return;
Expand Down Expand Up @@ -494,13 +494,13 @@ struct npc_hideous_amalgamation : public ScriptedAI
events.ScheduleEvent(EVENT_BLOOD_CORRUPTION, 30000);
}

void JustDied(Unit* killer) override
void JustDied(Unit* /*killer*/) override
{
if (IsHeroic())
DoCast(me, SPELL_DEGRADATION, true);
}

void DamageTaken(Unit* attacker, uint32& damage) override
void DamageTaken(Unit* /*attacker*/, uint32& damage) override
{
if (me->HealthBelowPctDamaged(1, damage))
{
Expand Down Expand Up @@ -558,13 +558,13 @@ struct npc_corrupted_blood : public ScriptedAI
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
}

void IsSummonedBy(Unit* /*summoner*/)
void IsSummonedBy(Unit* /*summoner*/) override
{
DoCast(SPELL_DECREASE_CRIT);
canExplode = true;
}

void DamageTaken(Unit* attacker, uint32& damage) override
void DamageTaken(Unit* /*attacker*/, uint32& damage) override
{
if (!canExplode)
{
Expand All @@ -591,7 +591,7 @@ struct npc_corrupted_blood : public ScriptedAI
}
}

void MovementInform(uint32 type, uint32 id)
void MovementInform(uint32 type, uint32 id) override
{
if (type == POINT_MOTION_TYPE && id == POINT_SPAWNER)
{
Expand Down Expand Up @@ -622,7 +622,7 @@ struct npc_burning_tendon : public ScriptedAI
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
}

void JustDied(Unit* killer) override
void JustDied(Unit* /*killer*/) override
{
if (GameObject* backplate = instance->GetGameObject(DATA_DW_SPINE_BACKPLATE_1 + instance->GetData(DATA_DW_SPINE_BACKPLATE_CNT)))
{
Expand Down Expand Up @@ -697,7 +697,7 @@ struct npc_spine_spawner : public ScriptedAI
me->SetInCombatWithZone();
}

ObjectGuid GetGUID(int32 type = 0) const override { return corruptionGUID; }
ObjectGuid GetGUID(int32 /*type*/ = 0) const override { return corruptionGUID; }

private:
SummonList summons;
Expand Down Expand Up @@ -747,15 +747,15 @@ class spell_absorb_blood : public SpellScript
class spell_absorb_blood_aura : public AuraScript
{

bool Validate(SpellInfo const* /*spellInfo*/)
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_SUPERHEATED_NUCLEUS))
return false;

return true;
}

void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes mode)
void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetStackAmount() == 9)
{
Expand Down Expand Up @@ -802,7 +802,7 @@ class spell_nuclear_blast : public SpellScript
class spell_nuclear_blast_triggered : public SpellScript
{

bool Validate(SpellInfo const* /*spellInfo*/)
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_SEAL_ARMOR_BREACH_L) || !sSpellMgr->GetSpellInfo(SPELL_SEAL_ARMOR_BREACH_R))
return false;
Expand Down Expand Up @@ -855,7 +855,7 @@ class spell_nuclear_blast_triggered : public SpellScript
class spell_dw_spine_roll_control : public SpellScript
{

bool Validate(SpellInfo const* /*spellInfo*/)
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_ROLL_CONTROL_ROLL))
return false;
Expand Down Expand Up @@ -946,7 +946,7 @@ class spell_dw_spine_roll_control_roll : public SpellScript
{ return target->ToUnit()->HasAura(graspingTendris) || target->ToUnit()->HasAura(fieryGrip) || target->ToUnit()->HasAura(SPELL_ROLL_CONTROL_AURA); });

for (auto target : targets)
target->ToUnit()->GetMotionMaster()->MoveJump(-13875.01f, -13769.59f, 285.1783f, 15.0f, 20.0f);
target->ToUnit()->GetMotionMaster()->MoveJump(-13875.01f, -13769.59f, 285.1783f, 15.0f, 20.0f, 30.0f);
}

void Register() override { OnObjectAreaTargetSelect.Register(&spell_dw_spine_roll_control_roll::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); }
Expand All @@ -956,7 +956,7 @@ class spell_dw_spine_roll_control_roll : public SpellScript
class spell_roll_control_aura : public AuraScript
{

void Remove(AuraEffect const* aurEff, AuraEffectHandleModes mode) { Unit::Kill(GetTarget(), GetTarget()); }
void Remove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Unit::Kill(GetTarget(), GetTarget()); }

void Register() override { OnEffectRemove.Register(&spell_roll_control_aura::Remove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); }
};
Expand All @@ -965,7 +965,7 @@ class spell_roll_control_aura : public AuraScript
class spell_seal_armor_breach : public AuraScript
{

void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes mode)
void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetCaster()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_IMMUNE_TO_PC);
GetCaster()->ToCreature()->AI()->RemoveEncounterFrame();
Expand All @@ -985,15 +985,15 @@ class spell_seal_armor_breach : public AuraScript
class spell_blood_corruption_aura : public AuraScript
{

bool Validate(SpellInfo const* spellInfo) override
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_BLOOD_OF_NELTHARION) || !sSpellMgr->GetSpellInfo(SPELL_BLOOD_OF_DEATHWING))
return false;

return true;
}

void Dispel(DispelInfo* dispelInfo)
void Dispel(DispelInfo* /*dispelInfo*/)
{
// Blood Corruption: Death generally must be dispelled 3-4 times before it turns into Blood Corruption: Earth
uint32 aura = SPELL_BLOOD_CORRUPTION_DEATH;
Expand All @@ -1007,7 +1007,7 @@ class spell_blood_corruption_aura : public AuraScript
GetOwner()->ToUnit()->CastSpell(GetCaster(), (GetId() == SPELL_BLOOD_CORRUPTION_EARTH) ? GetId() : aura, args);
}

void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes mode)
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() != AuraRemoveFlags::ByEnemySpell)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ struct boss_morchok : public BossAI
BossAI::JustEnteredCombat(victim);
}

void JustDied(Unit* killer) override
void JustDied(Unit* /*killer*/) override
{
RemoveFragments(true);
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
Expand Down Expand Up @@ -458,7 +458,7 @@ struct boss_kohcrom : public ScriptedAI
me->SetObjectScale(std::max((me->GetHealthPct() / 100), 0.10f));
}

void JustEnteredCombat(Unit* victim) override
void JustEnteredCombat(Unit* /*victim*/) override
{
crystalCount = 0;
Talk(TALK_AGGRO);
Expand All @@ -473,7 +473,7 @@ struct boss_kohcrom : public ScriptedAI
}
}

void JustDied(Unit* killer) override
void JustDied(Unit* /*killer*/) override
{
RemoveFragments();
summons.DespawnAll();
Expand Down Expand Up @@ -614,7 +614,7 @@ struct npc_ds_earthen_vortex_vehicle : public PassiveAI
public:
EjectPassengerEvent(Creature* owner) : _owner(owner) {}

bool Execute(uint64 execTime, uint32 /*diff*/)
bool Execute(uint64 /*execTime*/, uint32 /*diff*/)
{
if (Vehicle* veh = _owner->GetVehicleKit())
veh->RemoveAllPassengers();
Expand Down Expand Up @@ -842,7 +842,7 @@ class spell_ds_falling_fragments_periodic : public AuraScript
return true;
}

void HandleTriggerSpell(AuraEffect const* aurEff)
void HandleTriggerSpell(AuraEffect const* /*aurEff*/)
{
uint8 maxAttemps = 0;
while (maxAttemps < 20)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ struct boss_yorsahj : public BossAI

void JustSummoned(Creature* summon) override { summons.Summon(summon); }

void SummonedCreatureDespawn(Creature* summon)
void SummonedCreatureDespawn(Creature* summon) override
{
if (summon->GetEntry() == NPC_FORGOTTEN_ONE)
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_FIXATE);
Expand Down Expand Up @@ -551,7 +551,7 @@ struct npc_chosen_one : public ScriptedAI
me->DespawnOrUnsummon();
}

void SetGUID(ObjectGuid const& guid, int32 id)
void SetGUID(ObjectGuid const& guid, int32 id) override
{
if (id == ACTION_CHOISE_TARGET)
_targetGUID.Set(guid);
Expand Down Expand Up @@ -593,7 +593,7 @@ struct npc_mana_void : public ScriptedAI
events.ScheduleEvent(EVENT_ACTIVATE_MINION, 4000);
}

void SetData(uint32 type, uint32 value)
void SetData(uint32 type, uint32 value) override
{
if (type == DATA_RESTORED_MANA)
manaLeeched += value;
Expand Down Expand Up @@ -726,7 +726,7 @@ class spell_deep_corruption : public AuraScript
class spell_mana_diffusion : public SpellScript
{

bool Load()
bool Load() override
{
_targets = 0;
return GetCaster()->ToCreature();
Expand Down Expand Up @@ -782,7 +782,7 @@ class spell_searing_blood : public SpellScript
class spell_fusing_vapors : public AuraScript
{

bool Load()
bool Load() override
{
wasTriggered = false;
return true;
Expand Down
Loading