@@ -2,6 +2,7 @@ using Content.Shared.Hands;
|
||||
using Content.Shared.Interaction.Components;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Item;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Events;
|
||||
|
||||
namespace Content.Shared.Interaction;
|
||||
@@ -13,7 +14,7 @@ namespace Content.Shared.Interaction;
|
||||
/// </summary>
|
||||
public partial class SharedInteractionSystem
|
||||
{
|
||||
public void InitializeBlocking()
|
||||
private void InitializeBlocking()
|
||||
{
|
||||
SubscribeLocalEvent<BlockMovementComponent, UpdateCanMoveEvent>(OnMoveAttempt);
|
||||
SubscribeLocalEvent<BlockMovementComponent, UseAttemptEvent>(CancelEvent);
|
||||
@@ -34,7 +35,8 @@ public partial class SharedInteractionSystem
|
||||
|
||||
private void OnMoveAttempt(EntityUid uid, BlockMovementComponent component, UpdateCanMoveEvent args)
|
||||
{
|
||||
if (component.LifeStage > ComponentLifeStage.Running)
|
||||
// If we're relaying then don't cancel.
|
||||
if (HasComp<RelayInputMoverComponent>(uid))
|
||||
return;
|
||||
|
||||
args.Cancel(); // no more scurrying around
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.Movement.Components;
|
||||
|
||||
namespace Content.Shared.Movement.Systems;
|
||||
@@ -59,6 +60,7 @@ public abstract partial class SharedMoverController
|
||||
targetComp.Source = uid;
|
||||
Dirty(uid, component);
|
||||
Dirty(relayEntity, targetComp);
|
||||
_blocker.UpdateCanMove(uid);
|
||||
}
|
||||
|
||||
private void OnRelayShutdown(Entity<RelayInputMoverComponent> entity, ref ComponentShutdown args)
|
||||
@@ -74,6 +76,8 @@ public abstract partial class SharedMoverController
|
||||
|
||||
if (TryComp(entity.Comp.RelayEntity, out MovementRelayTargetComponent? target) && target.LifeStage <= ComponentLifeStage.Running)
|
||||
RemComp(entity.Comp.RelayEntity, target);
|
||||
|
||||
_blocker.UpdateCanMove(entity.Owner);
|
||||
}
|
||||
|
||||
private void OnTargetRelayShutdown(Entity<MovementRelayTargetComponent> entity, ref ComponentShutdown args)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Net;
|
||||
using System.Numerics;
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.Bed.Sleep;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Friction;
|
||||
@@ -38,6 +39,7 @@ public abstract partial class SharedMoverController : VirtualController
|
||||
[Dependency] private readonly IConfigurationManager _configManager = default!;
|
||||
[Dependency] protected readonly IGameTiming Timing = default!;
|
||||
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
|
||||
[Dependency] private readonly ActionBlockerSystem _blocker = default!;
|
||||
[Dependency] private readonly EntityLookupSystem _lookup = default!;
|
||||
[Dependency] private readonly InventorySystem _inventory = default!;
|
||||
[Dependency] private readonly MobStateSystem _mobState = default!;
|
||||
@@ -110,14 +112,6 @@ public abstract partial class SharedMoverController : VirtualController
|
||||
public override void UpdateAfterSolve(bool prediction, float frameTime)
|
||||
{
|
||||
base.UpdateAfterSolve(prediction, frameTime);
|
||||
|
||||
var query = AllEntityQuery<InputMoverComponent, PhysicsComponent>();
|
||||
|
||||
while (query.MoveNext(out var uid, out var _, out var physics))
|
||||
{
|
||||
//PhysicsSystem.SetLinearVelocity(uid, Vector2.Zero, body: physics);
|
||||
}
|
||||
|
||||
UsedMobMovement.Clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user