From e8d49ebfe678b56cb307ed586019cf93a496719d Mon Sep 17 00:00:00 2001 From: Tyler Trahan Date: Mon, 17 Nov 2025 07:55:23 -0500 Subject: [PATCH] Fix: Two lighthouse spawn issues (#14785) * Fix: Lighthouses need sea to generate, not rivers * Fix: Don't spawn lighthouses close together --- src/object_cmd.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 2bb29628f9..ae74e5e5cf 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -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;