commit 965e314d3bca38c258c61c97090ed1a312fd86e6 (patch)
parent 616e7bc792d636a22811bc4e711b51a313453888
Author: Chris Karle <chris.karle@gmail.com>
Date: Mon, 3 Mar 2025 21:34:41 -0500
fix(Spectator) fix bug if spectator not last
Modifies lobby-processing logic so that after the fourth player has
taken a seat, any remain spectators have their local view updated to
position the view behind player4. Old code could leave some variables
uninitialized if a spectator was in before the final seat was taken.
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/assets/components/CardTable.js b/assets/components/CardTable.js
@@ -255,8 +255,9 @@ export default class CardTable extends React.Component {
if (msg.game.players) {
const plAr = msg.game.players;
let mySeat = plAr.findIndex( x => x == name );
- console.log('initMySeat.mySeat=', mySeat);
- if (newSpec && msg.game.phase != 'lobby'){
+ let anyEmpty = plAr.includes('Empty');
+ if (newSpec && !anyEmpty){
+ // console.log('all seats taken, initMySeat.newSpec, mySeat=3');
mySeat = 3;
};
this.setState({