From b4a14683cb867fa51ede135391dcb3fa2be4cf19 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 15 Nov 2026 09:03:47 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Add=20half=20of=20the=20dominant?= =?UTF-8?q?=20slope=20to=20effective=20altitude?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The altitude helper halved the smaller delta instead of the dominant one, miscalculating draw priorities on every diagonal slope. --- Client/ULandscape.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Client/ULandscape.pas b/Client/ULandscape.pas index 37b1f42..4dca1b4 100644 --- a/Client/ULandscape.pas +++ b/Client/ULandscape.pas @@ -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;