mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-25 17:46:41 +03:00
## Mirror of PR #25973: [Fix misprediction of emergency access](https://github.com/space-wizards/space-station-14/pull/25973) from <img src="https://avatars.githubusercontent.com/u/10567778?v=4" alt="space-wizards" width="22"/> [space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14) ###### `deac5a6842a88944b06c0b4d75da751880ddf12b` PR opened by <img src="https://avatars.githubusercontent.com/u/32041239?v=4" width="16"/><a href="https://github.com/nikthechampiongr"> nikthechampiongr</a> at 2024-03-10 18:09:35 UTC PR merged by <img src="https://avatars.githubusercontent.com/u/19864447?v=4" width="16"/><a href="https://github.com/web-flow"> web-flow</a> at 2024-03-11 01:50:09 UTC --- PR changed 2 files with 2 additions and 1 deletions. The PR had the following labels: --- <details open="true"><summary><h1>Original Body</h1></summary> > fixes #25800 > fixes #25900 > > <!-- Please read these guidelines before opening your PR: https://docs.spacestation14.io/en/getting-started/pr-guideline --> > <!-- The text between the arrows are comments - they will not be visible on your PR. --> > > ## About the PR > <!-- What did you change in this PR? --> > The client now actually knows when an airlock is in emergency access. > > ## Technical details > <!-- If this is a code change, summarize at high level how your new code works. This makes it easier to review. --> > The EmergencyAccess bool was not getting synced to the client. Made it AutoNetworked. Also dirtied the airlock component on the function that actually sets it since it's only called on the server when you use a remote and as such doesn't sync to the client otherwise. > > ## Media > <!-- > PRs which make ingame changes (adding clothing, items, new features, etc) are required to have media attached that showcase the changes. > Small fixes/refactors are exempt. > Any media may be used in SS14 progress reports, with clear credit given. > > If you're unsure whether your PR will require media, ask a maintainer. > > Check the box below to confirm that you have in fact seen this (put an X in the brackets, like [X]): > --> > > - [x] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase > > ## Breaking changes > <!-- > List any breaking changes, including namespace, public class/method/field changes, prototype renames; and provide instructions for fixing them. This will be pasted in #codebase-changes. > --> > > **Changelog** > <!-- > Make players aware of new features and changes that could affect how they play the game by adding a Changelog entry. Please read the Changelog guidelines located at: https://docs.spacestation14.io/en/getting-started/pr-guideline#changelog > --> > > <!-- > Make sure to take this Changelog template out of the comment block in order for it to show up. > 🆑 > - add: Added fun! > - remove: Removed fun! > - tweak: Changed fun! > - fix: Fixed fun! > --> > no cl no fun </details> Co-authored-by: nikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
150 lines
4.8 KiB
C#
150 lines
4.8 KiB
C#
using Content.Shared.DeviceLinking;
|
|
using Content.Shared.Doors.Systems;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
|
|
namespace Content.Shared.Doors.Components;
|
|
|
|
/// <summary>
|
|
/// Companion component to DoorComponent that handles airlock-specific behavior -- wires, requiring power to operate, bolts, and allowing automatic closing.
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
|
[Access(typeof(SharedAirlockSystem), Friend = AccessPermissions.ReadWriteExecute, Other = AccessPermissions.Read)]
|
|
public sealed partial class AirlockComponent : Component
|
|
{
|
|
[DataField, AutoNetworkedField]
|
|
public bool Powered;
|
|
|
|
// Need to network airlock safety state to avoid mis-predicts when a door auto-closes as the client walks through the door.
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
[DataField, AutoNetworkedField]
|
|
public bool Safety = true;
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
[DataField, AutoNetworkedField]
|
|
public bool EmergencyAccess = false;
|
|
|
|
/// <summary>
|
|
/// Pry modifier for a powered airlock.
|
|
/// Most anything that can pry powered has a pry speed bonus,
|
|
/// so this default is closer to 6 effectively on e.g. jaws (9 seconds when applied to other default.)
|
|
/// </summary>
|
|
[DataField]
|
|
public float PoweredPryModifier = 9f;
|
|
|
|
/// <summary>
|
|
/// Whether the maintenance panel should be visible even if the airlock is opened.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool OpenPanelVisible = false;
|
|
|
|
/// <summary>
|
|
/// Whether the airlock should stay open if the airlock was clicked.
|
|
/// If the airlock was bumped into it will still auto close.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool KeepOpenIfClicked = false;
|
|
|
|
/// <summary>
|
|
/// Whether the airlock should auto close. This value is reset every time the airlock closes.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public bool AutoClose = true;
|
|
|
|
/// <summary>
|
|
/// Delay until an open door automatically closes.
|
|
/// </summary>
|
|
[DataField]
|
|
public TimeSpan AutoCloseDelay = TimeSpan.FromSeconds(5f);
|
|
|
|
/// <summary>
|
|
/// Multiplicative modifier for the auto-close delay. Can be modified by hacking the airlock wires. Setting to
|
|
/// zero will disable auto-closing.
|
|
/// </summary>
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public float AutoCloseDelayModifier = 1.0f;
|
|
|
|
/// <summary>
|
|
/// The receiver port for turning off automatic closing.
|
|
/// </summary>
|
|
[DataField(customTypeSerializer: typeof(PrototypeIdSerializer<SinkPortPrototype>))]
|
|
public string AutoClosePort = "AutoClose";
|
|
|
|
#region Graphics
|
|
|
|
/// <summary>
|
|
/// Whether the door lights should be visible.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool OpenUnlitVisible = false;
|
|
|
|
/// <summary>
|
|
/// Whether the door should display emergency access lights.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool EmergencyAccessLayer = true;
|
|
|
|
/// <summary>
|
|
/// Whether or not to animate the panel when the door opens or closes.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool AnimatePanel = true;
|
|
|
|
/// <summary>
|
|
/// The sprite state used to animate the airlock frame when the airlock opens.
|
|
/// </summary>
|
|
[DataField]
|
|
public string OpeningSpriteState = "opening_unlit";
|
|
|
|
/// <summary>
|
|
/// The sprite state used to animate the airlock panel when the airlock opens.
|
|
/// </summary>
|
|
[DataField]
|
|
public string OpeningPanelSpriteState = "panel_opening";
|
|
|
|
/// <summary>
|
|
/// The sprite state used to animate the airlock frame when the airlock closes.
|
|
/// </summary>
|
|
[DataField]
|
|
public string ClosingSpriteState = "closing_unlit";
|
|
|
|
/// <summary>
|
|
/// The sprite state used to animate the airlock panel when the airlock closes.
|
|
/// </summary>
|
|
[DataField]
|
|
public string ClosingPanelSpriteState = "panel_closing";
|
|
|
|
/// <summary>
|
|
/// The sprite state used for the open airlock lights.
|
|
/// </summary>
|
|
[DataField]
|
|
public string OpenSpriteState = "open_unlit";
|
|
|
|
/// <summary>
|
|
/// The sprite state used for the closed airlock lights.
|
|
/// </summary>
|
|
[DataField]
|
|
public string ClosedSpriteState = "closed_unlit";
|
|
|
|
/// <summary>
|
|
/// The sprite state used for the 'access denied' lights animation.
|
|
/// </summary>
|
|
[DataField]
|
|
public string DenySpriteState = "deny_unlit";
|
|
|
|
/// <summary>
|
|
/// How long the animation played when the airlock denies access is in seconds.
|
|
/// </summary>
|
|
[DataField]
|
|
public float DenyAnimationTime = 0.3f;
|
|
|
|
/// <summary>
|
|
/// Pry modifier for a bolted airlock.
|
|
/// Currently only zombies can pry bolted airlocks.
|
|
/// </summary>
|
|
[DataField]
|
|
public float BoltedPryModifier = 3f;
|
|
|
|
#endregion Graphics
|
|
}
|