mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-04 11:02:34 +01:00
Fix: Two lighthouse spawn issues (#14785)
* Fix: Lighthouses need sea to generate, not rivers * Fix: Don't spawn lighthouses close together
This commit is contained in:
@@ -769,11 +769,14 @@ static bool TryBuildLightHouse()
|
||||
}
|
||||
|
||||
/* Only build lighthouses at tiles where the border is sea. */
|
||||
if (!IsTileType(tile, MP_WATER)) return false;
|
||||
if (!IsTileType(tile, MP_WATER) || GetWaterClass(tile) != WATER_CLASS_SEA) return false;
|
||||
|
||||
for (int j = 0; j < 19; j++) {
|
||||
int h;
|
||||
if (IsTileType(tile, MP_CLEAR) && IsTileFlat(tile, &h) && h <= 2 && !IsBridgeAbove(tile)) {
|
||||
for (auto t : SpiralTileSequence(tile, 9)) {
|
||||
if (IsObjectTypeTile(t, OBJECT_LIGHTHOUSE)) return false;
|
||||
}
|
||||
BuildObject(OBJECT_LIGHTHOUSE, tile);
|
||||
assert(tile < Map::Size());
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user