diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2022-12-23 13:05:54 -0500 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2022-12-23 13:05:54 -0500 |
commit | 82c447fbfe12ee76dbbdaa36b0de1343d3a91795 (patch) | |
tree | 6726496043db35b11561cc43fd9b95e0411a10ae /protocol/src/bridge_engine.rs | |
parent | 89489b0cf0a6cf81dd29426fdf0eeb5aee9231de (diff) |
Fix propagation of the previous trick
Diffstat (limited to 'protocol/src/bridge_engine.rs')
-rw-r--r-- | protocol/src/bridge_engine.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/protocol/src/bridge_engine.rs b/protocol/src/bridge_engine.rs index b069e18..ee43437 100644 --- a/protocol/src/bridge_engine.rs +++ b/protocol/src/bridge_engine.rs @@ -841,7 +841,7 @@ pub struct PlayStatePlayerView { pub dummy: Option<Vec<Card>>, pub declarer_tricks: u8, pub hand: Vec<Card>, - pub previous_trick: Trick, + pub previous_trick: Option<Trick>, pub current_trick: TurnInPlay, } @@ -870,10 +870,7 @@ impl PlayStatePlayerView { hand: player_position .get_cards(&play_state.playing_deal.deal) .clone(), - previous_trick: Trick { - leader: random(), - cards_played: vec![], - }, + previous_trick: play_state.playing_deal.tricks_played.last().cloned(), current_trick: play_state.playing_deal.in_progress.clone(), } } |