diff options
author | Erich Eckner <git@eckner.net> | 2020-05-18 21:24:36 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2022-01-16 21:58:17 +0100 |
commit | b022f8099b1cda066a243d5c4edc708cb02e86a3 (patch) | |
tree | b48d0fb539fce38a8d02fca438b51db9187f750e | |
parent | 68e1c45522d182e1496e2a99a27d986d4bb784ae (diff) | |
download | openttd-b022f8099b1cda066a243d5c4edc708cb02e86a3.tar.xz |
src/landscape.cpp: RunTileLoop() should only iterate over surface tiles
-rw-r--r-- | src/landscape.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/landscape.cpp b/src/landscape.cpp index 04896421b..b5082b247 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -809,10 +809,10 @@ void RunTileLoop() 0xD8F, 0x1296, 0x2496, 0x4357, 0x8679, 0x1030E, 0x206CD, 0x403FE, 0x807B8, 0x1004B2, 0x2006A8, 0x4004B2, 0x800B87 }; static_assert(lengthof(feedbacks) == 2 * MAX_MAP_SIZE_BITS - 2 * MIN_MAP_SIZE_BITS + 1); - const uint32 feedback = feedbacks[MapLogX() + MapLogY() - 2 * MIN_MAP_SIZE_BITS]; + const uint32 feedback = feedbacks[MapLogX() + MapLogY() - LayerCountLog() - 2 * MIN_MAP_SIZE_BITS]; /* We update every tile every 256 ticks, so divide the map size by 2^8 = 256 */ - uint count = 1 << (MapLogX() + MapLogY() - 8); + uint count = 1 << (MapLogX() + MapLogY() - LayerCountLog() - 8); TileIndex tile = _cur_tileloop_tile; /* The LFSR cannot have a zeroed state. */ |