1
0
Fork 0

Codechange: Shortcut calculating snow/desert coverage line at 0 or 100 percent

pull/12774/head
Tyler Trahan 2024-06-09 15:25:40 -04:00
parent 7db756e602
commit 59b92793a2
1 changed files with 4 additions and 0 deletions

View File

@ -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,