Reimplement anchor/unanchor delay (#11128)
This commit is contained in:
@@ -20,8 +20,8 @@ namespace Content.Server.Construction
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly PopupSystem _popup = default!;
|
||||
[Dependency] private readonly ToolSystem _toolSystem = default!;
|
||||
[Dependency] private readonly PullingSystem _pullingSystem = default!;
|
||||
[Dependency] private readonly ToolSystem _tool = default!;
|
||||
[Dependency] private readonly PullingSystem _pulling = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -85,7 +85,7 @@ namespace Content.Server.Construction
|
||||
|
||||
if (TryComp<SharedPullableComponent>(uid, out var pullable) && pullable.Puller != null)
|
||||
{
|
||||
_pullingSystem.TryStopPull(pullable);
|
||||
_pulling.TryStopPull(pullable);
|
||||
}
|
||||
|
||||
// TODO: Anchoring snaps rn anyway!
|
||||
@@ -155,6 +155,8 @@ namespace Content.Server.Construction
|
||||
else
|
||||
RaiseLocalEvent(uid, (UnanchorAttemptEvent) attempt, false);
|
||||
|
||||
anchorable.Delay += attempt.Delay;
|
||||
|
||||
if (attempt.Cancelled)
|
||||
return false;
|
||||
|
||||
@@ -192,7 +194,7 @@ namespace Content.Server.Construction
|
||||
|
||||
anchorable.CancelToken = new CancellationTokenSource();
|
||||
|
||||
_toolSystem.UseTool(usingUid, userUid, uid, 0f, anchorable.Delay, usingTool.Qualities,
|
||||
_tool.UseTool(usingUid, userUid, uid, 0f, anchorable.Delay, usingTool.Qualities,
|
||||
new TryAnchorCompletedEvent(), new TryAnchorCancelledEvent(), uid, cancelToken: anchorable.CancelToken.Token);
|
||||
}
|
||||
|
||||
@@ -215,7 +217,7 @@ namespace Content.Server.Construction
|
||||
|
||||
anchorable.CancelToken = new CancellationTokenSource();
|
||||
|
||||
_toolSystem.UseTool(usingUid, userUid, uid, 0f, anchorable.Delay, usingTool.Qualities,
|
||||
_tool.UseTool(usingUid, userUid, uid, 0f, anchorable.Delay, usingTool.Qualities,
|
||||
new TryUnanchorCompletedEvent(), new TryUnanchorCancelledEvent(), uid, cancelToken: anchorable.CancelToken.Token);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user