qboolean G_smvCommands( gentity_t *ent, char *cmd ) {
#ifdef MV_SUPPORT
	if ( !Q_stricmp( cmd, "mvadd" ) ) {
		G_smvAdd_cmd( ent );
	} else if ( !Q_stricmp( cmd, "mvdel" ) )    {
		G_smvDel_cmd( ent );
	} else if ( !Q_stricmp( cmd, "mvallies" ) )                                                                   {
		G_smvAddTeam_cmd( ent, TEAM_ALLIES );
	} else if ( !Q_stricmp( cmd, "mvaxis" ) )                                                                                                                                                      {
		G_smvAddTeam_cmd( ent, TEAM_AXIS );
	} else if ( !Q_stricmp( cmd, "mvall" ) )                                                                                                                                                                                                                                     {
		G_smvAddTeam_cmd( ent, TEAM_ALLIES );
		G_smvAddTeam_cmd( ent, TEAM_AXIS );
	} else if ( !Q_stricmp( cmd, "mvnone" ) ) {
		if ( ent->client->pers.mvCount > 0 ) {
			G_smvRemoveInvalidClients( ent, TEAM_AXIS );
			G_smvRemoveInvalidClients( ent, TEAM_ALLIES );
		}
	} else {
		return( qfalse );
	}

	return( qtrue );

#else

	return( qfalse );

#endif

}
Example #2
0
/**
 * @brief Update specs for blackout, as needed
 * @param[in] nTeam
 * @param[in] fLock
 */
void G_updateSpecLock(int nTeam, qboolean fLock)
{
	int       i;
	gentity_t *ent;

	teamInfo[nTeam].spec_lock = fLock;
	for (i = 0; i < level.numConnectedClients; i++)
	{
		ent = g_entities + level.sortedClients[i];

		if (ent->client->sess.referee)
		{
			continue;
		}

		ent->client->sess.spec_invite &= ~nTeam;

		if (ent->client->sess.sessionTeam != TEAM_SPECTATOR)
		{
			continue;
		}

		if (!fLock)
		{
			continue;
		}

#ifdef FEATURE_MULTIVIEW
		if (ent->client->pers.mvCount > 0)
		{
			G_smvRemoveInvalidClients(ent, nTeam);
		}
		else
#endif
		if (ent->client->sess.spectatorState == SPECTATOR_FOLLOW)
		{
			StopFollowing(ent);
			ent->client->sess.spec_team &= ~nTeam;
		}

#ifdef FEATURE_MULTIVIEW
		// ClientBegin sets blackout
		if (ent->client->pers.mvCount < 1)
		{
#endif
		SetTeam(ent, "s", qtrue, -1, -1, qfalse);
#ifdef FEATURE_MULTIVIEW
	}
#endif
	}
}