diff options
| author | Peter Keresztes Schmidt <carbenium@outlook.com> | 2020-07-18 20:42:28 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-01-23 22:02:03 +0100 |
| commit | ad340466d09ae6de8adc20949f433772cb016b54 (patch) | |
| tree | 99127eb685dab4aa1aa90e79cbba958bf6dea80e /src/server/game | |
| parent | fda8a09766bf733ccf97743ea5b884c900f44c28 (diff) | |
Misc: Use [[fallthrough]] attribute instead of comment to mark intentional fallthroughs (#25054)
Related: #25006
(cherry picked from commit 85b5b842ca6c05d4e51081e6c3282940a80f3761)
Diffstat (limited to 'src/server/game')
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 1 | ||||
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Conditions/ConditionMgr.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/DungeonFinding/LFGGroupData.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/DungeonFinding/LFGMgr.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/DungeonFinding/LFGPlayerData.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Entities/GameObject/GameObject.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 1 | ||||
| -rw-r--r-- | src/server/game/Handlers/PetHandler.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Server/WorldSocket.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Spells/Auras/SpellAuras.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Spells/Spell.cpp | 8 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 2 |
16 files changed, 24 insertions, 26 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 3657667408a..874f5efd70a 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -2214,7 +2214,6 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u } break; } - /* fallthrough */ case SMART_ACTION_SET_CORPSE_DELAY: { for (WorldObject* const target : targets) diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 40167bceb31..fc8bfd7877d 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -1294,7 +1294,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry " SI64FMTD " SourceType %u Event %u Action %u has invoker cast action, but event does not provide any invoker!", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType()); return false; } - /* fallthrough */ + [[fallthrough]]; case SMART_ACTION_SELF_CAST: case SMART_ACTION_ADD_AURA: if (!IsSpellValid(e, e.action.cast.spell)) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index 38cfd65951b..9d792110c1c 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -193,7 +193,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) case AV_QUEST_A_BOSS1: case AV_QUEST_H_BOSS1: m_Team_QuestStatus[team][4] += 9; //you can turn in 10 or 1 item.. - /* fallthrough */ + [[fallthrough]]; case AV_QUEST_A_BOSS2: case AV_QUEST_H_BOSS2: m_Team_QuestStatus[team][4]++; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index cf5615ad3bf..be64e7cad27 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -734,11 +734,11 @@ bool BattlegroundSA::CanInteractWithObject(uint32 objectId) case BG_SA_TITAN_RELIC: if (GateStatus[BG_SA_ANCIENT_GATE] != BG_SA_GATE_DESTROYED || GateStatus[BG_SA_YELLOW_GATE] != BG_SA_GATE_DESTROYED) return false; - /* fallthrough */ + [[fallthrough]]; case BG_SA_CENTRAL_FLAG: if (GateStatus[BG_SA_RED_GATE] != BG_SA_GATE_DESTROYED && GateStatus[BG_SA_PURPLE_GATE] != BG_SA_GATE_DESTROYED) return false; - /* fallthrough */ + [[fallthrough]]; case BG_SA_LEFT_FLAG: case BG_SA_RIGHT_FLAG: if (GateStatus[BG_SA_GREEN_GATE] != BG_SA_GATE_DESTROYED && GateStatus[BG_SA_BLUE_GATE] != BG_SA_GATE_DESTROYED) diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 490881071ec..929d9ec0275 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -2155,7 +2155,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const TC_LOG_ERROR("sql.sql", "%s has invalid state mask (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue2); return false; } - /* fallthrough */ + [[fallthrough]]; case CONDITION_QUESTREWARDED: case CONDITION_QUESTTAKEN: case CONDITION_QUEST_NONE: @@ -2274,7 +2274,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const case CONDITION_OBJECT_ENTRY_GUID_LEGACY: cond->ConditionType = CONDITION_OBJECT_ENTRY_GUID; cond->ConditionValue1 = Trinity::Legacy::ConvertLegacyTypeID(Trinity::Legacy::TypeID(cond->ConditionValue1)); - /* fallthrough */ + [[fallthrough]]; case CONDITION_OBJECT_ENTRY_GUID: { switch (cond->ConditionValue1) @@ -2341,7 +2341,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const case CONDITION_TYPE_MASK_LEGACY: cond->ConditionType = CONDITION_TYPE_MASK; cond->ConditionValue1 = Trinity::Legacy::ConvertLegacyTypeMask(cond->ConditionValue1); - /* fallthrough */ + [[fallthrough]]; case CONDITION_TYPE_MASK: { if (!cond->ConditionValue1 || (cond->ConditionValue1 & ~(TYPEMASK_UNIT | TYPEMASK_PLAYER | TYPEMASK_GAMEOBJECT | TYPEMASK_CORPSE))) diff --git a/src/server/game/DungeonFinding/LFGGroupData.cpp b/src/server/game/DungeonFinding/LFGGroupData.cpp index b1386a43c80..181ce3e081a 100644 --- a/src/server/game/DungeonFinding/LFGGroupData.cpp +++ b/src/server/game/DungeonFinding/LFGGroupData.cpp @@ -40,11 +40,11 @@ void LfgGroupData::SetState(LfgState state) case LFG_STATE_NONE: m_Dungeon = 0; m_KicksLeft = LFG_GROUP_MAX_KICKS; - /* fallthrough */ + [[fallthrough]]; case LFG_STATE_FINISHED_DUNGEON: case LFG_STATE_DUNGEON: m_OldState = state; - /* fallthrough */ + [[fallthrough]]; default: m_State = state; } diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 910ebd630fb..eac62425c51 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -491,7 +491,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons) joinData.result = LFG_JOIN_INVALID_SLOT; else rDungeonId = (*dungeons.begin()); - /* fallthrough - Random can only be dungeon or heroic dungeon */ + [[fallthrough]]; // Random can only be dungeon or heroic dungeon case LFG_TYPE_HEROIC: case LFG_TYPE_DUNGEON: if (isRaid) diff --git a/src/server/game/DungeonFinding/LFGPlayerData.cpp b/src/server/game/DungeonFinding/LFGPlayerData.cpp index 18488f2890a..62e5456676d 100644 --- a/src/server/game/DungeonFinding/LFGPlayerData.cpp +++ b/src/server/game/DungeonFinding/LFGPlayerData.cpp @@ -39,10 +39,10 @@ void LfgPlayerData::SetState(LfgState state) case LFG_STATE_FINISHED_DUNGEON: m_Roles = 0; m_SelectedDungeons.clear(); - /* fallthrough */ + [[fallthrough]]; case LFG_STATE_DUNGEON: m_OldState = state; - /* fallthrough */ + [[fallthrough]]; default: m_State = state; } diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index b03bba6b4cb..192d0ecf768 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -653,8 +653,8 @@ void GameObject::Update(uint32 diff) m_lootState = GO_READY; // for other GOis same switched without delay to GO_READY break; } + [[fallthrough]]; } - /* fallthrough */ case GO_READY: { if (m_respawnCompatibilityMode) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d69608485fb..78c50b32af6 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6742,7 +6742,6 @@ float Unit::SpellCritChanceTaken(Unit const* caster, Spell* spell, AuraEffect co } case SPELL_DAMAGE_CLASS_MELEE: - /* fallthrough - Calculate critical strike chance for both Ranged and Melee spells*/ case SPELL_DAMAGE_CLASS_RANGED: if (caster) crit_chance = GetUnitCriticalChanceTaken(caster, attackType, crit_chance); diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 95cde9901d2..c57920c7691 100644 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -278,7 +278,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe { case REACT_PASSIVE: // passive pet->AttackStop(); - /* fallthrough */ + [[fallthrough]]; case REACT_DEFENSIVE: // recovery case REACT_AGGRESSIVE: // activete if (pet->GetTypeId() == TYPEID_UNIT) diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 88bf616a56c..a3318602612 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -464,7 +464,7 @@ WorldSocket::ReadDataHandlerResult WorldSocket::ReadDataHandler() break; case CMSG_HOTFIX_REQUEST: _canRequestHotfixes = false; - /* fallthrough */ + [[fallthrough]]; default: { if (opcode == CMSG_TIME_SYNC_RESPONSE) diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 899dd94f526..3b2d20c09af 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2462,7 +2462,7 @@ void UnitAura::FillTargetMap(std::unordered_map<Unit*, uint32>& targets, Unit* c case SPELL_EFFECT_APPLY_AREA_AURA_PET: if (!condList || sConditionMgr->IsObjectMeetToConditions(GetUnitOwner(), ref, *condList)) units.push_back(GetUnitOwner()); - /* fallthrough */ + [[fallthrough]]; case SPELL_EFFECT_APPLY_AREA_AURA_OWNER: { if (Unit* owner = GetUnitOwner()->GetCharmerOrOwner()) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 1a4d6c373da..01e7dcf869f 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3375,7 +3375,7 @@ void Spell::cancel() { case SPELL_STATE_PREPARING: CancelGlobalCooldown(); - /* fallthrough */ + [[fallthrough]]; case SPELL_STATE_DELAYED: SendInterrupted(0); SendCastResult(SPELL_FAILED_INTERRUPTED); @@ -5953,7 +5953,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32 case SUMMON_CATEGORY_PET: if (!m_spellInfo->HasAttribute(SPELL_ATTR1_DISMISS_PET) && !unitCaster->GetPetGUID().IsEmpty()) 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 (!unitCaster->GetCharmedGUID().IsEmpty()) return SPELL_FAILED_ALREADY_HAVE_CHARM; @@ -7144,7 +7144,7 @@ SpellCastResult Spell::CheckItems(int32* param1 /*= nullptr*/, int32* param2 /*= return SPELL_FAILED_DONT_REPORT; } } - /* fallthrough */ + [[fallthrough]]; case SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC: { Item* targetItem = m_targets.GetItemTarget(); @@ -8577,7 +8577,7 @@ bool WorldObjectSpellTargetCheck::operator()(WorldObject* target) const return false; if (refUnit->GetClass() != unitTarget->GetClass()) return false; - /* fallthrough */ + [[fallthrough]]; case TARGET_CHECK_RAID: if (!refUnit) return false; diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 32050ac41a2..a1bc3937b4f 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -186,7 +186,7 @@ uint32 SpellImplicitTargetInfo::GetExplicitTargetMask(bool& srcSet, bool& dstSet targetMask = TARGET_FLAG_UNIT_PASSENGER; break; case TARGET_CHECK_RAID_CLASS: - /* fallthrough */ + [[fallthrough]]; default: targetMask = TARGET_FLAG_UNIT; break; @@ -2692,7 +2692,7 @@ void SpellInfo::_LoadSpellSpecific() /// @workaround For non-stacking tracking spells (We need generic solution) if (Id == 30645) // Gas Cloud Tracking return SPELL_SPECIFIC_NORMAL; - /* fallthrough */ + [[fallthrough]]; case SPELL_AURA_TRACK_RESOURCES: case SPELL_AURA_TRACK_STEALTHED: return SPELL_SPECIFIC_TRACKER; @@ -3243,7 +3243,7 @@ void SpellInfo::_LoadImmunityInfo() immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_CONFUSE); immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_FEAR); immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_ROOT_2); - /* fallthrough */ + [[fallthrough]]; case 61869: // Overload case 63481: case 61887: // Lightning Tendrils diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 205a0dd2818..27023887431 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3106,7 +3106,7 @@ void SpellMgr::LoadSpellInfoCustomAttributes() spellEffectInfo.ApplyAuraName == SPELL_AURA_PERIODIC_HEALTH_FUNNEL || spellEffectInfo.ApplyAuraName == SPELL_AURA_PERIODIC_DUMMY) break; - /* fallthrough */ + [[fallthrough]]; default: { // No value and not interrupt cast or crowd control without SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY flag |
