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.
This commit is contained in:
toaster 2022-10-27 11:54:52 +01:00
parent c2f9a40593
commit 63a5bed7d8

View file

@ -8523,11 +8523,6 @@ void P_PlayerThink(player_t *player)
const tic_t griefval = cv_antigrief.value * TICRATE; const tic_t griefval = cv_antigrief.value * TICRATE;
const UINT8 n = player - players; const UINT8 n = player - players;
if (n != serverplayer
#ifndef DEVELOP
&& !IsPlayerAdmin(n)
#endif
)
{ {
if (player->grieftime > griefval) if (player->grieftime > griefval)
{ {
@ -8536,7 +8531,11 @@ void P_PlayerThink(player_t *player)
if (server) if (server)
{ {
if (player->griefstrikes > 2) if ((player->griefstrikes > 2)
#ifndef DEVELOP
&& !IsPlayerAdmin(n)
#endif
&& !P_IsLocalPlayer(player)) // P_IsMachineLocalPlayer for DRRR
{ {
// Send kick // Send kick
XBOXSTATIC UINT8 buf[2]; XBOXSTATIC UINT8 buf[2];