Skip to content

Commit

Permalink
Fix for distance_squared.
Browse files Browse the repository at this point in the history
  • Loading branch information
sil-quirk committed Oct 31, 2023
1 parent e81113f commit 968f44b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cave.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int distance_squared(int y1, int x1, int y2, int x2)
ax = (x1 > x2) ? (x1 - x2) : (x2 - x1);

/* Hack -- approximate the distance */
return (ay * ay + ax + ax);
return (ay * ay + ax * ax);
}

/*
Expand Down

0 comments on commit 968f44b

Please sign in to comment.