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