Les pénalités ne se suivent pas d'une tentative à une autre
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user