Fix rail pathfinding (#2950)

## Description:

This PR resolves a crash related to rail pathfinding reported on
Discord.

```
git checkout c179249cdd
npm run dev:staging
Replay id: kEbHPSP3
```

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

moleole

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Ryan <7389646+ryanbarlow97@users.noreply.github.com>
This commit is contained in:
Arkadiusz Sygulski
2026-01-18 21:51:22 +01:00
committed by evanpelle
parent e08b8f8bdc
commit b75df821cd
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ export interface StationManager {
export class StationManagerImpl implements StationManager {
private stations: Set<TrainStation> = new Set();
private stationsById: (TrainStation | undefined)[] = [];
private nextId = 0;
private nextId = 1; // Start from 1; 0 is reserved as invalid/sentinel
addStation(station: TrainStation) {
station.id = this.nextId++;
+1 -1
View File
@@ -42,7 +42,7 @@ class StationGraphAdapter implements AStarAdapter {
}
maxNeighbors(): number {
return 8;
return 32;
}
maxPriority(): number {