Cache CanMove (#7480)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.Buckle.Components;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -9,6 +10,9 @@ namespace Content.Client.Buckle
|
||||
[ComponentReference(typeof(SharedBuckleComponent))]
|
||||
public sealed class BuckleComponent : SharedBuckleComponent
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
[Dependency] private readonly IEntitySystemManager _sysMan = default!;
|
||||
|
||||
private bool _buckled;
|
||||
private int? _originalDrawDepth;
|
||||
|
||||
@@ -30,7 +34,10 @@ namespace Content.Client.Buckle
|
||||
_buckled = buckle.Buckled;
|
||||
LastEntityBuckledTo = buckle.LastEntityBuckledTo;
|
||||
DontCollide = buckle.DontCollide;
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out SpriteComponent? ownerSprite))
|
||||
|
||||
_sysMan.GetEntitySystem<ActionBlockerSystem>().UpdateCanMove(Owner);
|
||||
|
||||
if (!_entMan.TryGetComponent(Owner, out SpriteComponent? ownerSprite))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.CharacterAppearance;
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.CharacterAppearance;
|
||||
using Content.Shared.Cuffs.Components;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
@@ -17,6 +18,7 @@ namespace Content.Client.Cuffs.Components
|
||||
private string? _currentRSI;
|
||||
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly IEntitySystemManager _sysMan = default!;
|
||||
|
||||
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
|
||||
{
|
||||
@@ -26,6 +28,7 @@ namespace Content.Client.Cuffs.Components
|
||||
}
|
||||
|
||||
CanStillInteract = cuffState.CanStillInteract;
|
||||
_sysMan.GetEntitySystem<ActionBlockerSystem>().UpdateCanMove(Owner);
|
||||
|
||||
if (_entityManager.TryGetComponent<SpriteComponent>(Owner, out var spriteComponent))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user