functional js dice, fixes player update bug