From 51d30d7e1cf295817361e96d2429895ac2beb0a7 Mon Sep 17 00:00:00 2001 From: J0anJosep Date: Sat, 31 Mar 2018 18:09:29 +0200 Subject: [PATCH 1/4] Fix #6805: (Doc) Road depot and stations (except rail stations and waypoints) do not use m8 for railtype. --- docs/landscape_grid.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/landscape_grid.html b/docs/landscape_grid.html index b801b334dd..cac2423438 100644 --- a/docs/landscape_grid.html +++ b/docs/landscape_grid.html @@ -173,7 +173,7 @@ the array so you can quickly see what is used and what is not. XXOO OOXX OOOO OOOO XXXO XXXX - -inherit- + OOOO OOOO OOOO OOOO 3 @@ -241,7 +241,7 @@ the array so you can quickly see what is used and what is not. ~~~~ ~XXX OOXX XOOO XXOX XXXX - -inherit- + OOOO OOOO OOOO OOOO dock @@ -254,7 +254,7 @@ the array so you can quickly see what is used and what is not. ~~~~ ~XXX OOXX XOOO OOOO OOOO - -inherit- + OOOO OOOO OOOO OOOO airport @@ -267,7 +267,7 @@ the array so you can quickly see what is used and what is not. XXXX XXXX OOXX XOOO XXXX XXXX - -inherit- + OOOO OOOO OOOO OOOO buoy @@ -280,7 +280,7 @@ the array so you can quickly see what is used and what is not. ~~~~ ~~~~ OOXX XOOO OOOO OOOO - -inherit- + OOOO OOOO OOOO OOOO oilrig @@ -293,7 +293,7 @@ the array so you can quickly see what is used and what is not. ~~~~ ~~~~ OOXX XOOO OOOO OOOO - -inherit- + OOOO OOOO OOOO OOOO 6 From 94cd6d9a7323a2ec1e25dff0e9d2c4b775f0a8d6 Mon Sep 17 00:00:00 2001 From: J0an Josep Date: Thu, 26 Jul 2018 18:00:56 +0200 Subject: [PATCH 2/4] Fix: (Doc) Use free bits and -inherit- more consistently in landscape grid. --- docs/landscape_grid.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/landscape_grid.html b/docs/landscape_grid.html index cac2423438..8519fa990a 100644 --- a/docs/landscape_grid.html +++ b/docs/landscape_grid.html @@ -93,7 +93,7 @@ the array so you can quickly see what is used and what is not. -inherit- OOOX XXOO OOOO OOOO - -inherit- + OOOO OOOO OOOO OOOO 1 @@ -156,7 +156,7 @@ the array so you can quickly see what is used and what is not. -inherit- -inherit- XXXX OOOO - -inherit- + OOOO OOOO XXXX OOOX OOXX XOOO XXXX XXXX @@ -320,7 +320,7 @@ the array so you can quickly see what is used and what is not. -inherit- OOOO OOOO OOOO OOOO - -inherit- + OOOO OOOO OOOO OOOO shipdepot @@ -333,7 +333,7 @@ the array so you can quickly see what is used and what is not. -inherit- OOOO OOOO OOOO OOOO - -inherit- + OOOO OOOO OOOO OOOO 8 @@ -368,9 +368,9 @@ the array so you can quickly see what is used and what is not. -inherit- -inherit- -inherit- + OOOO OOOO OOOO OOOO -inherit- - -inherit- - -inherit- + OOOO OOOO -inherit- OOXX XXOO -inherit- From 9cabab03b11dd1d8b3eca85f490170ced682fd06 Mon Sep 17 00:00:00 2001 From: J0an Josep Date: Fri, 27 Jul 2018 22:02:16 +0200 Subject: [PATCH 3/4] Fix #6805: Clear some m8 bits when making some tiles. --- src/clear_map.h | 2 ++ src/station_map.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/clear_map.h b/src/clear_map.h index 76b1e82d04..d24916de35 100644 --- a/src/clear_map.h +++ b/src/clear_map.h @@ -269,6 +269,7 @@ static inline void MakeClear(TileIndex t, ClearGround g, uint density) SetClearGroundDensity(t, g, density); // Sets m5 _me[t].m6 = 0; _me[t].m7 = 0; + _me[t].m8 = 0; } @@ -289,6 +290,7 @@ static inline void MakeField(TileIndex t, uint field_type, IndustryID industry) SetClearGroundDensity(t, CLEAR_FIELDS, 3); SB(_me[t].m6, 2, 4, 0); _me[t].m7 = 0; + _me[t].m8 = 0; } /** diff --git a/src/station_map.h b/src/station_map.h index 7ca9bd7204..e591787e3b 100644 --- a/src/station_map.h +++ b/src/station_map.h @@ -542,6 +542,7 @@ static inline void MakeStation(TileIndex t, Owner o, StationID sid, StationType SB(_me[t].m6, 2, 1, 0); SB(_me[t].m6, 3, 3, st); _me[t].m7 = 0; + _me[t].m8 = 0; } /** From b843373245c79e66fe48a67903ded206ed7333e5 Mon Sep 17 00:00:00 2001 From: J0an Josep Date: Sat, 28 Jul 2018 15:59:37 +0200 Subject: [PATCH 4/4] Fix #6805: Update CmdBuilRailWaypoint bits. --- src/waypoint_cmd.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp index 54489fa457..639dce13bc 100644 --- a/src/waypoint_cmd.cpp +++ b/src/waypoint_cmd.cpp @@ -148,7 +148,8 @@ extern CommandCost CanExpandRailStation(const BaseStation *st, TileArea &new_ta, * @param start_tile northern most tile where waypoint will be built * @param flags type of operation * @param p1 various bitstuffed elements - * - p1 = (bit 4) - orientation (Axis) + * - p1 = (bit 0- 5) - railtype (not used) + * - p1 = (bit 6) - orientation (Axis) * - p1 = (bit 8-15) - width of waypoint * - p1 = (bit 16-23) - height of waypoint * - p1 = (bit 24) - allow waypoints directly adjacent to other waypoints. @@ -161,7 +162,7 @@ extern CommandCost CanExpandRailStation(const BaseStation *st, TileArea &new_ta, CommandCost CmdBuildRailWaypoint(TileIndex start_tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) { /* Unpack parameters */ - Axis axis = Extract(p1); + Axis axis = Extract(p1); byte width = GB(p1, 8, 8); byte height = GB(p1, 16, 8); bool adjacent = HasBit(p1, 24);