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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user