Skip to content

Commit

Permalink
Mirror: Run fixgridatmos for cargo & emergency shuttle (#361)
Browse files Browse the repository at this point in the history
## Mirror of PR #26382: [Run `fixgridatmos` for cargo & emergency
shuttle](space-wizards/space-station-14#26382)
from <img src="https://avatars.githubusercontent.com/u/10567778?v=4"
alt="space-wizards" width="22"/>
[space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14)

###### `ec761114eacdeed6e68f9c94dddfdbec8a6e26be`

PR opened by <img
src="https://avatars.githubusercontent.com/u/60421075?v=4"
width="16"/><a href="https://github.com/ElectroJr"> ElectroJr</a> at
2024-03-24 07:27:14 UTC

---

PR changed 6 files with 60 additions and 575 deletions.

The PR had the following labels:
- Status: Needs Review


---

<details open="true"><summary><h1>Original Body</h1></summary>

> This PR also changes fixgridatmos so that it trimms empty/invalid
tiles.
> 
> :cl:
> - fix: Fixed the cargo & emergency shuttle not being airtight.
> 


</details>

Signed-off-by: VMSolidus <[email protected]>
Co-authored-by: SimpleStation14 <Unknown>
Co-authored-by: VMSolidus <[email protected]>
  • Loading branch information
SimpleStation14 and VMSolidus authored May 29, 2024
1 parent b61bdca commit 23c0e98
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 575 deletions.
2 changes: 2 additions & 0 deletions Content.Client/Atmos/Overlays/AtmosDebugOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ private void DrawTooltip(DrawingHandleScreen handle, Vector2 pos, AtmosDebugOver
handle.DrawString(_font, pos, $"Map: {data.MapAtmosphere}");
pos += offset;
handle.DrawString(_font, pos, $"NoGrid: {data.NoGrid}");
pos += offset;
handle.DrawString(_font, pos, $"Immutable: {data.Immutable}");
}

private void GetGrids(MapId mapId, Box2Rotated box)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ private void OnPlayerStatusChanged(object? sender, SessionStatusEventArgs e)
tile.ExcitedGroup?.GetHashCode(),
tile.Space,
tile.MapAtmosphere,
tile.NoGridTile);
tile.NoGridTile,
tile.Air?.Immutable ?? false);
}

public override void Update(float frameTime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ private void FixGridAtmosCommand(IConsoleShell shell, string argstr, string[] ar
if (tile == null)
continue;

if (!_mapSystem.TryGetTile(gridComp, indices, out var gTile) || gTile.IsEmpty)
{
gridAtmosphere.Tiles.Remove(indices);
continue;
}

if (tile.Immutable && !IsTileSpace(euid, transform.MapUid, indices, gridComp))
{
tile = new GasMixture(tile.Volume) { Temperature = tile.Temperature };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public readonly record struct AtmosDebugOverlayData(
int? InExcitedGroup,
bool IsSpace,
bool MapAtmosphere,
bool NoGrid);
bool NoGrid,
bool Immutable);

/// <summary>
/// Invalid tiles for the gas overlay.
Expand Down
Loading

0 comments on commit 23c0e98

Please sign in to comment.