🐛 Add half of the dominant slope to effective altitude

The altitude helper halved the smaller delta instead of the dominant
one, miscalculating draw priorities on every diagonal slope.
This commit is contained in:
2026-11-15 22:06:51 +01:00
parent 3fed4cd5fc
commit b4a14683cb
+3 -3
View File
@@ -1075,10 +1075,10 @@ begin
south := GetLandAlt(ATile.X + 1, ATile.Y + 1, north);
east := GetLandAlt(ATile.X + 1, ATile.Y, north);
if Abs(north - south) >= Abs(west - east) then
Result := Min(north, south) + Abs(west - east) div 2
if Abs(north - south) > Abs(west - east) then
Result := Min(north, south) + Abs(north - south) div 2
else
Result := Min(north, south) + Abs(north - south) div 2;
Result := Min(north, south) + Abs(west - east) div 2;
end;
function TLandscape.GetLandAlt(AX, AY: Word; ADefault: ShortInt): ShortInt;