Fix two grafana errors (#10858)

This commit is contained in:
Leon Friedrich
2022-08-26 01:36:44 +12:00
committed by GitHub
parent ca7175a140
commit 523f168d5e
2 changed files with 5 additions and 3 deletions

View File

@@ -119,9 +119,8 @@ namespace Content.Shared.Interaction
/// </summary>
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);