Spreaders travels across connected grids and SpreaderIgnore tag (#15419)

This commit is contained in:
metalgearsloth
2023-04-25 06:04:49 +10:00
committed by GitHub
parent 028c363608
commit 1cde3ff112
8 changed files with 85 additions and 58 deletions

View File

@@ -86,14 +86,6 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
return;
}
var xform = Transform(uid);
if (!TryComp<MapGridComponent>(xform.GridUid, out var grid))
{
RemCompDeferred<EdgeSpreaderComponent>(uid);
return;
}
var puddleQuery = GetEntityQuery<PuddleComponent>();
// For overflows, we never go to a fully evaporative tile just to avoid continuously having to mop it.
@@ -152,10 +144,10 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
spillCount = Math.Min(args.NeighborFreeTiles.Count, spillCount);
var spillAmount = overflow.Volume / spillCount;
foreach (var tile in args.NeighborFreeTiles)
foreach (var neighbor in args.NeighborFreeTiles)
{
var split = overflow.SplitSolution(spillAmount);
TrySpillAt(grid.GridTileToLocal(tile), split, out _, false);
TrySpillAt(neighbor.Grid.GridTileToLocal(neighbor.Tile), split, out _, false);
args.Updates--;
if (args.Updates <= 0)