Add GUI/command support for >255 station types per station class

This commit is contained in:
Jonathan G Rennison
2023-02-16 22:33:34 +00:00
parent 50a48b1264
commit 5e398d9478
4 changed files with 14 additions and 9 deletions

View File

@@ -1457,12 +1457,13 @@ static void RestoreTrainReservation(Train *v)
* - p1 = (bit 24) - allow stations directly adjacent to other stations.
* @param p2 various bitstuffed elements
* - p2 = (bit 0- 7) - custom station class
* - p2 = (bit 8-15) - custom station id
* - p2 = (bit 16-31) - station ID to join (NEW_STATION if build new one)
* @param p3 various bitstuffed elements
* - p3 = (bit 0-15) - custom station id
* @param text unused
* @return the cost of this operation or an error
*/
CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32 p1, uint32 p2, uint64 p3, const char *text, const CommandAuxiliaryBase *aux_data)
{
/* Unpack parameters */
RailType rt = Extract<RailType, 0, 6>(p1);
@@ -1472,7 +1473,7 @@ CommandCost CmdBuildRailStation(TileIndex tile_org, DoCommandFlag flags, uint32
bool adjacent = HasBit(p1, 24);
StationClassID spec_class = Extract<StationClassID, 0, 8>(p2);
byte spec_index = GB(p2, 8, 8);
byte spec_index = GB(p3, 0, 16);
StationID station_to_join = GB(p2, 16, 16);
/* Does the authority allow this? */