bugfixing

This commit is contained in:
Tao Tien 2026-03-04 23:05:56 -08:00
parent b66a4e63f1
commit 3457e0d024
13 changed files with 495 additions and 444 deletions

View file

@ -5,9 +5,12 @@ use spacetimedb::{
ReducerContext, ScheduleAt::Interval, Table as _, rand::seq::SliceRandom, reducer,
};
use crate::tables::{
DbTile, Lobby, LobbyTimer, PlayerClock, PlayerHand, Wall, bot, game_timer, lobby as _,
player_clock, player_config, player_hand, tile, user, wall,
use crate::{
reducers::hand::{discard_tile, discard_tile_private},
tables::{
DbTile, Lobby, LobbyTimer, PlayerClock, PlayerHand, Wall, bot, game_timer, lobby as _,
player_clock, player_config, player_hand, tile, user, wall,
},
};
use jong_types::{GameState, TurnState};
@ -139,6 +142,14 @@ pub fn advance_game_private(
ctx.db.player_clock().player_id().update(clock);
} else {
// TODO bot / auto discard
discard_tile_private(
ctx,
lobby.id,
ctx.db.player_config().id().find(curr_player).unwrap(),
hand.working_tile.unwrap().id,
)
.unwrap();
return Ok(());
}
}
TurnState::Menzen => {}