diff options
author | kai <kai@zittrig.eu> | 2020-06-30 16:42:44 +0100 |
---|---|---|
committer | kai <kai@zittrig.eu> | 2020-06-30 16:42:44 +0100 |
commit | f365dbc10da16611cd43fbca234a80f5e8e39b23 (patch) | |
tree | 0b96be9f196a5a66b922c38129d6ab5b35d66280 /src | |
parent | 85de4090aaa7128c494ff66c1a87e5a445f58cde (diff) |
implement g_preventRagequit
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_admin.c | 9 | ||||
-rw-r--r-- | src/game/g_cmds.c | 11 | ||||
-rw-r--r-- | src/game/g_local.h | 1 | ||||
-rw-r--r-- | src/game/g_main.c | 2 |
4 files changed, 23 insertions, 0 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 91189eb..e79ced6 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -6797,6 +6797,15 @@ qboolean G_admin_putmespec( gentity_t *ent, int skiparg ) ADMP("!specme: disabled when game is paused\n"); return qfalse; } + + if( g_preventRagequit.integer > 0 + && ( ( ent->client->pers.teamSelection == PTE_HUMANS && level.numHumanSpawns == 0 ) + || ( ent->client->pers.teamSelection == PTE_ALIENS && level.numAlienSpawns == 0 ) ) ) + { + AP( va("print \"^3!specme: ^7%s^7 must gather their party before venturing forth from this place. " + "^3(ragequit not allowed!)\n\"", ent->client->pers.netname ) ); + return qfalse; + } if(ent->client->pers.teamSelection == PTE_NONE) return qfalse; diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index f033cc4..5810f56 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -805,7 +805,18 @@ void Cmd_Team_f( gentity_t *ent ) } if( !Q_stricmpn( s, "spec", 4 ) ) + { + if( g_preventRagequit.integer > 0 + && ( ( ent->client->pers.teamSelection == PTE_HUMANS && level.numHumanSpawns == 0 ) + || ( ent->client->pers.teamSelection == PTE_ALIENS && level.numAlienSpawns == 0 ) ) ) + { + AP( va("print \"^3!specme: ^7%s^7 must gather their party before venturing forth from this place. " + "^3(ragequit not allowed!)\n\"", ent->client->pers.netname ) ); + return; + } team = PTE_NONE; + } + else if( !force && ent->client->pers.teamSelection == PTE_NONE && g_maxGameClients.integer && level.numPlayingClients >= g_maxGameClients.integer ) diff --git a/src/game/g_local.h b/src/game/g_local.h index 7c69539..ff8cde5 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -1457,6 +1457,7 @@ extern vmCvar_t g_minDeconAffectsMark; extern vmCvar_t g_forceAutoSelect; extern vmCvar_t g_minLevelToSpecMM1; extern vmCvar_t g_banNotice; +extern vmCvar_t g_preventRagequit; extern vmCvar_t g_devmapKillerHP; extern vmCvar_t g_killerHP; diff --git a/src/game/g_main.c b/src/game/g_main.c index 742854c..2dafaff 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -181,6 +181,7 @@ vmCvar_t g_minLevelToJoinTeam; vmCvar_t g_minDeconLevel; vmCvar_t g_minDeconAffectsMark; vmCvar_t g_forceAutoSelect; +vmCvar_t g_preventRagequit; vmCvar_t g_privateMessages; vmCvar_t g_fullIgnore; @@ -428,6 +429,7 @@ static cvarTable_t gameCvarTable[ ] = { &g_minDeconAffectsMark, "g_minDeconAffectsMark", "0", CVAR_ARCHIVE, 0, qfalse}, { &g_forceAutoSelect, "g_forceAutoSelect", "0", CVAR_ARCHIVE, 0, qtrue }, { &g_adminExpireTime, "g_adminExpireTime", "0", CVAR_ARCHIVE, 0, qfalse }, + { &g_preventRagequit, "g_preventRagequit", "0", CVAR_ARCHIVE, 0, qtrue }, { &g_privateMessages, "g_privateMessages", "1", CVAR_ARCHIVE, 0, qfalse }, { &g_fullIgnore, "g_fullIgnore", "1", CVAR_ARCHIVE, 0, qtrue }, |