From 41284a60e4bdf6149dd6f66172b569df169a1219 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Mon, 11 Sep 2023 02:04:02 -0700 Subject: [PATCH] Fixed error when equipping the energy katana as a space ninja (#20015) --- .../UserInterface/Controls/SlotControl.cs | 3 +-- .../Weapons/Reflect/SharedReflectSystem.cs | 16 ++++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Content.Client/UserInterface/Controls/SlotControl.cs b/Content.Client/UserInterface/Controls/SlotControl.cs index bfc517dea4..4caabaa788 100644 --- a/Content.Client/UserInterface/Controls/SlotControl.cs +++ b/Content.Client/UserInterface/Controls/SlotControl.cs @@ -1,7 +1,6 @@ using System.Numerics; using Content.Client.Cooldown; using Content.Client.UserInterface.Systems.Inventory.Controls; -using Robust.Client.ResourceManagement; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Shared.Input; @@ -192,7 +191,7 @@ namespace Content.Client.UserInterface.Controls var tempQualifier = HoverSpriteView.Sprite; if (tempQualifier != null) { - IoCManager.Resolve().DeleteEntity(tempQualifier.Owner); + IoCManager.Resolve().QueueDeleteEntity(tempQualifier.Owner); } HoverSpriteView.SetEntity(null); diff --git a/Content.Shared/Weapons/Reflect/SharedReflectSystem.cs b/Content.Shared/Weapons/Reflect/SharedReflectSystem.cs index 8b68fc21d8..f6193c6898 100644 --- a/Content.Shared/Weapons/Reflect/SharedReflectSystem.cs +++ b/Content.Shared/Weapons/Reflect/SharedReflectSystem.cs @@ -4,19 +4,17 @@ using Content.Shared.Administration.Logs; using Content.Shared.Audio; using Content.Shared.Database; using Content.Shared.Hands; -using Content.Shared.Hands.Components; -using Content.Shared.Weapons.Ranged.Events; using Content.Shared.Inventory; using Content.Shared.Inventory.Events; -using Content.Shared.Item; -using Robust.Shared.Physics.Components; using Content.Shared.Popups; using Content.Shared.Projectiles; using Content.Shared.Weapons.Ranged.Components; +using Content.Shared.Weapons.Ranged.Events; using Robust.Shared.Network; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Systems; -using Robust.Shared.Prototypes; using Robust.Shared.Random; +using Robust.Shared.Timing; namespace Content.Shared.Weapons.Reflect; @@ -26,9 +24,9 @@ namespace Content.Shared.Weapons.Reflect; public abstract class SharedReflectSystem : EntitySystem { [Dependency] private readonly INetManager _netManager = default!; - [Dependency] private readonly IPrototypeManager _protoManager = default!; [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly SharedPhysicsSystem _physics = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; @@ -185,6 +183,9 @@ public abstract class SharedReflectSystem : EntitySystem private void OnReflectEquipped(EntityUid uid, ReflectComponent component, GotEquippedEvent args) { + if (_gameTiming.ApplyingState) + return; + EnsureComp(args.Equipee); } @@ -195,6 +196,9 @@ public abstract class SharedReflectSystem : EntitySystem private void OnReflectHandEquipped(EntityUid uid, ReflectComponent component, GotEquippedHandEvent args) { + if (_gameTiming.ApplyingState) + return; + EnsureComp(args.User); } -- 2.51.2