Fix tile-events returns (#37502)

* Fix tile-events returns

Should really be continues.

* More

* More optimisations
This commit is contained in:
metalgearsloth
2025-05-18 17:55:33 +01:00
committed by deltanedas
parent e16768cb2f
commit f015a88907
8 changed files with 34 additions and 26 deletions
@@ -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