From 59b92793a287b2b0a67863998873d980ff733359 Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Sun, 9 Jun 2024 15:25:40 -0400 Subject: [PATCH] Codechange: Shortcut calculating snow/desert coverage line at 0 or 100 percent --- src/landscape.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/landscape.cpp b/src/landscape.cpp index 121c603569..b87e917a1e 100644 --- a/src/landscape.cpp +++ b/src/landscape.cpp @@ -1452,6 +1452,10 @@ static void CreateRivers() */ static uint CalculateCoverageLine(uint coverage, uint edge_multiplier) { + /* We can take a shortcut at the extremes of the coverage. */ + if (coverage == 0) return MAX_TILE_HEIGHT; + if (coverage == 100) return 0; + const DiagDirection neighbour_dir[] = { DIAGDIR_NE, DIAGDIR_SE,