Browse Source

Add `IsSpectator()` check for `EPlayer`

develop
Anton Tarasenko 1 year ago
parent
commit
001170e092
  1. 13
      sources/Players/EPlayer.uc

13
sources/Players/EPlayer.uc

@ -422,6 +422,19 @@ public final function bool IsAdmin()
return (GetAdminStatus() != AS_None); 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`. * Changes admin status of the caller `EPlayer`.
* Can only fail if caller `EPlayer` has already disconnected. * Can only fail if caller `EPlayer` has already disconnected.

Loading…
Cancel
Save