Skip to content

Commit

Permalink
Add null check to eat check (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelkyl authored Nov 18, 2023
1 parent 6f46eee commit 3109376
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/server/map/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class Cell {
// 1: A ate B
// 2: B ate A
static checkWhoAteWho(cellA, cellB) {
if (!cellA || !cellB) return 0;
let response = new sat.Response();
let colliding = sat.testCircleCircle(cellA.toCircle(), cellB.toCircle(), response);
if (!colliding) return 0;
Expand Down

0 comments on commit 3109376

Please sign in to comment.