client.qc excerpt:
Quote:
/*
============
SelectSpawnPoint
Returns the entity to spawn at
============
*/
entity ()
SelectSpawnPoint =
{
local entity spot;
// testinfo_player_start is only found in regioned levels
spot = find (world, classname, "testplayerstart");
if (spot)
return spot;
// choose a info_player_deathmatch point
if (coop)
{
lastspawn = find (lastspawn, classname, "info_player_coop");
if (lastspawn == world)
lastspawn = find (lastspawn, classname, "info_player_start");
if (lastspawn != world)
return lastspawn;
}
else if (deathmatch & DM_DM_MASK)
{
// If all the spawn spots are taken, try spawning on
// weapons, health and ammo boxes. This isn't perfect
// in that some of these are in rooms which start out
// closed. I use weapons first because I suspect there
// are fewer of these with that problem.
// I would eventually like to create spawn spots for standard maps,
// and modify the map to restrict certain areaa. For now, I will
// use the RA method of info_teleport_destinations.
if (mode_arena () && MAP_IS_CUSTOM)
{
spot = find_spawn_point_class ("info_teleport_destination", lastspawn);
if (spot)
{
lastspawn = spot;
return spot;
}
}
spot = find_spawn_point_class ("info_player_deathmatch", lastspawn);
if (!spot)
spot = find_spawn_point_class ("weapon_supershotgun", lastspawn);
if (!spot)
spot = find_spawn_point_class ("weapon_nailgun", lastspawn);
if (!spot)
spot = find_spawn_point_class ("weapon_supernailgun", lastspawn);
if (!spot)
spot = find_spawn_point_class ("weapon_grenadelauncher", lastspawn);
if (!spot)
spot = find_spawn_point_class ("weapon_rocketlauncher", lastspawn);
if (!spot)
spot = find_spawn_point_class ("weapon_lightning", lastspawn);
if (!spot)
spot = find_spawn_point_class ("item_health", lastspawn);
if (!spot)
spot = find_spawn_point_class ("item_shells", lastspawn);
if (!spot)
spot = find_spawn_point_class ("item_spikes", lastspawn);
if (!spot)
spot = find_spawn_point_class ("item_rockets", lastspawn);
if (!spot)
spot = find_spawn_point_class ("item_cells", lastspawn);
// Fall back to fragging somebody on a normal spot if
// necessary.
if (!spot)
spot = find (lastspawn, classname, "info_player_deathmatch");
// Loop to the beginning of the entity list.
if (!spot)
spot = find (spot, classname, "info_player_deathmatch");
lastspawn = spot;
return spot;
}
if (serverflags & SERVERFLAGS_RUNE_MASK)
{ // return with a rune to start
spot = find (world, classname, "info_player_start2");
if (spot)
return spot;
}
spot = find (world, classname, "info_player_start");
if (!spot)
error ("PutClientInServer: no info_player_start on level");
return spot;
};
This calls find_spawn_point_class