diff --git a/docs/newgrf-roadstops-nml.html b/docs/newgrf-roadstops-nml.html
index 90997bfa02..9c31a12eda 100644
--- a/docs/newgrf-roadstops-nml.html
+++ b/docs/newgrf-roadstops-nml.html
@@ -119,6 +119,7 @@
animation_frame | 0..255 | Animation frame of the current tile |
waiting_triggers | 0..255 | Waiting triggers |
random_bits | 0..16777215 | Random bits |
+ one_way_info | RST_OWI_XXX | One-way road information of drive-through stop tile XXX = TWO_WAY | NORTH_BOUND | SOUTH_BOUND | NO_ENTRY |
Variables that require one or more parameters:
@@ -142,6 +143,7 @@
nearby_tile_view | x, y offset (-8..7) | 0..5 | The view/rotation of a nearby road stop tile |
nearby_tile_stop_type | x, y offset (-8..7) | RST_TYPE_XXX | See stop_type |
nearby_tile_same_stop_type | x, y offset (-8..7) | 0 | 1 | Is the stop type of a nearby road stop tile the same as this tile? |
+ nearby_tile_one_way_info | x, y offset (-8..7) | RST_OWI_XXX | One-way state of nearby drive-through road stop tile |
nearby_tile_road_stop_info | x, y offset (-8..7) | | Above nearby road stop tile variables in one variable (all of variable 0x68) |
nearby_tile_grfid | x, y offset (-8..7) | -1, 0 or a GRFID | Return value is -1 if the tile is not a road stop, 0 if the tile is a non-custom road stop, or else the GRFID of the NewGRF defining the road stop |
diff --git a/docs/newgrf-roadstops.html b/docs/newgrf-roadstops.html
index 5816e3ce2f..903dbadbaa 100644
--- a/docs/newgrf-roadstops.html
+++ b/docs/newgrf-roadstops.html
@@ -208,6 +208,7 @@
47 | roadstop_company_info | Player/company info |
48 | | Bitmask of accepted cargoes (BaseStation) |
49 | roadstop_animation_frame | Current animation frame |
+ 50 | roadstop_misc_info | Miscellaneous info |
60 | | Amount of cargo waiting (BaseStation) |
61 | | Time since last cargo pickup (BaseStation) |
62 | | Rating of cargo (BaseStation) |
@@ -269,6 +270,22 @@
Current animation frame (49, or mappable variable: roadstop_animation_frame)
This has the same value as station (feature 4) variable 4A.
+ Miscellaneous road stop info (50, or mappable variable: roadstop_misc_info)
+ The town used is the one associated with the station/waypoint (this is in the station/waypoint name by default).
+
+ Bits | Meaning |
+ 0 - 1 |
+ One-way road information:
+ 0 - Two-way traffic
+ 1 - North-bound only
+ 2 - South-bound only
+ 3 - No entry
+ |
+
+
+ The remaining bits are reserved for future use and should be masked.
+
+
Animation frame of nearby tile (66, or mappable variable: roadstop_animation_frame_nearby_tiles)
This has the same value as station (feature 4) variable 66.
@@ -295,6 +312,12 @@
2 - Road waypoint
20 | Set if the stop type (passenger/bus, freight/lorry or road waypoint) is the same as the current tile |
+ 21 - 22 |
+ One-way road information of the selected tile:
+ 0 - Two-way traffic
+ 1 - North-bound only
+ 2 - South-bound only
+ 3 - No entry
The remaining bits are reserved for future use and should be masked.
diff --git a/src/newgrf_extension.cpp b/src/newgrf_extension.cpp
index af67203680..74ddbb1275 100644
--- a/src/newgrf_extension.cpp
+++ b/src/newgrf_extension.cpp
@@ -120,6 +120,7 @@ extern const GRFVariableMapDefinition _grf_action2_remappable_variables[] = {
GRFVariableMapDefinition(GSF_ROADSTOPS, 0x46, "roadstop_town_distance_squared"),
GRFVariableMapDefinition(GSF_ROADSTOPS, 0x47, "roadstop_company_info"),
GRFVariableMapDefinition(GSF_ROADSTOPS, 0x49, "roadstop_animation_frame"),
+ GRFVariableMapDefinition(GSF_ROADSTOPS, 0x50, "roadstop_misc_info"),
GRFVariableMapDefinition(GSF_ROADSTOPS, 0x66, "roadstop_animation_frame_nearby_tiles"),
GRFVariableMapDefinition(GSF_ROADSTOPS, 0x67, "roadstop_land_info_nearby_tiles"),
GRFVariableMapDefinition(GSF_ROADSTOPS, 0x68, "roadstop_road_stop_info_nearby_tiles"),
diff --git a/src/newgrf_roadstop.cpp b/src/newgrf_roadstop.cpp
index c0045dab47..041804454e 100644
--- a/src/newgrf_roadstop.cpp
+++ b/src/newgrf_roadstop.cpp
@@ -121,6 +121,15 @@ uint32 RoadStopScopeResolver::GetVariable(uint16 variable, uint32 parameter, Get
/* Animation frame */
case 0x49: return this->tile == INVALID_TILE ? 0 : this->st->GetRoadStopAnimationFrame(this->tile);
+ /* Misc info */
+ case 0x50: {
+ uint32 result = 0;
+ if (this->tile != INVALID_TILE) {
+ if (IsDriveThroughStopTile(this->tile)) result |= GetDriveThroughStopDisallowedRoadDirections(this->tile);
+ }
+ return result;
+ }
+
/* Variables which use the parameter */
/* Variables 0x60 to 0x65 and 0x69 are handled separately below */
@@ -160,6 +169,9 @@ uint32 RoadStopScopeResolver::GetVariable(uint16 variable, uint32 parameter, Get
const RoadStopSpecList ssl = BaseStation::GetByTile(nearby_tile)->roadstop_speclist[GetCustomRoadStopSpecIndex(nearby_tile)];
res |= 1 << (ssl.grfid != grfid ? 9 : 8) | ssl.localidx;
}
+ if (IsDriveThroughStopTile(nearby_tile)) {
+ res |= (GetDriveThroughStopDisallowedRoadDirections(nearby_tile) << 21);
+ }
return res;
}
diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h
index 5e3f70ac37..1558f13873 100644
--- a/src/table/newgrf_debug_data.h
+++ b/src/table/newgrf_debug_data.h
@@ -1391,6 +1391,7 @@ static const NIVariable _nif_roadstops[] = {
NIV(0x47, "player info"),
NIV(0x48, "bitmask of accepted cargoes"),
NIV(0x49, "current animation frame"),
+ NIV(0x50, "miscellaneous info"),
NIV(0x60, "amount of cargo waiting"),
NIV(0x61, "time since last cargo pickup"),
NIV(0x62, "rating of cargo"),
|