Core/Misc: added more fallthrough attributes and added some missing breaks reported by CI
This commit is contained in:
1 parent
52d9bb2538
commit
e1d74d4dc6
25 files changed
+31
-20
No files matched your search
@@ -2178,8 +2178,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_RANDOM_SOUND: target: %s (%s), sound: %u, onlyself: %s",
|
||||
target->GetName().c_str(), target->GetGUID().ToString().c_str(), sound, onlySelf ? "true" : "false");
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_CORPSE_DELAY:
|
||||
{
|
||||
|
||||
@@ -2894,6 +2894,7 @@ bool AchievementMgr<T>::AdditionalRequirementsSatisfied(AchievementCriteriaEntry
|
||||
case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HAS_AURA: // 10
|
||||
if (!unit || !unit->HasAura(reqValue))
|
||||
return false;
|
||||
break;
|
||||
case ACHIEVEMENT_CRITERIA_ADDITIONAL_CONDITION_TARGET_HAS_AURA_TYPE: // 11
|
||||
if (!unit || !unit->HasAuraType(AuraType(reqValue)))
|
||||
return false;
|
||||
|
||||
@@ -1075,14 +1075,14 @@ void TolBaradCapturePoint::ChangeTeam(TeamId /*oldTeam*/)
|
||||
break;
|
||||
case BF_CAPTUREPOINT_OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE:
|
||||
m_Bf->SendWarning(TBCapturePoints[iBase].textLost[TEAM_HORDE]);
|
||||
//no break here!
|
||||
[[fallthrough]];
|
||||
case BF_CAPTUREPOINT_OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
|
||||
SendUpdateWorldState(TBCapturePoints[iBase].wsCapturing[TEAM_ALLIANCE], uint32(1));
|
||||
GetCapturePointGo()->SetGoArtKit(TB_GO_ARTKIT_FLAG_NONE);
|
||||
break;
|
||||
case BF_CAPTUREPOINT_OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE:
|
||||
m_Bf->SendWarning(TBCapturePoints[iBase].textLost[TEAM_ALLIANCE]);
|
||||
//no break here!
|
||||
[[fallthrough]];
|
||||
case BF_CAPTUREPOINT_OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
|
||||
SendUpdateWorldState(TBCapturePoints[iBase].wsCapturing[TEAM_HORDE], uint32(1));
|
||||
GetCapturePointGo()->SetGoArtKit(TB_GO_ARTKIT_FLAG_NONE);
|
||||
|
||||
@@ -762,15 +762,12 @@ void BattlefieldWG::DoCompleteOrIncrementAchievement(uint32 achievement, Player*
|
||||
switch (achievement)
|
||||
{
|
||||
case ACHIEVEMENTS_WIN_WG_100:
|
||||
{
|
||||
// player->UpdateAchievementCriteria();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
if (player)
|
||||
player->CompletedAchievement(achievementEntry);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -670,6 +670,7 @@ bool LinkExtractor::IsValidMessage()
|
||||
case 'r':
|
||||
if (link)
|
||||
link->SetBounds(startPos, _iss.tellg());
|
||||
break;
|
||||
case '|':
|
||||
// no further payload
|
||||
break;
|
||||
|
||||
@@ -535,7 +535,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
|
||||
joinData.result = LFG_JOIN_DUNGEON_INVALID;
|
||||
else
|
||||
rDungeonId = (*dungeons.begin());
|
||||
/* fallthrough - Random can only be dungeon or heroic dungeon */
|
||||
[[fallthrough]];
|
||||
case LFG_TYPE_HEROIC:
|
||||
case LFG_TYPE_DUNGEON:
|
||||
if (isRaid)
|
||||
|
||||
@@ -857,6 +857,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
{
|
||||
SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)));
|
||||
SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)));
|
||||
break;
|
||||
}
|
||||
case HUNTER_PET:
|
||||
{
|
||||
|
||||
@@ -7131,7 +7131,7 @@ float Unit::GetUnitSpellCriticalChance(Unit* victim, SpellInfo const* spellProto
|
||||
default:
|
||||
return 0.0f;
|
||||
}
|
||||
// Do not add a break here, case fallthrough is intentional! Adding a break will make above spells unable to crit.
|
||||
[[fallthrough]]; // fallthrough is intentional! Adding a break will make above spells unable to crit.
|
||||
case SPELL_DAMAGE_CLASS_MAGIC:
|
||||
{
|
||||
if (schoolMask & SPELL_SCHOOL_MASK_NORMAL)
|
||||
@@ -7307,7 +7307,7 @@ float Unit::GetUnitSpellCriticalChance(Unit* victim, SpellInfo const* spellProto
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* fallthrough - Calculate critical strike chance for both Ranged and Melee spells*/
|
||||
[[fallthrough]]; // fallthrough - Calculate critical strike chance for both Ranged and Melee spells
|
||||
case SPELL_DAMAGE_CLASS_RANGED:
|
||||
{
|
||||
if (victim)
|
||||
|
||||
@@ -157,6 +157,7 @@ Object* ObjectAccessor::GetObjectByTypeMask(WorldObject const& p, ObjectGuid con
|
||||
case HighGuid::AreaTrigger:
|
||||
if (typemask & TYPEMASK_AREATRIGGER)
|
||||
return GetAreaTrigger(p, guid);
|
||||
break;
|
||||
case HighGuid::Corpse:
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -991,8 +991,9 @@ void AuraEffect::UpdatePeriodic(Unit* caster)
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
default:
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
GetBase()->CallScriptEffectUpdatePeriodicHandlers(this);
|
||||
|
||||
@@ -5954,7 +5954,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
|
||||
case SUMMON_CATEGORY_PET:
|
||||
if (!m_spellInfo->HasAttribute(SPELL_ATTR1_DISMISS_PET) && m_caster->GetPetGUID())
|
||||
return SPELL_FAILED_ALREADY_HAVE_SUMMON;
|
||||
/* fallthrough - check both GetPetGUID() and GetCharmGUID for SUMMON_CATEGORY_PET*/
|
||||
[[fallthrough]]; // check both GetPetGUID() and GetCharmGUID for SUMMON_CATEGORY_PET*/
|
||||
case SUMMON_CATEGORY_PUPPET:
|
||||
if (m_caster->GetCharmGUID())
|
||||
return SPELL_FAILED_ALREADY_HAVE_CHARM;
|
||||
|
||||
@@ -3859,6 +3859,7 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SPELL_AURA_PROC_TRIGGER_SPELL:
|
||||
// many positive auras have negative triggered spells at damage for example and this not make it negative (it can be canceled for example)
|
||||
break;
|
||||
|
||||
@@ -950,6 +950,7 @@ class npc_ignacious : public CreatureScript
|
||||
case EVENT_FLAME_STRIKE:
|
||||
DoCastAOE(SPELL_FLAME_STRIKE_TARGETING, true);
|
||||
_events.Repeat(20s);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -125,6 +125,7 @@ class instance_bastion_of_twilight : public InstanceMapScript
|
||||
case NPC_TIME_WARDEN:
|
||||
if (Creature* halfus = GetCreature(DATA_HALFUS_WYRMBREAKER))
|
||||
halfus->AI()->JustSummoned(creature);
|
||||
[[fallthrough]];
|
||||
case NPC_ORPHANED_EMERALD_WELP:
|
||||
case NPC_SPIKE:
|
||||
_halfusEncounterGUIDs.insert(creature->GetGUID());
|
||||
|
||||
-4
@@ -60,10 +60,6 @@ class instance_blackrock_caverns : public InstanceMapScript
|
||||
if (state == DONE)
|
||||
if (Creature* raz = GetCreature(DATA_RAZ_THE_CRAZED))
|
||||
raz->AI()->DoAction(ACTION_BREAK_OUT_OF_PRISON);
|
||||
case DATA_CORLA_HERALD_OF_TWILIGHT:
|
||||
case DATA_KARSH_STEELBENDER:
|
||||
case DATA_BEAUTY:
|
||||
case DATA_ASCENDANT_LORD_OBSIDIUS:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -324,6 +324,7 @@ struct boss_magmaw : public BossAI
|
||||
return _pincer1->GetGUID();
|
||||
else if (_pincer2->GetVehicleKit() && _pincer2->GetVehicleKit()->GetAvailableSeatCount())
|
||||
return _pincer2->GetGUID();
|
||||
break;
|
||||
default:
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
+1
@@ -1121,6 +1121,7 @@ struct npc_nefarians_end_lord_victor_nefarius : public PassiveAI
|
||||
stalker->CastSpell(stalker, SPELL_INTRO_1_TRANSFORM_VISUAL);
|
||||
stalker->DespawnOrUnsummon(2s + 400ms);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -179,6 +179,7 @@ public:
|
||||
me->StopMoving();
|
||||
me->SetFacingToObject(summon);
|
||||
DoCast(summon, SPELL_SHIELD_OF_THE_PERFIDIOUS);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -330,6 +330,7 @@ class instance_throne_of_the_tides : public InstanceMapScript
|
||||
case GO_DOODAD_ABYSSAL_CORAL_CHUNK_CEILING:
|
||||
if (_eventIndex == EVENT_INDEX_ULTHOK_ARRIVED)
|
||||
go->DespawnOrUnsummon();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -231,6 +231,7 @@ class instance_throne_of_the_four_winds : public InstanceMapScript
|
||||
vehicle->DespawnOrUnsummon(0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -562,7 +562,9 @@ public:
|
||||
Spark->DisappearAndDie();
|
||||
DespawnNagaFlag(false);
|
||||
me->DisappearAndDie();
|
||||
default: return 99999999;
|
||||
return 99999999;
|
||||
default:
|
||||
return 99999999;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -125,8 +125,9 @@ class boss_prince_taldaram : public CreatureScript
|
||||
case NPC_FLAME_SPHERE_2:
|
||||
case NPC_FLAME_SPHERE_3:
|
||||
summon->AI()->SetGUID(_flameSphereTargetGUID);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ class boss_kologarn : public CreatureScript
|
||||
break;
|
||||
case NPC_RUBBLE:
|
||||
summons.Summon(summon);
|
||||
// absence of break intended
|
||||
[[fallthrough]];
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2970,6 +2970,7 @@ class spell_gen_replenishment : public SpellScriptLoader
|
||||
case SPELL_REPLENISHMENT:
|
||||
case SPELL_INFINITE_REPLENISHMENT:
|
||||
amount = CalculatePct(GetUnitOwner()->GetMaxPower(POWER_MANA), 0.1f);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -257,6 +257,7 @@ void HandleArgs(int argc, char* arg[])
|
||||
}
|
||||
else
|
||||
Usage(arg[0]);
|
||||
break;
|
||||
case 'f':
|
||||
if (c + 1 < argc) // all ok
|
||||
CONF_allow_float_to_int = atoi(arg[c++ + 1])!=0;
|
||||
|
||||
Reference in new issue
Block a user