From 98f27ed83c92cea42c5e66326a28f24a754d8f91 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 25 Jan 2026 13:33:40 +0100 Subject: [PATCH] Fix #15166: foundations missing adjacent to NewGRF objects without foundation --- src/object_cmd.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index e1d9838518..c9492f20eb 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -449,7 +449,7 @@ static void DrawTile_Object(TileInfo *ti) /* Fall back for when the object doesn't exist anymore. */ if (!spec->IsEnabled()) type = OBJECT_TRANSMITTER; - if (!spec->flags.Test(ObjectFlag::HasNoFoundation)) DrawFoundation(ti, GetFoundation_Object(ti->tile, ti->tileh)); + DrawFoundation(ti, GetFoundation_Object(ti->tile, ti->tileh)); if (type < NEW_OBJECT_OFFSET) { const DrawTileSprites *dts = nullptr; @@ -502,7 +502,8 @@ static int GetSlopePixelZ_Object(TileIndex tile, uint x, uint y, bool) static Foundation GetFoundation_Object(TileIndex tile, Slope tileh) { - return IsObjectType(tile, OBJECT_OWNED_LAND) ? FOUNDATION_NONE : FlatteningFoundation(tileh); + const ObjectSpec *spec = ObjectSpec::Get(GetObjectType(tile)); + return spec->IsEnabled() && spec->flags.Test(ObjectFlag::HasNoFoundation) ? FOUNDATION_NONE : FlatteningFoundation(tileh); } /**