game/server/server_player.c
/*	Find a random spawn point for the entity (point_start).
*/
Find a random spawn point for the entity (point_start).
Find a random spawn point for the entity ( point_start ) .
ServerEntity_t *Player_GetSpawnEntity(ServerEntity_t *entity, int type)
{
	ServerEntity_t	*spawn;
	char			*startname;
	switch (type)
	{
	case INFO_PLAYER_DEATHMATCH:
		startname = "point_deathmatch";
		break;
	case INFO_PLAYER_CTF:
		if (entity->local.pTeam == TEAM_RED)
			startname = "point_start_red";
		else if (entity->local.pTeam == TEAM_BLUE)
			startname = "point_start_blue";
		else
		{
			Engine.Con_Warning("Unknown team type for spawn point! (%i)", entity->local.pTeam);
			return NULL;
		}
		break;
#ifdef GAME_OPENKATANA
	case INFO_PLAYER_SUPERFLY:
	case INFO_PLAYER_MIKIKO:
#endif
	default:
		startname = "point_start";
	}
	spawn = Engine.Server_FindEntity(Server.eWorld, startname, true);
	if (spawn)
		if (type == spawn->local.style)
			return spawn;
	return NULL;
}
ServerEntity_t * Player_GetSpawnEntity ( ServerEntity_t * entity , int type ) { ServerEntity_t * spawn ; char * startname ; switch ( type ) { case INFO_PLAYER_DEATHMATCH : startname = " " ; break ; case INFO_PLAYER_CTF : if ( entity -> local . pTeam == TEAM_RED ) startname = " " ; else if ( entity -> local . pTeam == TEAM_BLUE ) startname = " " ; else { Engine . Con_Warning ( " " , entity -> local . pTeam ) ; return NULL ; } break ; #ifdef GAME_OPENKATANA case INFO_PLAYER_SUPERFLY : case INFO_PLAYER_MIKIKO : #endif default : startname = " " ; } spawn = Engine . Server_FindEntity ( Server . eWorld , startname , true ) ; if ( spawn ) if ( type == spawn -> local . style ) return spawn ; return NULL ; }
Find a random spawn point for the entity (point_start).
Find a random spawn point for the entity ( point_start ) .