diff --git a/docs/newgrf-newlandscape-nml.html b/docs/newgrf-newlandscape-nml.html index ac19b415bc..a3bfddfbc9 100644 --- a/docs/newgrf-newlandscape-nml.html +++ b/docs/newgrf-newlandscape-nml.html @@ -81,6 +81,8 @@ tile_height0..255Height of the lowest corner of the tile tile_hash0..4294967295Hash value derived from the coordinates of the tile, suitable for pseudo-randomising graphics landscape_typeNEW_LANDSCAPE_TYPE_XXXLandscape type
XXX = ROCKS + snow_present0 or 1Snow is present on this tile, at any density.
This requires new_landscape, version 2. + ground_density0..3Ground density (if snow_present is 1, this is the snow density).
This requires new_landscape, version 2.
Variables that require one or more parameters: diff --git a/docs/newgrf-newlandscape.html b/docs/newgrf-newlandscape.html index e21e81f712..ed9b2367cc 100644 --- a/docs/newgrf-newlandscape.html +++ b/docs/newgrf-newlandscape.html @@ -84,6 +84,7 @@ 42newlandscape_tile_heightTile Height 43newlandscape_tile_hashTile Hash 44newlandscape_landscape_typeLandscape Type + 45newlandscape_ground_infoGround info 60newlandscape_land_info_nearby_tilesLand info of nearby tiles @@ -110,6 +111,18 @@

Landscape type (44, or mappable variable: newlandscape_landscape_type)

The landscape type, this currently only has the value 0: rocky tiles.

+

Ground info (45, or mappable variable: newlandscape_ground_info)

+

Miscellaneous ground info + + + + +
BitsValuesMeaning
0 - 30..3Ground density (if snow is present, this is the snow density)
40 or 1Snow is present on this tile, at any density
+
+ The remaining bits are reserved for future use and should be masked.
+ This requires new_landscape, version 2.

+

+

Land info of nearby tile (60, or mappable variable: newlandscape_land_info_nearby_tiles)

This has the same value as industry tile (feature 9) variable 60.

diff --git a/src/newgrf_extension.cpp b/src/newgrf_extension.cpp index fde7c3a597..161c3ba8e1 100644 --- a/src/newgrf_extension.cpp +++ b/src/newgrf_extension.cpp @@ -157,6 +157,7 @@ extern const GRFVariableMapDefinition _grf_action2_remappable_variables[] = { GRFVariableMapDefinition(GSF_NEWLANDSCAPE, 0x42, "newlandscape_tile_height"), GRFVariableMapDefinition(GSF_NEWLANDSCAPE, 0x43, "newlandscape_tile_hash"), GRFVariableMapDefinition(GSF_NEWLANDSCAPE, 0x44, "newlandscape_landscape_type"), + GRFVariableMapDefinition(GSF_NEWLANDSCAPE, 0x45, "newlandscape_ground_info"), GRFVariableMapDefinition(GSF_NEWLANDSCAPE, 0x60, "newlandscape_land_info_nearby_tiles"), GRFVariableMapDefinition(), }; diff --git a/src/newgrf_newlandscape.cpp b/src/newgrf_newlandscape.cpp index 2301c01f2f..b394487368 100644 --- a/src/newgrf_newlandscape.cpp +++ b/src/newgrf_newlandscape.cpp @@ -49,6 +49,9 @@ std::vector _new_landscape_rocks_grfs; case 0x44: return this->landscape_type; + case 0x45: + return GetClearDensity(this->ti->tile) | (IsSnowTile(this->ti->tile) ? 0x10 : 0); + case 0x60: { TileIndex tile = this->ti->tile; if (parameter != 0) tile = GetNearbyTile(parameter, tile); // only perform if it is required diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index c886a0c253..623fb7bf00 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -1762,6 +1762,7 @@ static const NIVariable _niv_newlandscape[] = { NIV(0x42, "tile height"), NIV(0x43, "tile hash"), NIV(0x44, "landscape type"), + NIV(0x45, "ground info"), NIV(0x60, "land info of nearby tiles"), NIV_END(), };