Skip to content

Commit

Permalink
Make Pushing and Leaving the Field impossible in penalty shoot-out Set
Browse files Browse the repository at this point in the history
  • Loading branch information
ahasselbring committed Jun 23, 2024
1 parent fc78c50 commit 2eda769
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions game_controller_core/src/actions/penalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@ impl Action for Penalize {
|| c.game.state == State::Playing
}
PenaltyCall::Pushing => {
c.game.state == State::Ready
|| c.game.state == State::Set // Not possible in this state, but can happen
// in Ready shortly before the timer expires.
// Not possible in Set, but can happen in Ready shortly before the timer
// expires.
(c.game.phase != Phase::PenaltyShootout
&& (c.game.state == State::Ready || c.game.state == State::Set))
|| c.game.state == State::Playing
}
PenaltyCall::Foul => {
Expand All @@ -204,9 +205,10 @@ impl Action for Penalize {
|| c.game.state == State::Playing
}
PenaltyCall::LeavingTheField => {
c.game.state == State::Ready
|| c.game.state == State::Set // Not possible in this state, but can happen
// in Ready shortly before the timer expires.
// Not possible in Set, but can happen in Ready shortly before the timer
// expires.
(c.game.phase != Phase::PenaltyShootout
&& (c.game.state == State::Ready || c.game.state == State::Set))
|| c.game.state == State::Playing
}
})
Expand Down

0 comments on commit 2eda769

Please sign in to comment.