From 81c2764789fddb9d1c7797fc8574178f0b07aaf2 Mon Sep 17 00:00:00 2001 From: TKTK123456 <103334266+TKTK123456@users.noreply.github.com> Date: Tue, 28 Apr 2026 12:08:46 -0400 Subject: [PATCH] Fix comparison operator for distance checks --- src/core/game/RailNetworkImpl.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/game/RailNetworkImpl.ts b/src/core/game/RailNetworkImpl.ts index 813098401f..b012b87d47 100644 --- a/src/core/game/RailNetworkImpl.ts +++ b/src/core/game/RailNetworkImpl.ts @@ -264,7 +264,7 @@ export class RailNetworkImpl implements RailNetwork { for (const neighbor of neighbors) { // Limit to the closest 5 stations to avoid running too many pathfinding calls. if (paths.length >= 5) break; - if (neighbor.distSquared <= minRangeSquared) continue; + if (neighbor.distSquared < minRangeSquared) continue; const neighborStation = this._stationManager.findStation(neighbor.unit); if (!neighborStation) continue; @@ -317,7 +317,7 @@ export class RailNetworkImpl implements RailNetwork { distanceToStation === -1; if ( connectionAvailable && - neighbor.distSquared > this.game.config().trainStationMinRange() ** 2 + neighbor.distSquared >= this.game.config().trainStationMinRange() ** 2 ) { if (this.connect(station, neighborStation)) { neighborCluster.addStation(station);