mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 11:10:42 +00:00
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:
committed by
GitHub
parent
c123adc0ef
commit
216e8ca29f
@@ -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++;
|
||||
|
||||
@@ -42,7 +42,7 @@ class StationGraphAdapter implements AStarAdapter {
|
||||
}
|
||||
|
||||
maxNeighbors(): number {
|
||||
return 8;
|
||||
return 32;
|
||||
}
|
||||
|
||||
maxPriority(): number {
|
||||
|
||||
Reference in New Issue
Block a user