🚨 Free the light collection when the light map update fails

This commit is contained in:
2026-11-15 22:08:32 +01:00
parent 3dd9ce1d68
commit 043a5a1ccf
+3 -1
View File
@@ -285,6 +285,7 @@ begin
{Logger.Send([lcClient, lcDebug], 'AWidth', AWidth);
Logger.Send([lcClient, lcDebug], 'AHeight', AHeight);}
lights := TWorldItemList.Create(False);
try
SetLength(tileMap, AWidth, AHeight);
for x := 0 to AWidth - 1 do
for y := 0 to AHeight - 1 do
@@ -320,8 +321,9 @@ begin
((tileMap[x,y] = nil) or (tileMap[x,y].Z < lights[i].Z + 5))) then
FLightSources.Add(TLightSource.Create(Self, lights[i]));
end;
finally
lights.Free;
end;
FValid := False;
//Logger.ExitMethod([lcClient, lcDebug], 'UpdateLightMap');