fauxnik / dv-rolling-stock-ownership

A Derail Valley mod that introduces a game mechanic of purchasing and managing rolling stock.
MIT License
5 stars 4 forks source link

Get cars in yard by distance rather than by track #61

Closed fauxnik closed 5 months ago

fauxnik commented 5 months ago

When some players have expressed confusion over why jobs won't generate for some of their purchased rolling stock, it has been discovered that the wagons were not on named station tracks. This aims to resolve the confusion by finding wagons based on distance from the station center rather than by searching the list of named tracks at that station.

This relies on accessing the station range via a private field, but it falls back on getting cars by named track (the old method) in case it fails to retrieve the range object.