From 63a5bed7d8940c6c07daced31321ef99fddb42bd Mon Sep 17 00:00:00 2001
From: toaster <rollerorbital@gmail.com>
Date: Thu, 27 Oct 2022 11:54:52 +0100
Subject: [PATCH] Adjust antigrief

Instead of not running for server or admin, run for ALL players, but only avoid *kicking* local or admin players.
Fixes a bug where having a non-interacting splitscreen player could take down your server.
---
 src/p_user.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/p_user.c b/src/p_user.c
index 82e5fa3f7..5842aca8e 100644
--- a/src/p_user.c
+++ b/src/p_user.c
@@ -8523,11 +8523,6 @@ void P_PlayerThink(player_t *player)
 			const tic_t griefval = cv_antigrief.value * TICRATE;
 			const UINT8 n = player - players;
 
-		if (n != serverplayer
-#ifndef DEVELOP
-			&& !IsPlayerAdmin(n)
-#endif
-			)
 			{
 				if (player->grieftime > griefval)
 				{
@@ -8536,7 +8531,11 @@ void P_PlayerThink(player_t *player)
 
 					if (server)
 					{
-						if (player->griefstrikes > 2)
+						if ((player->griefstrikes > 2)
+#ifndef DEVELOP
+							&& !IsPlayerAdmin(n)
+#endif
+							&& !P_IsLocalPlayer(player)) // P_IsMachineLocalPlayer for DRRR
 						{
 							// Send kick
 							XBOXSTATIC UINT8 buf[2];
-- 
GitLab