IPlayerManager refactor (#21215)
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Server.Console;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Server.Maps;
|
||||
|
||||
@@ -27,7 +26,7 @@ public sealed class GridDraggingSystem : SharedGridDraggingSystem
|
||||
|
||||
public void Toggle(ICommonSession session)
|
||||
{
|
||||
if (session is not IPlayerSession pSession)
|
||||
if (session is not { } pSession)
|
||||
return;
|
||||
|
||||
DebugTools.Assert(_admin.CanCommand(pSession, CommandName));
|
||||
@@ -52,7 +51,7 @@ public sealed class GridDraggingSystem : SharedGridDraggingSystem
|
||||
{
|
||||
var grid = GetEntity(ev.Grid);
|
||||
|
||||
if (args.SenderSession is not IPlayerSession playerSession ||
|
||||
if (args.SenderSession is not { } playerSession ||
|
||||
!_admin.CanCommand(playerSession, CommandName) ||
|
||||
!Exists(grid) ||
|
||||
Deleted(grid))
|
||||
@@ -69,7 +68,7 @@ public sealed class GridDraggingSystem : SharedGridDraggingSystem
|
||||
{
|
||||
var grid = GetEntity(msg.Grid);
|
||||
|
||||
if (args.SenderSession is not IPlayerSession playerSession ||
|
||||
if (args.SenderSession is not { } playerSession ||
|
||||
!_admin.CanCommand(playerSession, CommandName) ||
|
||||
!Exists(grid) ||
|
||||
Deleted(grid))
|
||||
|
||||
Reference in New Issue
Block a user