expedition air mod (#17369)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-06-16 05:25:25 +00:00
committed by GitHub
parent f0896685ff
commit 41fae6e9cd
6 changed files with 181 additions and 11 deletions

View File

@@ -105,14 +105,15 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
_entManager.Dirty(gravity, metadata);
// Atmos
var atmos = _entManager.EnsureComponent<MapAtmosphereComponent>(mapUid);
atmos.Space = false;
var air = _prototypeManager.Index<SalvageAirMod>(mission.Air);
// copy into a new array since the yml deserialization discards the fixed length
var moles = new float[Atmospherics.AdjustedNumberOfGases];
moles[(int) Gas.Oxygen] = 21.824779f;
moles[(int) Gas.Nitrogen] = 82.10312f;
air.Gases.CopyTo(moles, 0);
var atmos = _entManager.EnsureComponent<MapAtmosphereComponent>(mapUid);
atmos.Space = air.Space;
atmos.Mixture = new GasMixture(2500)
{
// TODO: temperature mods
Temperature = 293.15f,
Moles = moles,
};