Cached barotrauma resistance and immunity values instead of computing them each Update() (#15055)

This commit is contained in:
Menshin
2023-04-30 19:58:26 +02:00
committed by GitHub
parent 6492315344
commit 76903dd145
2 changed files with 122 additions and 90 deletions

View File

@@ -26,6 +26,25 @@ namespace Content.Server.Atmos.Components
/// These are the inventory slots that are checked for pressure protection. If a slot is missing protection, no protection is applied.
/// </summary>
[DataField("protectionSlots")]
public List<string> ProtectionSlots = new() { "head", "outerClothing" };
public List<string> ProtectionSlots = new() { "head", "outerClothing" };
/// <summary>
/// Cached pressure protection values
/// </summary>
[ViewVariables]
public float HighPressureMultiplier = 1f;
[ViewVariables]
public float HighPressureModifier = 0f;
[ViewVariables]
public float LowPressureMultiplier = 1f;
[ViewVariables]
public float LowPressureModifier = 0f;
/// <summary>
/// Whether the entity is immuned to pressure (i.e possess the PressureImmunity component)
/// </summary>
[ViewVariables]
public bool HasImmunity = false;
}
}