Skip to content

Commit ece0a47

Browse files
committed
fix: exclude bots and use pawn to check team
1 parent 5c54e0c commit ece0a47

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/DeadShowImage/Events.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ private HookResult OnRoundPrestart(EventRoundPrestart @event)
3737

3838
foreach (var player in deadPlayers)
3939
{
40-
if (player.Controller.Team is Team.Spectator or Team.None)
40+
if (player.IsFakeClient || !player.IsValid)
41+
{
42+
deadPlayers.Remove(player);
43+
continue;
44+
}
45+
46+
if (player.Pawn?.Team is Team.Spectator or Team.None)
4147
continue;
4248

4349
player.SendCenterHTML("", 1);

0 commit comments

Comments
 (0)