Remove invalid gas

This commit is contained in:
Vera Aguilera Puerto
2021-06-21 10:51:06 +02:00
parent 2c7720befe
commit a6a073cfdb
3 changed files with 3 additions and 4 deletions

View File

@@ -24,7 +24,7 @@ namespace Content.Server.Atmos.Piping.Other.Components
[ViewVariables(VVAccess.ReadWrite)]
[DataField("spawnGas")]
public Gas SpawnGas { get; set; } = Gas.Invalid;
public Gas? SpawnGas { get; set; } = null;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("spawnTemperature")]

View File

@@ -20,13 +20,13 @@ namespace Content.Server.Atmos.Piping.Other.EntitySystems
private void OnMinerUpdated(EntityUid uid, GasMinerComponent miner, AtmosDeviceUpdateEvent args)
{
if (!CheckMinerOperation(args.Atmosphere, miner, out var tile) || !miner.Enabled || miner.SpawnGas <= Gas.Invalid || miner.SpawnAmount <= 0f)
if (!CheckMinerOperation(args.Atmosphere, miner, out var tile) || !miner.Enabled || !miner.SpawnGas.HasValue || miner.SpawnAmount <= 0f)
return;
// Time to mine some gas.
var merger = new GasMixture(1) { Temperature = miner.SpawnTemperature };
merger.SetMoles(miner.SpawnGas, miner.SpawnAmount);
merger.SetMoles(miner.SpawnGas.Value, miner.SpawnAmount);
tile.AssumeAir(merger);
}

View File

@@ -266,7 +266,6 @@ namespace Content.Shared.Atmos
[Serializable, NetSerializable]
public enum Gas : sbyte
{
Invalid = -1,
Oxygen = 0,
Nitrogen = 1,
CarbonDioxide = 2,