mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-21 04:36:07 +00:00
more efficient spawns
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ export function manhattanDist(c1: Cell, c2: Cell): number {
|
||||
return Math.abs(c1.x - c2.x) + Math.abs(c1.y - c2.y);
|
||||
}
|
||||
|
||||
export function manhattenDistWrapped(c1: Cell, c2: Cell, width: number): number {
|
||||
export function manhattanDistWrapped(c1: Cell, c2: Cell, width: number): number {
|
||||
// Calculate x distance
|
||||
let dx = Math.abs(c1.x - c2.x);
|
||||
// Check if wrapping around the x-axis is shorter
|
||||
|
||||
Reference in New Issue
Block a user