diff options
-rw-r--r-- | src/game/g_admin.c | 43 | ||||
-rw-r--r-- | src/game/g_local.h | 2 | ||||
-rw-r--r-- | src/game/g_main.c | 23 | ||||
-rw-r--r-- | src/game/g_team.c | 12 |
4 files changed, 44 insertions, 36 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 6329da5..bb296fa 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -1959,7 +1959,7 @@ qboolean G_admin_ban( gentity_t *ent ) if( trap_Argc() < 2 ) { - ADMP( "^3ban: usage: ban [name|slot|IP(/mask)] [duration] [reason]\n" ); + ADMP( "^3ban: ^7usage: ban [name|slot|IP(/mask)] [duration] [reason]\n" ); return qfalse; } trap_Argv( 1, search, sizeof( search ) ); @@ -3627,7 +3627,7 @@ qboolean G_admin_slap( gentity_t *ent ) if( trap_Argc() < minargc ) { - ADMP( "^3slap: ^6usage: slap [^7name|slot^7] <reason>\n" ); + ADMP( "^3slap: ^7usage: slap [^7name|slot^7] <reason>\n" ); return qfalse; } @@ -3660,28 +3660,27 @@ qboolean G_admin_slap( gentity_t *ent ) G_Knockback( vic, dir, 100 ); trap_SendServerCommand( vic-g_entities, - va( "cp \"[yesmad] %s^1 is not amused! [yesmad]:\n%s\"", - admin_name( ent )), - reason - ); - AP( va( "print \"^3slap: ^7%s^7 has been slapped by %s with the reason \"%s\"\n\"", + va( "cp \"[yesmad] %s^1 is not amused! [yesmad]\n^7%s\n\"", + admin_name( ent ), + reason ) ); + AP( va( "print \"^3slap: ^7%s^7 has been slapped by %s with the reason: ^7%s\n\"", vic->client->pers.netname, - admin_name( ent ) ) ) - ( *reason ) ? reason : "no reason specified" ); + admin_name( ent ), + ( *reason ) ? reason : "No reason specified" ) ); - vic->health -= 25; - vic->client->ps.stats[ STAT_HEALTH ] = vic->health; - vic->lastDamageTime = level.time; - if( vic->health <= 1 ) - { - vic->flags |= FL_NO_KNOCKBACK; - vic->enemy = &g_entities[ pids[ 0 ] ]; - vic->die( vic, ent, ent, 25, MOD_SLAP ); - } - else if( vic->pain ) - { - vic->pain( vic, &g_entities[ pids[ 0 ] ], 2 ); - } + vic->health -= 25; + vic->client->ps.stats[ STAT_HEALTH ] = vic->health; + vic->lastDamageTime = level.time; + if( vic->health <= 1 ) + { + vic->flags |= FL_NO_KNOCKBACK; + vic->enemy = &g_entities[ pids[ 0 ] ]; + vic->die( vic, ent, ent, 25, MOD_SLAP ); + } + else if( vic->pain ) + { + vic->pain( vic, &g_entities[ pids[ 0 ] ], 2 ); + } return qtrue; } diff --git a/src/game/g_local.h b/src/game/g_local.h index 179144c..ab19a54 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -470,7 +470,7 @@ struct gclient_s int lastCrushTime; // Tyrant crush int notrackEndTime; // Time when the current no track period ends - int blobs; + int blobs; }; diff --git a/src/game/g_main.c b/src/game/g_main.c index 11376ac..4da0808 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -1039,7 +1039,7 @@ Spawn queued clients */ void G_SpawnClients( team_t team ) { - int clientNum; + int i, clientNum; gentity_t *ent, *spawn; vec3_t spawn_origin, spawn_angles; spawnQueue_t *sq = NULL; @@ -1053,9 +1053,7 @@ void G_SpawnClients( team_t team ) !level.humanTeamLocked && !level.alienTeamLocked && level.numAlienClients-level.numHumanClients > 1 ) - { - return; - } + numSpawns = -1; } else if( team == TEAM_HUMANS ) { @@ -1065,11 +1063,26 @@ void G_SpawnClients( team_t team ) !level.humanTeamLocked && !level.alienTeamLocked && level.numHumanClients-level.numAlienClients > 1 ) + numSpawns = -1; + } + + if( numSpawns == -1 ) + { + for( i = 0; i < MAX_CLIENTS; i++ ) { + clientNum = sq->clients[ i ]; + if (clientNum == -1) continue; + ent = &g_entities[ clientNum ]; + // NOTE: Using notrackendtime for the client spawn warning counter as it gets reset on client spawn. + if ( level.time >= ent->client->notrackEndTime ) + { + trap_SendServerCommand( ent->client - level.clients, "print \"Your team has more players. Either switch to the other team or wait for someone in your team to die....\n\""); + ent->client->notrackEndTime = level.time+10000; + } return; } } - + if( G_GetSpawnQueueLength( sq ) > 0 && numSpawns > 0 ) { clientNum = G_PeekSpawnQueue( sq ); diff --git a/src/game/g_team.c b/src/game/g_team.c index fb3332b..e8a79db 100644 --- a/src/game/g_team.c +++ b/src/game/g_team.c @@ -528,7 +528,9 @@ void CheckTeamStatus( void ) } // Warn on imbalanced teams - if( g_teamImbalanceWarnings.integer && !level.intermissiontime && + if( !level.humanTeamLocked && !level.alienTeamLocked && + g_teamForceBalance.integer == 1 && + g_teamImbalanceWarnings.integer && !level.intermissiontime && ( level.time - level.lastTeamImbalancedTime > ( g_teamImbalanceWarnings.integer * 1000 ) ) && level.numTeamImbalanceWarnings < 3 && !level.restarted ) @@ -540,10 +542,7 @@ void CheckTeamStatus( void ) trap_SendServerCommand( -1, "print \"^5Teams are imbalanced. " "^5Humans have more players.\n\""); level.numTeamImbalanceWarnings++; - if ( !level.humanTeamLocked && - !level.alienTeamLocked && - g_teamForceBalance.integer == 1) - G_BalanceTeams(); + G_BalanceTeams(); } else if( level.numHumanSpawns > 0 && level.numHumanArmouries > 0 && level.numAlienClients - level.numHumanClients >= 2 ) @@ -551,9 +550,6 @@ void CheckTeamStatus( void ) trap_SendServerCommand ( -1, "print \"^5Teams are imbalanced. " "^5Aliens have more players.\n\""); level.numTeamImbalanceWarnings++; - if ( !level.humanTeamLocked && - !level.alienTeamLocked && - g_teamForceBalance.integer == 1) G_BalanceTeams(); } else |