diff --git a/sources/Players/EPlayer.uc b/sources/Players/EPlayer.uc index 8eed122..bb2f928 100644 --- a/sources/Players/EPlayer.uc +++ b/sources/Players/EPlayer.uc @@ -422,6 +422,19 @@ public final function bool IsAdmin() return (GetAdminStatus() != AS_None); } +/// Checks if player is a spectator, i.e. observes game without actively +/// participating. +public final function bool IsSpectator() +{ + local PlayerReplicationInfo myReplicationInfo; + + myReplicationInfo = GetRI(); + if (myReplicationInfo == none) { + return true; + } + return myReplicationInfo.bOnlySpectator; +} + /** * Changes admin status of the caller `EPlayer`. * Can only fail if caller `EPlayer` has already disconnected.