Codechange: rename byte to uint8_t (#12308)
This commit is contained in:
@@ -155,7 +155,7 @@ static CommandCost IsValidTileForWaypoint(TileIndex tile, Axis axis, StationID *
|
||||
return CommandCost();
|
||||
}
|
||||
|
||||
extern void GetStationLayout(byte *layout, uint numtracks, uint plat_len, const StationSpec *statspec);
|
||||
extern void GetStationLayout(uint8_t *layout, uint numtracks, uint plat_len, const StationSpec *statspec);
|
||||
extern CommandCost FindJoiningWaypoint(StationID existing_station, StationID station_to_join, bool adjacent, TileArea ta, Waypoint **wp);
|
||||
extern CommandCost CanExpandRailStation(const BaseStation *st, TileArea &new_ta);
|
||||
|
||||
@@ -173,7 +173,7 @@ extern CommandCost CanExpandRailStation(const BaseStation *st, TileArea &new_ta)
|
||||
* @param adjacent allow waypoints directly adjacent to other waypoints.
|
||||
* @return the cost of this operation or an error
|
||||
*/
|
||||
CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, Axis axis, byte width, byte height, StationClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent)
|
||||
CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, Axis axis, uint8_t width, uint8_t height, StationClassID spec_class, uint16_t spec_index, StationID station_to_join, bool adjacent)
|
||||
{
|
||||
if (!IsValidAxis(axis)) return CMD_ERROR;
|
||||
/* Check if the given station class is valid */
|
||||
@@ -181,7 +181,7 @@ CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, Axis
|
||||
if (spec_index >= StationClass::Get(spec_class)->GetSpecCount()) return CMD_ERROR;
|
||||
|
||||
/* The number of parts to build */
|
||||
byte count = axis == AXIS_X ? height : width;
|
||||
uint8_t count = axis == AXIS_X ? height : width;
|
||||
|
||||
if ((axis == AXIS_X ? width : height) != 1) return CMD_ERROR;
|
||||
if (count == 0 || count > _settings_game.station.station_spread) return CMD_ERROR;
|
||||
@@ -258,17 +258,17 @@ CommandCost CmdBuildRailWaypoint(DoCommandFlag flags, TileIndex start_tile, Axis
|
||||
wp->UpdateVirtCoord();
|
||||
|
||||
const StationSpec *spec = StationClass::Get(spec_class)->GetSpec(spec_index);
|
||||
std::vector<byte> layout(count);
|
||||
std::vector<uint8_t> layout(count);
|
||||
if (spec != nullptr) {
|
||||
/* For NewGRF waypoints we like to have their style. */
|
||||
GetStationLayout(layout.data(), count, 1, spec);
|
||||
}
|
||||
byte map_spec_index = AllocateSpecToStation(spec, wp, true);
|
||||
uint8_t map_spec_index = AllocateSpecToStation(spec, wp, true);
|
||||
|
||||
Company *c = Company::Get(wp->owner);
|
||||
for (int i = 0; i < count; i++) {
|
||||
TileIndex tile = start_tile + i * offset;
|
||||
byte old_specindex = HasStationTileRail(tile) ? GetCustomStationSpecIndex(tile) : 0;
|
||||
uint8_t old_specindex = HasStationTileRail(tile) ? GetCustomStationSpecIndex(tile) : 0;
|
||||
if (!HasStationTileRail(tile)) c->infrastructure.station++;
|
||||
bool reserved = IsTileType(tile, MP_RAILWAY) ?
|
||||
HasBit(GetRailReservationTrackBits(tile), AxisToTrack(axis)) :
|
||||
|
Reference in New Issue
Block a user