Les pénalités ne se suivent pas d'une tentative à une autre

This commit is contained in:
2024-12-14 13:35:09 +01:00
parent 979362d012
commit cb1222d9cf
3 changed files with 7 additions and 1 deletions

View File

@ -22,6 +22,7 @@ export interface PenaltyPayload {
export interface GameState {
playerId: number | null
runId: number | null
gameStarted: boolean
money: number
currentRunner: boolean
@ -33,6 +34,7 @@ export interface GameState {
const initialState: GameState = {
playerId: null,
runId: null,
gameStarted: false,
money: 0,
currentRunner: false,
@ -58,6 +60,7 @@ export const gameSlice = createSlice({
updateGameState: (state, action: PayloadAction<GamePayload>) => {
const game: GamePayload = action.payload
state.gameStarted = game.started
state.runId = game.currentRunId
state.currentRunner = state.playerId === game.currentRun?.runnerId
if (state.currentRunner)
state.chaseFreeTime = null