diff options
| author | Peter Keresztes Schmidt <carbenium@outlook.com> | 2020-07-18 20:42:28 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-18 20:42:28 +0200 |
| commit | 85b5b842ca6c05d4e51081e6c3282940a80f3761 (patch) | |
| tree | 4b5d72c0d163cff0a134fcfe4c50f05b59a46668 /src/server/game | |
| parent | 7032ee0bdb47c995dfd89bce3d5b6fad13ec6d73 (diff) | |
Misc: Use [[fallthrough]] attribute instead of comment to mark intentional fallthroughs (#25054)
Related: #25006
Diffstat (limited to 'src/server/game')
| -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 | 2 | ||||
| -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/Player/Player.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/Handlers/LFGHandler.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Handlers/PetHandler.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/SpellEffects.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 6 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 2 |
17 files changed, 28 insertions, 28 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 31c98d61fab..4ac8c616a88 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -1194,7 +1194,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry %d 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 1bf959a3905..b1457af4df4 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -203,7 +203,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 ed7d96ca693..cbd157a1cd3 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -740,11 +740,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 50a81782fa2..b3f3b6dbeb8 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -1942,7 +1942,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: 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 0c7e1855e1e..ef4d316387e 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -490,7 +490,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]]; // 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 3c1bda34d4a..a94c20a111a 100644 --- a/src/server/game/DungeonFinding/LFGPlayerData.cpp +++ b/src/server/game/DungeonFinding/LFGPlayerData.cpp @@ -35,10 +35,10 @@ void LfgPlayerData::SetState(LfgState state) m_Roles = 0; m_SelectedDungeons.clear(); m_Comment.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 39bdfc1e7da..5703c5346db 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -532,8 +532,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/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 4e5e8b37f6c..8203d22b478 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5866,7 +5866,7 @@ void Player::UpdateWeaponSkill(WeaponAttackType attType) break; case ITEM_SUBCLASS_WEAPON_FIST: UpdateSkill(SKILL_UNARMED, weapon_skill_gain); - /* fallthrough */ + [[fallthrough]]; default: UpdateSkill(tmpitem->GetSkill(), weapon_skill_gain); break; @@ -14270,8 +14270,8 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool GetName().c_str(), GetGUID().ToString().c_str(), menu->GetGossipMenu().GetMenuId(), creature->GetName().c_str(), creature->GetEntry()); canTalk = false; } + [[fallthrough]]; } - /* fallthrough */ case GOSSIP_OPTION_GOSSIP: case GOSSIP_OPTION_SPIRITGUIDE: case GOSSIP_OPTION_INNKEEPER: diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index ca47aec50b6..7159afa9f15 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7038,10 +7038,10 @@ float Unit::SpellCritChanceTaken(Unit const* caster, SpellInfo const* spellInfo, { case 911: // Shatter (Rank 3) modChance += 16.f; - /* fallthrough */ + [[fallthrough]]; case 910: // Shatter (Rank 2) modChance += 17.f; - /* fallthrough */ + [[fallthrough]]; case 849: // Shatter (Rank 1) modChance += 17.f; if (!HasAuraState(AURA_STATE_FROZEN, spellInfo, caster)) @@ -7163,8 +7163,8 @@ float Unit::SpellCritChanceTaken(Unit const* caster, SpellInfo const* spellInfo, break; } } + [[fallthrough]]; // Calculate critical strike chance for both Ranged and Melee spells } - /* 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/LFGHandler.cpp b/src/server/game/Handlers/LFGHandler.cpp index 656f59bf4ea..40daa756b3d 100644 --- a/src/server/game/Handlers/LFGHandler.cpp +++ b/src/server/game/Handlers/LFGHandler.cpp @@ -356,7 +356,7 @@ void WorldSession::SendLfgUpdateParty(const lfg::LfgUpdateData& updateData) { case lfg::LFG_UPDATETYPE_ADDED_TO_QUEUE: // Rolecheck Success queued = true; - /* fallthrough */ + [[fallthrough]]; case lfg::LFG_UPDATETYPE_PROPOSAL_BEGIN: join = true; break; diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 36d6a42d25c..56d12210529 100644 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -262,7 +262,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/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 9aa86b57451..91f46881467 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2678,7 +2678,7 @@ void UnitAura::FillTargetMap(std::unordered_map<Unit*, uint8>& targets, Unit* ca 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 69f365785df..615e4093a3e 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3186,7 +3186,7 @@ void Spell::cancel() { case SPELL_STATE_PREPARING: CancelGlobalCooldown(); - /* fallthrough */ + [[fallthrough]]; case SPELL_STATE_DELAYED: SendInterrupted(0); SendCastResult(SPELL_FAILED_INTERRUPTED); @@ -5719,7 +5719,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint case SUMMON_CATEGORY_PET: if (!m_spellInfo->HasAttribute(SPELL_ATTR1_DISMISS_PET) && unitCaster->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 (unitCaster->GetCharmedGUID()) return SPELL_FAILED_ALREADY_HAVE_CHARM; @@ -6786,7 +6786,7 @@ SpellCastResult Spell::CheckItems(uint32* param1 /*= nullptr*/, uint32* param2 / return SPELL_FAILED_DONT_REPORT; } } - /* fallthrough */ + [[fallthrough]]; case SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC: { Item* targetItem = m_targets.GetItemTarget(); @@ -8206,7 +8206,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/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 776e2380481..e7a0635100c 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3759,7 +3759,7 @@ void Spell::EffectActivateObject(SpellEffIndex effIndex) case GameObjectActions::OpenAndUnlock: if (Unit* unitCaster = m_caster->ToUnit()) gameObjTarget->UseDoorOrButton(0, false, unitCaster); - /* fallthrough */ + [[fallthrough]]; case GameObjectActions::Unlock: case GameObjectActions::Lock: gameObjTarget->ApplyModFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED, action == GameObjectActions::Lock); diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index dd5dcb04f1a..24a587a161c 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -181,7 +181,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; @@ -2222,7 +2222,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; @@ -2615,7 +2615,7 @@ void SpellInfo::_LoadImmunityInfo() immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_ROOT); immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_CONFUSE); immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_FEAR); - /* 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 2bcce293cdf..fc996c72db2 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2789,8 +2789,8 @@ void SpellMgr::LoadSpellInfoCustomAttributes() spellInfo->Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_HEALTH_FUNNEL || spellInfo->Effects[j].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 |
