1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-24 04:34:16 +01:00

Codechange: Replace bitstuffed VehicleEnterTileStatus. (#14027)

VehicleEnterTileStatus was an bitset-style enum, but bitstuffed with a StationID. However the StationID part was only used by trains, and only in two locations.

Instead, return just the enum bitset. The two places which require the StationID just call GetStationIndex() directly.
This commit is contained in:
Peter Nelson
2025-04-20 21:10:02 +01:00
committed by GitHub
parent cb113cfed0
commit fc45bb5a2b
10 changed files with 67 additions and 81 deletions

View File

@@ -1837,9 +1837,9 @@ Direction GetDirectionTowards(const Vehicle *v, int x, int y)
* @param x X position
* @param y Y position
* @return Some meta-data over the to be entered tile.
* @see VehicleEnterTileStatus to see what the bits in the return value mean.
* @see VehicleEnterTileStates to see what the bits in the return value mean.
*/
VehicleEnterTileStatus VehicleEnterTile(Vehicle *v, TileIndex tile, int x, int y)
VehicleEnterTileStates VehicleEnterTile(Vehicle *v, TileIndex tile, int x, int y)
{
return _tile_type_procs[GetTileType(tile)]->vehicle_enter_tile_proc(v, tile, x, y);
}