🚨 Free the light collection when the light map update fails
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user