From 523f168d5ebe216acd4e21623d3c1feaee9a812d Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Fri, 26 Aug 2022 01:36:44 +1200 Subject: [PATCH] Fix two grafana errors (#10858) --- .../Components/ParticleAcceleratorControlBoxComponent.cs | 3 +++ Content.Shared/Interaction/SharedInteractionSystem.cs | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Content.Server/ParticleAccelerator/Components/ParticleAcceleratorControlBoxComponent.cs b/Content.Server/ParticleAccelerator/Components/ParticleAcceleratorControlBoxComponent.cs index 4d0eb6dfb0..d3ea1553ed 100644 --- a/Content.Server/ParticleAccelerator/Components/ParticleAcceleratorControlBoxComponent.cs +++ b/Content.Server/ParticleAccelerator/Components/ParticleAcceleratorControlBoxComponent.cs @@ -191,6 +191,9 @@ namespace Content.Server.ParticleAccelerator.Components protected override void OnRemove() { + _fireCancelTokenSrc?.Cancel(); + _fireCancelTokenSrc = null; + Master = null; foreach (var part in AllParts()) { diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index 182b0ba84f..07edf947ef 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -119,9 +119,8 @@ namespace Content.Shared.Interaction /// private void HandleInteractInventorySlotEvent(InteractInventorySlotEvent msg, EntitySessionEventArgs args) { - var coords = Transform(msg.ItemUid).Coordinates; // client sanitization - if (!ValidateClientInput(args.SenderSession, coords, msg.ItemUid, out var user)) + if (!TryComp(msg.ItemUid, out TransformComponent? itemXform) || !ValidateClientInput(args.SenderSession, itemXform.Coordinates, msg.ItemUid, out var user)) { Logger.InfoS("system.interaction", $"Inventory interaction validation failed. Session={args.SenderSession}"); return; @@ -134,7 +133,7 @@ namespace Content.Shared.Interaction if (msg.AltInteract) // Use 'UserInteraction' function - behaves as if the user alt-clicked the item in the world. - UserInteraction(user.Value, coords, msg.ItemUid, msg.AltInteract); + UserInteraction(user.Value, itemXform.Coordinates, msg.ItemUid, msg.AltInteract); else // User used 'E'. We want to activate it, not simulate clicking on the item InteractionActivate(user.Value, msg.ItemUid);