components/prboom/g_game.c
// G_DeathMatchSpawnPlayer
// Spawns a player at one of the random death match spots
// called at level load and each death
//
G_DeathMatchSpawnPlayer
Spawns a player at one of the random death match spots
called at level load and each death
G_DeathMatchSpawnPlayer Spawns a player at one of the random death match spots called at level load and each death
void G_DeathMatchSpawnPlayer (int playernum)
{
  int j, selections = deathmatch_p - deathmatchstarts;
  if (selections < MAXPLAYERS)
    I_Error("G_DeathMatchSpawnPlayer: Only %i deathmatch spots, %d required",
    selections, MAXPLAYERS);
  for (j=0 ; j<20 ; j++)
    {
      int i = P_Random(pr_dmspawn) % selections;
      if (G_CheckSpot (playernum, &deathmatchstarts[i]) )
        {
          deathmatchstarts[i].type = playernum+1;
          P_SpawnPlayer (playernum, &deathmatchstarts[i]);
          return;
        }
    }
  P_SpawnPlayer (playernum, &playerstarts[playernum]);
}
void G_DeathMatchSpawnPlayer ( int playernum ) { int j , selections = deathmatch_p - deathmatchstarts ; if ( selections < MAXPLAYERS ) I_Error ( " " , selections , MAXPLAYERS ) ; for ( j = 0 ; j < 20 ; j ++ ) { int i = P_Random ( pr_dmspawn ) % selections ; if ( G_CheckSpot ( playernum , & deathmatchstarts [ i ] ) ) { deathmatchstarts [ i ] . type = playernum + 1 ; P_SpawnPlayer ( playernum , & deathmatchstarts [ i ] ) ; return ; } } P_SpawnPlayer ( playernum , & playerstarts [ playernum ] ) ; }
G_DeathMatchSpawnPlayer
Spawns a player at one of the random death match spots
called at level load and each death
G_DeathMatchSpawnPlayer Spawns a player at one of the random death match spots called at level load and each death
// no good spot, so the player will probably get stuck