Cache CanMove (#7480)

This commit is contained in:
Leon Friedrich
2022-04-10 16:48:11 +12:00
committed by GitHub
parent 4135d9813b
commit 87eede8785
26 changed files with 218 additions and 109 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using Content.Server.DoAfter;
using Content.Server.Hands.Components;
using Content.Shared.ActionBlocker;
using Content.Shared.Alert;
using Content.Shared.Cuffs.Components;
using Content.Shared.Hands.EntitySystems;
@@ -112,6 +113,7 @@ namespace Content.Server.Cuffs.Components
Container.Insert(handcuff);
CanStillInteract = _entMan.TryGetComponent(Owner, out HandsComponent? ownerHands) && ownerHands.Hands.Count() > CuffedHandCount;
_sysMan.GetEntitySystem<ActionBlockerSystem>().UpdateCanMove(Owner);
OnCuffedStateChanged?.Invoke();
UpdateAlert();
@@ -267,6 +269,7 @@ namespace Content.Server.Cuffs.Components
}
CanStillInteract = _entMan.TryGetComponent(Owner, out HandsComponent? handsComponent) && handsComponent.SortedHands.Count() > CuffedHandCount;
_sysMan.GetEntitySystem<ActionBlockerSystem>().UpdateCanMove(Owner);
OnCuffedStateChanged?.Invoke();
UpdateAlert();
Dirty();