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

@@ -233,14 +233,14 @@ public sealed partial class ExplosionSystem
/// </summary>
private void OnTileChanged(ref TileChangedEvent ev)
{
if (!TryComp(ev.Entity, out MapGridComponent? grid))
return;
foreach (var change in ev.Changes)
{
// only need to update the grid-edge map if a tile was added or removed from the grid.
if (!change.NewTile.IsEmpty && !change.OldTile.IsEmpty)
return;
if (!TryComp(ev.Entity, out MapGridComponent? grid))
return;
continue;
if (!_gridEdges.TryGetValue(ev.Entity, out var edges))
{
@@ -265,7 +265,7 @@ public sealed partial class ExplosionSystem
}
}
return;
continue;
}
// the tile is not empty space, but was previously. So update directly adjacent neighbours, which may no longer