Ejemplo n.º 1
0
//QUAKED worldspawn (0 0 0) ?
//
//Only used for the world.
//"sky"	environment map name
//"skyaxis"	vector axis for rotating sky
//"skyrotate"	speed of rotation in degrees/second
//"sounds"	music cd track number
//"gravity"	800 is default gravity
//"message"	text to print at user logon
//========================
static void SP_worldspawn( edict_t *ent )
{
	ent->movetype = MOVETYPE_PUSH;
	ent->r.solid = SOLID_YES;
	ent->r.inuse = true;       // since the world doesn't use G_Spawn()
	VectorClear( ent->s.origin );
	VectorClear( ent->s.angles );
	GClip_SetBrushModel( ent, "*0" ); // sets mins / maxs and modelindex 1
	G_PureModel( "*0" );

	if( st.nextmap )
		Q_strncpyz( level.nextmap, st.nextmap, sizeof( level.nextmap ) );

	// make some data visible to the server
	/*
	message = trap_GetFullnameFromMapList( level.mapname );
	if( message && message[0] )
		ent->message = G_LevelCopyString( message );
	*/

	if( ent->message && ent->message[0] )
	{
		trap_ConfigString( CS_MESSAGE, ent->message );
		Q_strncpyz( level.level_name, ent->message, sizeof( level.level_name ) );
	}
	else
	{
		trap_ConfigString( CS_MESSAGE, level.mapname );
		Q_strncpyz( level.level_name, level.mapname, sizeof( level.level_name ) );
	}

	// send music
	if( st.music )
	{
		trap_ConfigString( CS_AUDIOTRACK, st.music );
		trap_PureSound( st.music );
	}

	if( st.gravity )
		level.gravity = atof( st.gravity );

	if( st.colorCorrection )
	{
		level.colorCorrection = trap_ImageIndex( st.colorCorrection );
		gs.gameState.stats[GAMESTAT_COLORCORRECTION] = level.colorCorrection;
	}
}
Ejemplo n.º 2
0
void SP_trigger_multiple( edict_t *ent )
{
	GClip_SetBrushModel( ent, ent->model );
	G_PureModel( ent->model );

	if( st.noise )
	{
		ent->noise_index = trap_SoundIndex( st.noise );
		G_PureSound( st.noise );
	}

	// gameteam field from editor
	if( st.gameteam >= TEAM_SPECTATOR && st.gameteam < GS_MAX_TEAMS )
		ent->s.team = st.gameteam;
	else
		ent->s.team = TEAM_SPECTATOR;

	if( !ent->wait )
		ent->wait = 0.2f;

	ent->touch = Touch_Multi;
	ent->movetype = MOVETYPE_NONE;
	ent->r.svflags |= SVF_NOCLIENT;

	if( ent->spawnflags & 4 )
	{
		ent->r.solid = SOLID_NOT;
		ent->use = trigger_enable;
	}
	else
	{
		ent->r.solid = SOLID_TRIGGER;
		ent->use = Use_Multi;
	}

	GClip_LinkEntity( ent );
}