Skip to content

Commit

Permalink
Road stops: Add tile slope to varact2 variable 0x42
Browse files Browse the repository at this point in the history
  • Loading branch information
JGRennison committed Oct 15, 2023
1 parent b965498 commit 39247b0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions docs/newgrf-roadstops.html
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,17 @@ <h4 id="roadstop_type">Road stop type (41, or mappable variable: roadstop_type)<
</p>

<h4 id="roadstop_terrain_type">Road stop tile terrain type (42, or mappable variable: roadstop_terrain_type)</h4>
<p>This has the same value as bits 0 - 7 of <a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/Objects#Tile_information_.2841.29">object (feature F) variable 41</a>.
<p>This has the same value as bits 0 - 15 of <a href="https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/Objects#Tile_information_.2841.29">object (feature F) variable 41</a>.
<table>
<tr><th>Value</th><th>Meaning</th></tr>
<tr><th>Bit</th><th>Meaning</th></tr>
<tr><td>0</td><td>Normal</td></tr>
<tr><td>1</td><td>Desert</td></tr>
<tr><td>2</td><td>Rainforest</td></tr>
<tr><td>4</td><td>On or above snowline</td></tr>
<tr><td>8 - 15</td><td>
Tile slope<br />
This requires <font face="monospace">road_stops</font>, version 10.
</td></tr>
</table>
</p>

Expand Down
2 changes: 1 addition & 1 deletion src/newgrf_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ extern const GRFFeatureInfo _grf_feature_list[] = {
GRFFeatureInfo("action0_object_flood_resistant", 1),
GRFFeatureInfo("action0_object_viewport_map_tile_type", 1),
GRFFeatureInfo("varaction2_airporttiles_airport_info", 1),
GRFFeatureInfo("road_stops", 9, GFTOF_ROAD_STOPS),
GRFFeatureInfo("road_stops", 10, GFTOF_ROAD_STOPS),
GRFFeatureInfo("new_landscape", 2),
GRFFeatureInfo("more_objects_per_grf", 1),
GRFFeatureInfo("more_action2_ids", 1, GFTOF_MORE_ACTION2_IDS),
Expand Down
2 changes: 1 addition & 1 deletion src/newgrf_roadstop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ uint32 RoadStopScopeResolver::GetVariable(uint16 variable, uint32 parameter, Get
return 2;

/* Terrain type */
case 0x42: return this->tile == INVALID_TILE ? 0 : GetTerrainType(this->tile, TCX_NORMAL); // terrain_type
case 0x42: return this->tile == INVALID_TILE ? 0 : (GetTileSlope(this->tile) << 8 | GetTerrainType(this->tile, TCX_NORMAL));

/* Road type */
case 0x43: return get_road_type_variable(RTT_ROAD);
Expand Down

0 comments on commit 39247b0

Please sign in to comment.