Fix: for original terrain generator, keep a single gap of water at the borders (#7883)

This means that for NE/NW, it should have one more in case of
freeform-edges, and in case of SE/SW it should have one less.

Reminder: freeform-edges only adds VOID tiles on X=0 and Y=0.
(cherry picked from commit 1d85d71d29)
pull/211/head
SamuXarick 4 years ago committed by Jonathan G Rennison
parent cc5ccc3b45
commit aaeb36e95d

@ -879,7 +879,8 @@ static void GenerateTerrain(int type, uint flag)
uint x = r & MapMaxX();
uint y = (r >> MapLogX()) & MapMaxY();
if (x < 2 || y < 2) return;
uint edge_distance = 1 + (_settings_game.construction.freeform_edges ? 1 : 0);
if (x <= edge_distance || y <= edge_distance) return;
DiagDirection direction = (DiagDirection)GB(r, 22, 2);
uint w = templ->width;
@ -914,8 +915,8 @@ static void GenerateTerrain(int type, uint flag)
}
}
if (x + w >= MapMaxX() - 1) return;
if (y + h >= MapMaxY() - 1) return;
if (x + w >= MapMaxX()) return;
if (y + h >= MapMaxY()) return;
TileIndex tile = TileXY(x, y);

Loading…
Cancel
Save