diff --git a/docs/landscape.html b/docs/landscape.html index f592cd0f6a..5ef3a9f457 100644 --- a/docs/landscape.html +++ b/docs/landscape.html @@ -990,9 +990,9 @@
  • m6 bit 7: rail station / waypoint may have catenary pylons
  • -
  • m6 bit 6: rail station / waypoint may have catenary wires
  • -
  • m6 bits 5..3: the station type (rail, airport, truck, bus, oilrig, dock, buoy, waypoint)
  • +
  • m6 bits 6..3: the station type (rail, airport, truck, bus, oilrig, dock, buoy, waypoint)
  • m6 bit 2: pbs reservation state for railway stations/waypoints
  • +
  • m6 bit 1: rail station / waypoint may have catenary wires
  • m6 bit 0: rail station / waypoint is blocked
  • m7 bits 4..0: owner of road (road stops)
  • diff --git a/docs/landscape_grid.html b/docs/landscape_grid.html index a0fa527a6b..5db1bbdd05 100644 --- a/docs/landscape_grid.html +++ b/docs/landscape_grid.html @@ -188,7 +188,7 @@ the array so you can quickly see what is used and what is not. XXXX OOOO XXXX XXXX XXXX XXXX - XXXXX XOX + XXXXX XXX XXXX XXXX OOOO OOOO OOXX XXXX @@ -201,7 +201,7 @@ the array so you can quickly see what is used and what is not. XXXX OOOO OOXX XXXX OOOO OXXX - OOXX XOOO + OXXX XOOO OOOX XXXX OOOO XXXX XX XXXXXX diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 43f9c79253..371b03dd4e 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -907,6 +907,15 @@ bool AfterLoadGame() } } + if (IsSavegameVersionBeforeOrAt(SLV_VEHICLE_ECONOMY_AGE)) { + /* Expansion of station type field in m6 */ + for (auto t : Map::Iterate()) { + if (IsTileType(t, MP_STATION)) { + ClrBit(t.m6(), 6); + } + } + } + for (auto t : Map::Iterate()) { switch (GetTileType(t)) { case MP_STATION: { diff --git a/src/station_map.h b/src/station_map.h index 34228e9ecf..42f415e822 100644 --- a/src/station_map.h +++ b/src/station_map.h @@ -44,7 +44,7 @@ static const int GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET = 4; ///< The offset for the inline StationType GetStationType(Tile t) { assert(IsTileType(t, MP_STATION)); - return (StationType)GB(t.m6(), 3, 3); + return (StationType)GB(t.m6(), 3, 4); } /** @@ -362,7 +362,7 @@ inline void SetStationTileBlocked(Tile t, bool b) inline bool CanStationTileHaveWires(Tile t) { assert(HasStationRail(t)); - return HasBit(t.m6(), 6); + return HasBit(t.m6(), 1); } /** @@ -374,7 +374,7 @@ inline bool CanStationTileHaveWires(Tile t) inline void SetStationTileHaveWires(Tile t, bool b) { assert(HasStationRail(t)); - SB(t.m6(), 6, 1, b ? 1 : 0); + SB(t.m6(), 1, 1, b ? 1 : 0); } /** @@ -632,7 +632,7 @@ inline void MakeStation(Tile t, Owner o, StationID sid, StationType st, uint8_t t.m4() = 0; t.m5() = section; SB(t.m6(), 2, 1, 0); - SB(t.m6(), 3, 3, st); + SB(t.m6(), 3, 4, st); t.m7() = 0; t.m8() = 0; }