Programmable block: Air vent IMyAirVent.Status is never set to VentStatus.Depressurized

Garbius shared this bug 7 months ago
Considered

When monitoring IMyAirVent.Status, it will never attain the VentState.Depressurized state. It will go from VentState.Pressurized to VentState.Depressurizing and remain at that value, even if room pressure is 0%, until the room is pressurizing, at which point it will be VentState.Pressurizing and then VentState.Pressurized when it is fully pressurized.

This behavior is regardless of whether the room is airtight or not.

Comments (2)

photo
1

Hello, Engineer!


Thank you for your feedback! Your topic has been added between considered issues.


We will address all reported issues during future development and we will attempt to fix your issue as soon as possible. We are currently close to a Major release, which is under heavy development and this takes up a lot of our time.


Please keep voting for the issue as it will help us to identify the most serious bugs.


We really appreciate your patience.


Kind Regards


Keen Software House: QA Department

photo
1

private void UpdateStatus()
{
MyOxygenBlock oxygenBlock = this.GetOxygenBlock();
if (oxygenBlock == null || oxygenBlock.Room == null)
{
this.Status = VentStatus.Depressurized;
}
else if (oxygenBlock.Room.IsAirtight)
{
if (oxygenBlock.Room.OxygenLevel(base.CubeGrid.GridSize) >= 1f)
{
if (Sync.IsServer && MyVisualScriptLogicProvider.RoomFullyPressurized != null && this.Status != VentStatus.Pressurized)
{
MyVisualScriptLogicProvider.RoomFullyPressurized(base.EntityId, base.CubeGrid.EntityId, this.Name, base.CubeGrid.Name);
}
this.Status = VentStatus.Pressurized;
}
else if (oxygenBlock.Room.OxygenLevel(base.CubeGrid.GridSize) > 0.01f)
{
this.Status = (this.IsDepressurizing ? VentStatus.Depressurizing : VentStatus.Pressurizing);
}
else
{
this.Status = VentStatus.Depressurized;
}
}
else
{
this.Status = VentStatus.Depressurized;
}
this.CheckEmissiveState(false);
}
Try replacing SpaceEngineers.Game.Entities.Blocks.MyAirVent.UpdateStatus() with this. Edit: Added the code as an attachment with preserved indentation.