🚨 Free the block index when a landscape update fails mid-packet

This commit is contained in:
2026-11-15 22:06:51 +01:00
parent 3df6ab93f6
commit 1dc371ed27
+3
View File
@@ -770,6 +770,7 @@ var
block: TBlock;
begin
index := TGenericIndex.Create(nil);
try
while ABuffer.Position < ABuffer.Size do
begin
ABuffer.Read(coords, SizeOf(TBlockCoords));
@@ -793,7 +794,9 @@ begin
if Assigned(FOnNewBlock) then FOnNewBlock(block);
end;
finally
index.Free;
end;
end;
procedure TLandscape.OnDrawMapPacket(ABuffer: TEnhancedMemoryStream);