Fix misprediction of emergency access (#25973)

The EmergencyAccess bool on the AirlockComponent would not get synced to the client

(cherry picked from commit deac5a6842a88944b06c0b4d75da751880ddf12b)
This commit is contained in:
nikthechampiongr 2024-03-11 03:50:09 +02:00 committed by Debug
parent 398f21cbf5
commit 0c5c37f3e5
No known key found for this signature in database
GPG Key ID: 271270A74EF9C350
2 changed files with 2 additions and 1 deletions

View File

@ -21,7 +21,7 @@ public sealed partial class AirlockComponent : Component
public bool Safety = true;
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
[DataField, AutoNetworkedField]
public bool EmergencyAccess = false;
/// <summary>

View File

@ -126,6 +126,7 @@ public abstract class SharedAirlockSystem : EntitySystem
public void ToggleEmergencyAccess(EntityUid uid, AirlockComponent component)
{
component.EmergencyAccess = !component.EmergencyAccess;
Dirty(uid, component); // This only runs on the server apparently so we need this.
UpdateEmergencyLightStatus(uid, component);
}