Skip to content

Commit

Permalink
funny enumerator interference
Browse files Browse the repository at this point in the history
  • Loading branch information
rayzerbrain authored Jan 10, 2022
1 parent 303773a commit 530bd14
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Shooting-Range/EventHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,20 @@ public class EventHandlers
public List<Player> mutedPlayers = new List<Player>();
public List<Player> freshlyDead = new List<Player>();
public List<Player> rangerList = new List<Player>();

public void BringRangers()
{
List<Player> toRemoveList = new List<Player>();
foreach (Player plyr in rangerList)
{
rangerList.Remove(plyr);
toRemoveList.Add(plyr);
plyr.Broadcast(PluginMain.Instance.Config.RespawnBroadcast);
plyr.ClearInventory(true);
plyr.Role = RoleType.Spectator;
plyr.SetRole(RoleType.Spectator);
}
foreach(Player plyr in toRemoveList)
{
rangerList.Remove(plyr);
}
}

Expand Down

0 comments on commit 530bd14

Please sign in to comment.