       prisoners.white += result.captures.white
   if scoring
     [x, y] = [null, null]
-    if deadFromUi?
-      deadStones = deadFromUi
-    else
-      deadStones = deadStonesFromSgfObject sgfObject, boardState
+    deadStones = deadFromUi ?
+                 deadStonesFromSgfObject sgfObject, boardState, moves: moves
     for [px, py] in deadStones
       switch boardState[py][px]
         when 'black'

        regions.push region
  return regions

moveCount = (sgfObject) ->
  "Return number of moves (including passes) in sgf object."
  count = 0
  for node in sgfObject.gameTrees[0].nodes
    if node.B? or node.W? or node.TW? or node.TB?
      count += 1
  count


                                                    deadStones: newDead
        newSgfObject = sgfObjectWithDeadStones origSgfObject, newState
        setResponseSgf smartgame.generate(newSgfObject)
        return

    else if playMode
      # ready to accept a normal (non-dead stone marking) move
      nextColor = nextPlayerInSgfObject origSgfObject
      onBoardClick = (xy) =>
