Skip to content

Commit 7ea3ccc

Browse files
fix: bug with not tracking limit of spawned players in custom roles (#585)
fixes bug with not tracking limit of spawned players Co-authored-by: TiBarification <6222472+TiBarification@users.noreply.github.com>
1 parent ac64e92 commit 7ea3ccc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

EXILED/Exiled.CustomRoles/API/Features/CustomRole.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ private void OnInternalChangingNickname(ChangingNicknameEventArgs ev)
924924

925925
private void OnInternalSpawned(SpawnedEventArgs ev)
926926
{
927-
if (!IgnoreSpawnSystem && SpawnChance > 0 && !Check(ev.Player) && ev.Player.Role.Type == Role && Loader.Random.NextDouble() * 100 <= SpawnChance)
927+
if (!IgnoreSpawnSystem && SpawnChance > 0 && !Check(ev.Player) && ev.Player.Role.Type == Role && Loader.Random.NextDouble() * 100 <= SpawnChance && (SpawnProperties.Limit == 0 || TrackedPlayers.Count < SpawnProperties.Limit))
928928
AddRole(ev.Player);
929929
}
930930

0 commit comments

Comments
 (0)