Fix firelock danger indicators (#12327)

* Fix firelock danger indicators

* remove unused arg
This commit is contained in:
Leon Friedrich
2022-11-09 08:55:45 +13:00
committed by GitHub
parent 5f71fc1ea1
commit 8620899a4a
5 changed files with 243 additions and 53 deletions

View File

@@ -89,6 +89,28 @@ public partial class AtmosphereSystem
RaiseLocalEvent(gridUid, ref ev);
}
public GasMixture?[]? GetTileMixtures(EntityUid? gridUid, EntityUid? mapUid, List<Vector2i> tiles, bool excite = false)
{
var ev = new GetTileMixturesMethodEvent(gridUid, mapUid, tiles, excite);
// If we've been passed a grid, try to let it handle it.
if (gridUid.HasValue)
RaiseLocalEvent(gridUid.Value, ref ev, false);
if (ev.Handled)
return ev.Mixtures;
// We either don't have a grid, or the event wasn't handled.
// Let the map handle it instead, and also broadcast the event.
if (mapUid.HasValue)
RaiseLocalEvent(mapUid.Value, ref ev, true);
else
RaiseLocalEvent(ref ev);
// Default to a space mixture... This is a space game, after all!
return ev.Mixtures ?? new GasMixture?[tiles.Count];
}
public GasMixture? GetTileMixture(EntityUid? gridUid, EntityUid? mapUid, Vector2i tile, bool excite = false)
{
var ev = new GetTileMixtureMethodEvent(gridUid, mapUid, tile, excite);
@@ -256,6 +278,9 @@ public partial class AtmosphereSystem
[ByRefEvent] private record struct InvalidateTileMethodEvent
(EntityUid Grid, Vector2i Tile, bool Handled = false);
[ByRefEvent] private record struct GetTileMixturesMethodEvent
(EntityUid? GridUid, EntityUid? MapUid, List<Vector2i> Tiles, bool Excite = false, GasMixture?[]? Mixtures = null, bool Handled = false);
[ByRefEvent] private record struct GetTileMixtureMethodEvent
(EntityUid? GridUid, EntityUid? MapUid, Vector2i Tile, bool Excite = false, GasMixture? Mixture = null, bool Handled = false);