Fix up antigrief

This commit is contained in:
NepDisk 2025-05-26 09:13:20 -04:00
parent c89333a924
commit 5b50bc72df
2 changed files with 18 additions and 9 deletions

View file

@ -10888,7 +10888,7 @@ void K_CheckSpectateStatus(boolean considermapreset)
return;
// Organize by spectate wait timer (if there's more than one to sort)
if (cv_maxplayers.value && numjoiners > 1)
if (cv_ingamecap.value && numjoiners > 1)
{
UINT8 oldrespawnlist[MAXPLAYERS];
memcpy(oldrespawnlist, respawnlist, numjoiners);
@ -10919,7 +10919,7 @@ void K_CheckSpectateStatus(boolean considermapreset)
for (i = 0; i < numjoiners; i++)
{
// Hit the in-game player cap while adding people?
if (cv_maxplayers.value && numingame >= cv_maxplayers.value)
if (cv_ingamecap.value && numingame >= cv_ingamecap.value)
{
if (numbots > 0)
{

View file

@ -3992,16 +3992,21 @@ void P_PlayerThink(player_t *player)
if (netgame && cv_antigrief.value != 0 && (gametyperules & GTR_CIRCUIT))
{
if (!player->spectator && !player->exiting && !(player->pflags & PF_NOCONTEST))
INT32 i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator)
continue;
if (&players[i] == player)
continue;
break;
}
if (i < MAXPLAYERS && !player->spectator && !player->exiting && !(player->pflags & PF_NOCONTEST))
{
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)
{
@ -4010,7 +4015,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
SendKick(n, KICK_MSG_GRIEF);