From 8731ec150c37043ec0a6a202e7aed737bb885e30 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 15 Nov 2026 14:49:14 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Accept=20empty=20tile=20filters?= =?UTF-8?q?=20in=20large=20scale=20operations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An empty tile list is a valid no-filter request, but the constructors dereferenced the empty array while reading it. --- Server/ULargeScaleOperations.pas | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Server/ULargeScaleOperations.pas b/Server/ULargeScaleOperations.pas index 29d20bc..cbb3038 100644 --- a/Server/ULargeScaleOperations.pas +++ b/Server/ULargeScaleOperations.pas @@ -255,7 +255,8 @@ begin inherited Init(AData, ALandscape); count := AData.ReadWord; SetLength(FTileIDs, count); - AData.Read(FTileIDs[0], count * SizeOf(Word)); + if count > 0 then + AData.Read(FTileIDs[0], count * SizeOf(Word)); end; procedure TLSDrawTerrain.Apply(AMapCell: TMapCell; AStatics: TStaticItemList; @@ -275,7 +276,8 @@ begin inherited Init(AData, ALandscape); count := AData.ReadWord; SetLength(FTileIDs, count); - AData.Read(FTileIDs[0], count * SizeOf(Word)); + if count > 0 then + AData.Read(FTileIDs[0], count * SizeOf(Word)); FMinZ := AData.ReadShortInt; FMaxZ := AData.ReadShortInt; end; @@ -325,7 +327,8 @@ begin inherited Init(AData, ALandscape); count := AData.ReadWord; SetLength(FTileIDs, count); - AData.Read(FTileIDs[0], count * SizeOf(Word)); + if count > 0 then + AData.Read(FTileIDs[0], count * SizeOf(Word)); FProbability := AData.ReadByte; FPlacementType := TStaticsPlacement(AData.ReadByte); if FPlacementType = spFix then