fix invalid request to /end when game ended in a draw
In `board.snakes` there would be `null` instead of `[]`.
This commit is contained in:
parent
397d925110
commit
d7d888e326
1 changed files with 1 additions and 1 deletions
|
|
@ -392,7 +392,7 @@ func convertRulesSnake(snake rules.Snake, snakeState SnakeState) client.Snake {
|
||||||
}
|
}
|
||||||
|
|
||||||
func convertRulesSnakes(snakes []rules.Snake, snakeStates map[string]SnakeState) []client.Snake {
|
func convertRulesSnakes(snakes []rules.Snake, snakeStates map[string]SnakeState) []client.Snake {
|
||||||
var a []client.Snake
|
a := make([]client.Snake, 0)
|
||||||
for _, snake := range snakes {
|
for _, snake := range snakes {
|
||||||
if snake.EliminatedCause == rules.NotEliminated {
|
if snake.EliminatedCause == rules.NotEliminated {
|
||||||
a = append(a, convertRulesSnake(snake, snakeStates[snake.ID]))
|
a = append(a, convertRulesSnake(snake, snakeStates[snake.ID]))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue