Remove invalid gas
This commit is contained in:
@@ -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")]
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -266,7 +266,6 @@ namespace Content.Shared.Atmos
|
||||
[Serializable, NetSerializable]
|
||||
public enum Gas : sbyte
|
||||
{
|
||||
Invalid = -1,
|
||||
Oxygen = 0,
|
||||
Nitrogen = 1,
|
||||
CarbonDioxide = 2,
|
||||
|
||||
Reference in New Issue
Block a user