Action container rejig (#20260)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Leon Friedrich
2023-09-23 04:49:39 -04:00
committed by GitHub
parent c80c90ed65
commit 684b334806
50 changed files with 889 additions and 740 deletions

View File

@@ -23,9 +23,7 @@ namespace Content.Server.Bed.Sleep
public sealed class SleepingSystem : SharedSleepingSystem
{
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly ActionsSystem _actionsSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
@@ -182,9 +180,8 @@ namespace Content.Server.Bed.Sleep
var tryingToSleepEvent = new TryingToSleepEvent(uid);
RaiseLocalEvent(uid, ref tryingToSleepEvent);
if (tryingToSleepEvent.Cancelled) return false;
_actionsSystem.RemoveAction(uid, SleepActionId);
if (tryingToSleepEvent.Cancelled)
return false;
EnsureComp<SleepingComponent>(uid);
return true;