File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,6 +101,26 @@ namespace tsom
101101
102102 if (m_exteriorEnvironment)
103103 {
104+ // Release atmosphere from every area to the exterior atmosphere
105+ if (m_exteriorEnvironment && m_exteriorEntity)
106+ {
107+ auto & outsideNode = m_exteriorEntity.get <Nz::NodeComponent>();
108+ Nz::Vector3f outsidePosition = outsideNode.GetPosition ();
109+
110+ ServerAtmosphere* outsideAtmosphere = m_exteriorEnvironment->GetAtmosphereAtPosition (outsidePosition);
111+ if (outsideAtmosphere)
112+ {
113+ for (auto && [chunkIndices, chunkData] : m_chunkData)
114+ {
115+ for (const auto & area : chunkData.areas ->areas )
116+ {
117+ for (auto && [gasType, amount] : area.atmosphere .GetGasAmounts ().iter_kv ())
118+ outsideAtmosphere->IncreaseGasAmount (gasType, amount);
119+ }
120+ }
121+ }
122+ }
123+
104124 // Move every switchable entity out of the ship before destroying it (otherwise the entities will be destroyed)
105125 EnvironmentTransform outsideTransform (Nz::Vector3f::Zero (), Nz::Quaternionf::Identity ());
106126 Nz::Vector3f outsideVelocity = Nz::Vector3f::Zero ();
You can’t perform that action at this time.
0 commit comments