Inline TryGetComponent completely

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 14:05:23 +01:00
parent f3edecf994
commit 2ff4ec65d5
34 changed files with 98 additions and 84 deletions

View File

@@ -4,6 +4,7 @@ using Content.Shared.Tabletop.Events;
using Robust.Server.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using DrawDepth = Content.Shared.DrawDepth.DrawDepth;
@@ -60,11 +61,11 @@ namespace Content.Server.Tabletop
{
var draggedEntity = EntityManager.GetEntity(msg.DraggedEntityUid);
if (!draggedEntity.TryGetComponent<TabletopDraggableComponent>(out var draggableComponent)) return;
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<TabletopDraggableComponent?>(draggedEntity.Uid, out var draggableComponent)) return;
draggableComponent.DraggingPlayer = msg.DraggingPlayer;
if (!draggedEntity.TryGetComponent<AppearanceComponent>(out var appearance)) return;
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<AppearanceComponent?>(draggedEntity.Uid, out var appearance)) return;
if (draggableComponent.DraggingPlayer != null)
{