Skip to content

Commit

Permalink
Fix for 3rd party snakes
Browse files Browse the repository at this point in the history
  • Loading branch information
Petah committed Sep 3, 2020
1 parent b64e2b5 commit 6368cf2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/web/grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ export function loadGrid(moveJson) {
const data = initBTData(moveJson.body);

const snake = snakes.find(s => s.name == data.you.name);
console.log(data, snake.move(data));
if (snake) {
console.log(data, snake.move(data));
}

$('.log').html('');
if (moveJson.logs) {
for (const log of moveJson.logs) {
Expand Down

0 comments on commit 6368cf2

Please sign in to comment.