File tree Expand file tree Collapse file tree
kaggle_environments/envs/open_spiel_env/games/go/visualizer/v2/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,12 +40,11 @@ export default function GameOver() {
4040 if ( ! game . gameOver ) return null ;
4141
4242 const state = game . currentState ( ) ;
43- const winnerPlayer = step . players . find ( ( player ) => player . reward === 1 ) ;
44- const winnerColor = winnerPlayer ?. id === 0 ? 'black' : 'white' ;
43+ const points = game . score ( ) ;
44+ const winnerColor = points . black > points . white ? 'black' : 'white' ;
4545 const blackName = game . blackName ?? 'Black' ;
4646 const whiteName = game . whiteName ?? 'White' ;
4747 const winnerName = winnerColor === 'black' ? blackName : whiteName ;
48- const points = game . score ( ) ;
4948 const captured = { black : state . whiteStonesCaptured , white : state . blackStonesCaptured } ;
5049 const passes = { black : state . blackPassStones , white : state . whitePassStones } ;
5150 const tokens = { black : 0 , white : 0 } ;
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ export const goTransformer = (environment: any): GoStep[] => {
103103
104104 goSteps . push ( {
105105 step : goSteps . length ,
106- players : goSteps [ goSteps . length - 1 ] . players ,
106+ players : extraStepPlayers ,
107107 boardState : goSteps [ goSteps . length - 1 ] . boardState ,
108108 isTerminal : lastReplayStep [ 0 ] . observation . isTerminal ,
109109 winner : deriveWinner ( lastReplayStep ) ,
You can’t perform that action at this time.
0 commit comments