Fix pulling mispredicts (#22941)

* Fix pulling mispredicts

* Make behaviour consistent

* Good ol terminating entities
This commit is contained in:
Leon Friedrich
2023-12-25 02:33:32 -05:00
committed by GitHub
parent 9eaa4c3a5d
commit 721a445bbd
8 changed files with 42 additions and 77 deletions

View File

@@ -1,25 +1,18 @@
using System.Linq;
using System.Numerics;
using Content.Server.Popups;
using Content.Server.Pulling;
using Content.Server.Stack;
using Content.Server.Storage.EntitySystems;
using Content.Server.Stunnable;
using Content.Shared.ActionBlocker;
using Content.Shared.Body.Part;
using Content.Shared.CombatMode;
using Content.Shared.Explosion;
using Content.Shared.Hands;
using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Input;
using Content.Shared.Inventory;
using Content.Shared.Physics.Pull;
using Content.Shared.Pulling.Components;
using Content.Shared.Stacks;
using Content.Shared.Storage;
using Content.Shared.Throwing;
using Robust.Shared.Containers;
using Robust.Shared.GameStates;
using Robust.Shared.Input.Binding;
using Robust.Shared.Map;
@@ -30,16 +23,12 @@ namespace Content.Server.Hands.Systems
{
public sealed class HandsSystem : SharedHandsSystem
{
[Dependency] private readonly InventorySystem _inventorySystem = default!;
[Dependency] private readonly StackSystem _stackSystem = default!;
[Dependency] private readonly HandVirtualItemSystem _virtualItemSystem = default!;
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
[Dependency] private readonly SharedHandVirtualItemSystem _virtualSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly PullingSystem _pullingSystem = default!;
[Dependency] private readonly ThrowingSystem _throwingSystem = default!;
[Dependency] private readonly StorageSystem _storageSystem = default!;
public override void Initialize()
{
@@ -98,14 +87,6 @@ namespace Content.Server.Hands.Systems
args.Handled = true; // no shove/stun.
}
protected override void HandleEntityRemoved(EntityUid uid, HandsComponent hands, EntRemovedFromContainerMessage args)
{
base.HandleEntityRemoved(uid, hands, args);
if (!Deleted(args.Entity) && TryComp(args.Entity, out HandVirtualItemComponent? @virtual))
_virtualSystem.Delete((args.Entity, @virtual), uid);
}
private void HandleBodyPartAdded(EntityUid uid, HandsComponent component, ref BodyPartAddedEvent args)
{
if (args.Part.PartType != BodyPartType.Hand)