diff --git a/src/action/action_board.cpp b/src/action/action_board.cpp index 1dbb527460..fd4850343a 100644 --- a/src/action/action_board.cpp +++ b/src/action/action_board.cpp @@ -271,7 +271,7 @@ void COrder_Board::Execute(CUnit &unit) /* override */ return; } this->State = 1; - // FALL THROUGH + [[fallthrough]]; default: { // Move to transporter if (this->State <= State_MoveToTransporterMax) { const int pathRet = MoveToTransporter(unit); diff --git a/src/action/action_follow.cpp b/src/action/action_follow.cpp index f382340ba0..abbb295555 100644 --- a/src/action/action_follow.cpp +++ b/src/action/action_follow.cpp @@ -269,7 +269,7 @@ void COrder_Follow::Execute(CUnit &unit) /* override */ this->goalPos = goal->tilePos; this->State = State_TargetReached; } - // FALL THROUGH + [[fallthrough]]; default: break; } diff --git a/src/action/action_repair.cpp b/src/action/action_repair.cpp index 6a38b4f55d..64828f45ea 100644 --- a/src/action/action_repair.cpp +++ b/src/action/action_repair.cpp @@ -243,9 +243,7 @@ void COrder_Repair::Execute(CUnit &unit) /* override */ Assert(this->ReparableTarget == this->GetGoal()); switch (this->State) { - case 0: - this->State = 1; - // FALL THROUGH + case 0: this->State = 1; [[fallthrough]]; case 1: { // Move near to target. // FIXME: RESET FIRST!! Why? We move first and than check if // something is in sight. diff --git a/src/action/action_spellcast.cpp b/src/action/action_spellcast.cpp index c60d0ebf15..a49941aa56 100644 --- a/src/action/action_spellcast.cpp +++ b/src/action/action_spellcast.cpp @@ -351,7 +351,7 @@ void COrder_SpellCast::Execute(CUnit &unit) /* override */ // FIXME FIXME FIXME: Check if already in range and skip straight to 2(casting) unit.ReCast = 0; // repeat spell on next pass? (defaults to `no') this->State = 1; - // FALL THROUGH + [[fallthrough]]; case 1: // Move to the target. if (spell.Range != INFINITE_RANGE) { if (SpellMoveToTarget(unit) == true) { @@ -364,7 +364,7 @@ void COrder_SpellCast::Execute(CUnit &unit) /* override */ } else { this->State = 2; } - // FALL THROUGH + [[fallthrough]]; case 2: // Cast spell on the target. if (!spell.IsCasterOnly() || spell.ForceUseAnimation) { AnimateActionSpellCast(unit, *this); diff --git a/src/ui/botpanel.cpp b/src/ui/botpanel.cpp index 748d97f315..a9488706b5 100644 --- a/src/ui/botpanel.cpp +++ b/src/ui/botpanel.cpp @@ -883,7 +883,7 @@ bool IsButtonAllowed(const CUnit &unit, const ButtonAction &buttonaction) if (!EnableTrainingQueue && unit.CurrentAction() == UnitAction::Train) { break; } - // FALL THROUGH + [[fallthrough]]; case ButtonCmd::UpgradeTo: case ButtonCmd::Research: case ButtonCmd::Build: diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp index fa9f0dff07..f82775d2e0 100644 --- a/src/ui/interface.cpp +++ b/src/ui/interface.cpp @@ -660,7 +660,7 @@ static bool CommandKey(int key) if (!(KeyModifiers & (ModifierAlt | ModifierControl))) { break; } - // FALL THROUGH + [[fallthrough]]; case SDLK_PERIOD: // ., ALT+I, CTRL+I: Find idle worker UiFindIdleWorker(); break; @@ -677,7 +677,7 @@ static bool CommandKey(int key) if (!(KeyModifiers & (ModifierAlt | ModifierControl))) { break; } - // FALL THROUGH (CTRL+P, ALT+P) + [[fallthrough]]; // (CTRL+P, ALT+P) case SDLK_PAUSE: UiTogglePause(); break; @@ -887,7 +887,7 @@ static void InputKey(int key) NetworkSendChatMessage(chatMessage); } } - // FALL THROUGH + [[fallthrough]]; case SDLK_ESCAPE: KeyState = EKeyState::Command; UI.StatusLine.Clear();