Files
RobustToolbox/Robust.Server/Player/PlayerHelpers.cs
T
2021-05-12 13:40:16 +02:00

19 lines
475 B
C#

using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
namespace Robust.Server.Player
{
public static class PlayerHelpers
{
public static IPlayerSession? PlayerSession(this IEntity? entity)
{
if (entity == null)
return null;
if (!entity.TryGetComponent(out ActorComponent? actorComponent))
return null;
return actorComponent.PlayerSession;
}
}
}