File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,15 @@ export default function Round() {
133133 if ( typeof msg == "string" ) {
134134 if ( betUIOpen ) return ;
135135
136+ if ( usedCards . includes ( msg as Card ) ) {
137+ notifications . show ( {
138+ message : "Card is already in use" ,
139+ color : "red" ,
140+ } ) ;
141+
142+ return ;
143+ }
144+
136145 if ( pokerGame . capturingCommunityCards ) {
137146 let cards = [ ...pokerGame . communityCards ] ;
138147 if ( cards . includes ( EMPTY_CARD ) ) {
@@ -354,12 +363,14 @@ export default function Round() {
354363 } ) ;
355364
356365 if ( new Set ( usedCards ) . size !== usedCards . length ) {
357- notifications . show ( {
358- message : "Duplicate cards are not allowed, removing duplicates" ,
359- color : "red" ,
366+ modals . open ( {
367+ title : "Duplicate cards" ,
368+ children : (
369+ < >
370+ < Text > There are duplicate cards in play. Remove them to continue.</ Text >
371+ </ >
372+ ) ,
360373 } ) ;
361-
362- usedCards = [ ...new Set ( usedCards ) ] ;
363374 }
364375
365376 setUsedCards ( usedCards ) ;
You can’t perform that action at this time.
0 commit comments