mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-15 14:52:35 +02:00
19 lines
475 B
C#
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;
|
|
}
|
|
}
|
|
} |