* OH YES

* хули мне хедкодеру
# Conflicts:
#	Content.Server/Instruments/InstrumentComponent.cs
#	Content.Server/Instruments/InstrumentSystem.cs
#	Content.Shared/Cuffs/SharedCuffableSystem.cs
#	Content.Shared/White/WhiteCVars.cs
#	Resources/Prototypes/tags.yml
This commit is contained in:
rhailrake
2023-05-25 02:13:10 +06:00
committed by Remuchi
parent 10609a2506
commit 484c8a8d9b
24 changed files with 939 additions and 6 deletions

View File

@@ -3,7 +3,6 @@ using Content.Shared.ActionBlocker;
using Content.Shared.Administration.Components;
using Content.Shared.Administration.Logs;
using Content.Shared.Alert;
using Content.Shared.Atmos.Piping.Unary.Components;
using Content.Shared.Buckle.Components;
using Content.Shared.Cuffs.Components;
using Content.Shared.Damage;
@@ -29,12 +28,13 @@ using Content.Shared.Rejuvenate;
using Content.Shared.Stunnable;
using Content.Shared.Verbs;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Content.Shared.White.EndOfRoundStats.CuffedTime;
using Robust.Shared.Containers;
using Robust.Shared.Network;
using Robust.Shared.Player;
using Robust.Shared.Serialization;
using Robust.Shared.Timing;
namespace Content.Shared.Cuffs
{
@@ -57,6 +57,7 @@ namespace Content.Shared.Cuffs
[Dependency] private readonly SharedInteractionSystem _interaction = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!; // Parkstation-EndOfRoundStats
public override void Initialize()
{
@@ -450,6 +451,10 @@ namespace Content.Shared.Cuffs
_container.Insert(handcuff, component.Container);
UpdateHeldItems(target, handcuff, component);
if (_net.IsServer)
component.CuffedTime = _gameTiming.CurTime;
return true;
}
@@ -637,6 +642,12 @@ namespace Content.Shared.Cuffs
_container.Remove(cuffsToRemove, cuffable.Container);
if (_net.IsServer && cuffable.CuffedTime != null)
{
RaiseLocalEvent(target, new CuffedTimeStatEvent(_gameTiming.CurTime - cuffable.CuffedTime.Value));
cuffable.CuffedTime = null;
}
if (_net.IsServer)
{
// Handles spawning broken cuffs on server to avoid client misprediction