diff --git a/docs/sdk/scenario/scenario.xml b/docs/sdk/scenario/scenario.xml
index 5c4bceff4..755b7cde1 100644
--- a/docs/sdk/scenario/scenario.xml
+++ b/docs/sdk/scenario/scenario.xml
@@ -248,7 +248,7 @@
AutoScanSideOpen
Integer
- 0 or 1. If 1, the left and right borders are closed if the corresponding map pixel in the left or right row has tunnel background and open otherwise.
+ 0, 1, or 2. If 1, the left and right borders are closed if the corresponding map pixel in the left or right row has non-sky foreground or background and open otherwise. If 2, it only checks the background.
MapWidth
diff --git a/src/landscape/C4Landscape.cpp b/src/landscape/C4Landscape.cpp
index aafdc0639..a119eba06 100644
--- a/src/landscape/C4Landscape.cpp
+++ b/src/landscape/C4Landscape.cpp
@@ -2072,14 +2072,19 @@ bool C4Landscape::P::InitBorderPix()
if (Game.C4S.Landscape.AutoScanSideOpen)
{
+ // Compatibility: check both foreground and background material per
+ // default, Top/BottomOpen=2-like behavior with AutoScanSideOpen=2.
+ bool only_bg = Game.C4S.Landscape.AutoScanSideOpen == 2;
LeftColPix.resize(Height);
RightColPix.resize(Height);
uint8_t map_pix;
for (int32_t y = 0; y < Height; ++y)
{
map_pix = MapBkg->GetPix(0, y / MapZoom);
+ if (!only_bg) map_pix += Map->GetPix(0, y / MapZoom);
LeftColPix[y] = ((map_pix != 0) ? MCVehic : 0);
map_pix = MapBkg->GetPix(Map->Wdt - 1, y / MapZoom);
+ if (!only_bg) map_pix += Map->GetPix(Map->Wdt - 1, y / MapZoom);
RightColPix[y] = ((map_pix != 0) ? MCVehic : 0);
}
}