lib/storyboard.js
function resetSeat(s) {
    const street = this.street
    const stage  = this.stage

    const preflop = street === 'preflop'
    const chipsName = 'chips' + street[0].toUpperCase() + street.slice(1)
    const p = script.players[s.playerIdx]
    const chips = p[chipsName]
    return Object.assign({}, seats[p.seatno], {
        chips       : chips
      , action      : null
      , amount      : 0
      , chipsInFront: preflop ? p.chipsInFront : 0
      , bet         : 0
      , investedBet : preflop && p.bb ? 1 : 0
      , _lastUpdate : stage
    })
  }
function resetSeat(s) {
    const street = this.street
    const stage  = this.stage

    const preflop = street === 'preflop'
    const chipsName = 'chips' + street[0].toUpperCase() + street.slice(1)
    const p = script.players[s.playerIdx]
    const chips = p[chipsName]
    return Object.assign({}, seats[p.seatno], {
        chips       : chips
      , action      : null
      , amount      : 0
      , chipsInFront: preflop ? p.chipsInFront : 0
      , bet         : 0
      , investedBet : preflop && p.bb ? 1 : 0
      , _lastUpdate : stage
    })
  }
function resetSeat ( s ) { const street = this . street const stage = this . stage const preflop = street === 'preflop' const chipsName = 'chips' + street [ 0 ] . toUpperCase ( ) + street . slice ( 1 ) const p = script . players [ s . playerIdx ] const chips = p [ chipsName ] return Object . assign ( { } , seats [ p . seatno ] , { chips : chips , action : null , amount : 0 , chipsInFront : preflop ? p . chipsInFront : 0 , bet : 0 , investedBet : preflop && p . bb ? 1 : 0 , _lastUpdate : stage } ) }
From now on we always map seats even though we reuse the variable in order to avoid affecting previous states
From now on we always map seats even though we reuse the variable in order to avoid affecting previous states