Fix tile-events returns (#37502)

* Fix tile-events returns

Should really be continues.

* More

* More optimisations
This commit is contained in:
metalgearsloth
2025-05-16 22:22:20 +10:00
committed by GitHub
parent 1b79b97d2c
commit fca7337bcf
8 changed files with 34 additions and 26 deletions

View File

@@ -160,18 +160,22 @@ namespace Content.Server.Decals
private void OnTileChanged(ref TileChangedEvent args)
{
if (!TryComp(args.Entity, out DecalGridComponent? grid))
return;
var toDelete = new HashSet<uint>();
foreach (var change in args.Changes)
{
if (!change.NewTile.IsSpace(_tileDefMan))
return;
if (!TryComp(args.Entity, out DecalGridComponent? grid))
return;
continue;
var indices = GetChunkIndices(change.GridIndices);
var toDelete = new HashSet<uint>();
if (!grid.ChunkCollection.ChunkCollection.TryGetValue(indices, out var chunk))
return;
continue;
toDelete.Clear();
foreach (var (uid, decal) in chunk.Decals)
{
@@ -183,7 +187,7 @@ namespace Content.Server.Decals
}
if (toDelete.Count == 0)
return;
continue;
foreach (var decalId in toDelete)
{