Files
tbd-station-14/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Map.cs
Leon Friedrich 8620899a4a Fix firelock danger indicators (#12327)
* Fix firelock danger indicators

* remove unused arg
2022-11-08 13:55:45 -06:00

49 lines
1.4 KiB
C#

using Content.Server.Atmos.Components;
namespace Content.Server.Atmos.EntitySystems;
public partial class AtmosphereSystem
{
private void InitializeMap()
{
SubscribeLocalEvent<MapAtmosphereComponent, IsTileSpaceMethodEvent>(MapIsTileSpace);
SubscribeLocalEvent<MapAtmosphereComponent, GetTileMixtureMethodEvent>(MapGetTileMixture);
SubscribeLocalEvent<MapAtmosphereComponent, GetTileMixturesMethodEvent>(MapGetTileMixtures);
}
private void MapIsTileSpace(EntityUid uid, MapAtmosphereComponent component, ref IsTileSpaceMethodEvent args)
{
if (args.Handled)
return;
args.Result = component.Space;
args.Handled = true;
}
private void MapGetTileMixture(EntityUid uid, MapAtmosphereComponent component, ref GetTileMixtureMethodEvent args)
{
if (args.Handled)
return;
// Clone the mixture, if possible.
args.Mixture = component.Mixture?.Clone();
args.Handled = true;
}
private void MapGetTileMixtures(EntityUid uid, MapAtmosphereComponent component, ref GetTileMixturesMethodEvent args)
{
if (args.Handled)
return;
args.Handled = true;
args.Mixtures = new GasMixture?[args.Tiles.Count];
if (component.Mixture == null)
return;
for (var i = 0; i < args.Tiles.Count; i++)
{
args.Mixtures[i] = component.Mixture.Clone();
}
}
}